Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 12:53 12 Nov 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Microcontroller and PC projects : Power Failure Chips

     Page 1 of 2    
Author Message
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:03pm 13 Dec 2018
Copy link to clipboard 
Print this post

Does anyone know any chips/circuits that could do the following please:

I want to run a MM from a 5V supply for various reasons
BUT
I would like to have a battery backup so that if the power fails the MM will automatically switch to the battery without stopping then once power is reconnected switch back to mains power again

Is this possible?
has anyone does it?
Does anyone have any circuits or ideas for chips to be used?

The External battery will be a 5V battery because of other devices that also need 5V

 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 09:28pm 13 Dec 2018
Copy link to clipboard 
Print this post

Depending on how much power you will need to use, and if your other devices will run on 4.5 volts, it could be as simple as a 3-AA battery box with a (perhaps Schottky) diode feeding into the 5V input. The 5V supply from mains should also have a diode to prevent any possible harm to the 5V supply when it is off and the battery is supplying power.

If more power may be required, 2 18650s or a 6V or 12V SLA with ebay adjustable DC-DC switching power supply set at, say, 4.9 volts with diodes could also be used.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 11:24pm 13 Dec 2018
Copy link to clipboard 
Print this post

Very little power actually - probably less than 100mA
I need some way of detecting the power loss from the main 5V psu
I intend to include a charge circuit so it can charge the battery if the voltage drops on it

 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9754
Posted: 11:42pm 13 Dec 2018
Copy link to clipboard 
Print this post

I do that all the time with my stuff that needs to remain working if there is a power cut. I do it the same way as lizby suggests in his post above - a diode gate.

I use rechargeable batteries, so that when powered, the battery is trickle-charged, but when the power fails, the battery can take over. All fully automatic.

I DON'T run a 5v battery though, I use a 9v rechargeable currently, and have LDO regulators in front of the MM a-la the MCP1703 series of regulators which only have a 200uA quiescent current.





EDIT: Just saw your mention of power failure detection. I have added that to the diagram above. This is how I do it. Just monitor the MM pin. When the pin is zero, the power has failed. When it is high, the main power is OK.

Please note that this trickle-charge method is NOT suitable for LiION batteries without additional battery protection etc, but for rough and ready NiCd or NiMH, it works beautifully. It is easy enough to also add DC power failure and battery monitoring via a couple more MM pins if required.Edited by Grogster 2018-12-15
Smoke makes things work. When the smoke gets out, it stops!
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 01:25am 14 Dec 2018
Copy link to clipboard 
Print this post

  lew247 said   Very little power actually - probably less than 100mA
I need some way of detecting the power loss from the main 5V psu
I intend to include a charge circuit so it can charge the battery if the voltage drops on it

Note that with the diodes, you don't need to do anything to switch to the new power supply, so unless you want to do something else when mains power drops out, you don't need to detect that it is gone.

100mA is not necessarily a small amount, depending on how long you expect to have to run. (The picaxe has a nice feature whereby you can determine the voltage which is powering the device. You can tell when you drop from 5V to 3-AAs at ~4V5, so no external circuitry is needed to tell you that you've lost mains power. I don't know if anything similar is available on the micromite (and which one)).

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 01:30am 14 Dec 2018
Copy link to clipboard 
Print this post

  Grogster said  ... I DON'T run a 5v battery though, I use a 9v rechargeable currently, and have LDO regulators in front of the MM a-la the MCP1703 series of regulators which only have a 200uA quiescent current.


Nice setup.

What does D3 do for you in the circuit shown?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Grogster

Admin Group

Joined: 31/12/2012
Location: New Zealand
Posts: 9754
Posted: 02:46am 14 Dec 2018
Copy link to clipboard 
Print this post

In all honesty, it could probably be removed. My reason for including it, was that I did not want any parasitic power going down the line and into the output of the PSU when it was off if there was a mains fail. When I think about it some, the potential-divider would prevent anything serious happening there, so you could probably remove D3 entirely.
Smoke makes things work. When the smoke gets out, it stops!
 
Bill.b

Senior Member

Joined: 25/06/2011
Location: Australia
Posts: 242
Posted: 03:50am 14 Dec 2018
Copy link to clipboard 
Print this post

Hi

I have one of these power packs to run a pi3 when power is removed. Connected to a 5v usb for normal aperation, when power is removed the battery takes over.

This unit is rated at 10,000ma/h and runs a pi3 for several hours, once pwer is restored the batterie will swith to charge.


https://www.banggood.com/Original-Xiaomi-New-10000mAh-Power-Bank-2-Dual-USB-18W-Quick-Charge-3_0-Charger-for-Mobile-Phon e-p-1245220.html?rmmds=search&ID=3269&cur_warehouse=CN

Bill

In the interests of the environment, this post has been constructed entirely from recycled electrons.
 
disco4now

Guru

Joined: 18/12/2014
Location: Australia
Posts: 1044
Posted: 04:16am 14 Dec 2018
Copy link to clipboard 
Print this post

Hi Bill,
Will the one you refer to supply output while it is charging?
I have about 4 of these usb battery things and only one, the first I got will supply an output while it is charging.

Regards
Gerry
F4 H7FotSF4xGT
 
Boppa
Guru

Joined: 08/11/2016
Location: Australia
Posts: 816
Posted: 05:41am 14 Dec 2018
Copy link to clipboard 
Print this post

I had that issue with my replacement one, by charging the pack, it also recharged the phone it was connected to- worked well until I dropped it and smashed the case

I have 3 replacement ones now and none of them do it, which is a pain, as I only have a single outlet charger in the car
Was really handy as I could just daisy chain and recharge both at the same time while driving

oh and plus one for Grosters diode steering system, Ive used that for decades, first saw it in an old burglar alarm system and 'pinched' the idea- it even trickle charged the battery while the mains was available, just a diode and resister to put (from memory) a few mA into the battery (old SLA style mind you)Edited by Boppa 2018-12-15
 
Turbo46

Guru

Joined: 24/12/2017
Location: Australia
Posts: 1646
Posted: 05:47am 14 Dec 2018
Copy link to clipboard 
Print this post

Hi All

The specs on the site say:

  Quote  - Support charging and discharging simultaneously


I have two by Comsol and they do also. Strangely though, one output on one of them is not recognised by the iPhone while charging but is OK for the Kindle. Note that they usually turn off when the current is too low. Good for a portable supply as well.

Another BillEdited by Turbo46 2018-12-15
Keep safe. Live long and prosper.
 
jwaldha
Newbie

Joined: 14/01/2016
Location: Hungary
Posts: 10
Posted: 08:49am 14 Dec 2018
Copy link to clipboard 
Print this post

  [ said  QUOTE=lizby (The picaxe has a nice feature whereby you can determine the voltage which is powering the device. You can tell when you drop from 5V to 3-AAs at ~4V5, so no external circuitry is needed to tell you that you've lost mains power. I don't know if anything similar is available on the micromite (and which one)).


The MicroMite has similar feature with the readref CFunction.
Example:

library list
CFunction readref
End CFunction
list
Dim tmp As integer
Dim corr As float
tmp = readref(corr)
Print "Vcc: "; 3.3 * corr
run
Vcc: 3.25618
Edited by jwaldha 2018-12-15
---
JWaldha
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 09:34am 14 Dec 2018
Copy link to clipboard 
Print this post

Thanks everyone
I've decided to get one of THESE
It will supply up to 2A and auto switches over on power loss
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 02:02pm 14 Dec 2018
Copy link to clipboard 
Print this post

Good find. From reviews, it seems that some of these auto-switch upon power loss without an issue, and some glitch in ways that cause the device (an r-pi in these cases) to reboot. Is it likely that these glitches could be resolved with a big capacitor, and if so, how big?

PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
circuit
Senior Member

Joined: 10/01/2016
Location: United Kingdom
Posts: 290
Posted: 02:03pm 15 Dec 2018
Copy link to clipboard 
Print this post

  lizby said   Good find. From reviews, it seems that some of these auto-switch upon power loss without an issue, and some glitch in ways that cause the device (an r-pi in these cases) to reboot. Is it likely that these glitches could be resolved with a big capacitor, and if so, how big?


In principle, yes, a capacitor may well suffice.

How big depends entirely upon how long is the glitch. The length of the glitch would have to measured (not easy to do with unpredictable glitches...) in order to determine the size of capacitor required. Edited by circuit 2018-12-17
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 11:30pm 18 Dec 2018
Copy link to clipboard 
Print this post

I believe that Mikroe has a few Click-board solutions for this. Here is just one.
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 12:43am 19 Dec 2018
Copy link to clipboard 
Print this post

  Tinine said   I believe that Mikroe has a few Click-board solutions for this. Here is just one.

For $23.75 (for 5), I would just suck it and see with, say, 470uF or 1000uF (if I happened to have one that glitched). Could be useful for some applications, though.
PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
Tinine
Guru

Joined: 30/03/2016
Location: United Kingdom
Posts: 1646
Posted: 02:08am 19 Dec 2018
Copy link to clipboard 
Print this post

More of the range, here. They also have buck converters.
 
lew247

Guru

Joined: 23/12/2015
Location: United Kingdom
Posts: 1702
Posted: 01:18pm 20 Dec 2018
Copy link to clipboard 
Print this post

THIS




Works beautifully
It keeps the Pi running with no issues when I disconnect the mains power
Edited by lew247 2018-12-21
 
lizby
Guru

Joined: 17/05/2016
Location: United States
Posts: 3470
Posted: 02:17pm 20 Dec 2018
Copy link to clipboard 
Print this post

Very nice. Which pi, and for how long will it run on the battery?

Last year I tested an R-Pi-ZW with camera on a so-called 350VA UPS; lasted 6 hours 18 minutes. I know the UPS (12v-120V-5v) is very inefficient.


PicoMite, Armmite F4, SensorKits, MMBasic Hardware, Games, etc. on fruitoftheshed
 
     Page 1 of 2    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025