Eliminating processor reset when switching to battery backup -SOLVED [post #25]

I am switching the power source to an 8266 using a small YX850 Emergency Converter [Power failure automatic switching standby battery universal emergency converter | eBay].

On loss of "wall wart" AC the switcher enables a small lithium ion battery pack. The problem is I cannot have the 8266 reset when this switchover occurs. Unfortunately the relay contact closure is not quick enough to prevent a dip in the 5 volts feeding the processor and it resets.
It also resets going back to restored AC power; which makes sense I suppose.

I tried a 10uF 16v polarized capacitor across the output thinking this might prevent the momentary DC level drop but it was not a solution. Perhaps a bigger cap is needed. ???

What would have been nice is an onboard threshold adjustment that would allow you to set the incoming voltage level that the converter switches at.

Maybe a solid state switcher that does not rely on electrical contacts will end up being necessary.

Any suggestions how to tackle this are appreciated.

Mister Ed

The voltage drop when (constant) current is drawn from a capacitor is given by Q = Cv = it

So you can see the voltage on a 10uF capacitor will fall by 5V if a current of 50mA is drawn from it for 1 millisecond.

What current does your "8266" circuit consume when its running?

I'd suggest you need a MUCH bigger capacitor

1 Like

Depending on the voltage levels you could have a diode from each power supply to your circuit , that switches automatically - or just have the relay disconnect the battery when mains is on , and have a big cap on the mains psu so it holds up long enough .
Switching big capacitors can be hard on relays

If the 8266 is drawing 500mA then a 200,000uF capacitor would keep the output voltage above 4.75V for about 100ms. That should be long enough

1 Like

I assume the wall wart is 5VDC. What is the voltage of the battery pack? And if you are using an ESP8266 module, could you identify which one?

The spec data I found indicates it draws typically around 70 milliamps but can go towards
250 ma depending on what outputs it might be driving. In my case only a single 3 volt LED is used in my code.

Then a 100,000uF cap will keep the voltage above 4.75V for 100msec. That should be long enough

I found data indicating a max of 250ma with a normal level around 70ma. So a 100,000uF cap
might get the job done.

Man, you are quick. I just responded with that same 100K value as you replied. LOL

The 8266 is a Wemos D1 mini version. The battery voltage is around 3.9 volts and the converter
trickle charges it with around 4.2 volts while supplying 4.9 volts to the processor while AC is present.

Not really, I suggested a 200,000uF back in post 4

The D1 Mini has an onboard 3.3V linear regulator that supplies power to the ESP8266, which is a 3.3V processor. Instead of that thing with the relay, you might consider this circuit, which would automatically switch over with no dropout:

Backup battery

The schottky diode will drop the 4.9V to about 4.6V, but that should still be plenty of room for the 3.3V regulator. But when it's on battery, there's very little headroom for the regulator. That's why the mosfet is used - to eliminate the voltage drop that a diode would cause.

I would be interested in knowing the voltage on the D1 Mini's 3.3V pin when it's being powered by the battery.

I think he may opt for your suggestion when he finds out the price of a 100,000uF 10V cap

1 Like

Probably more than my whole project to date. Lol...

There is 3.26 vdc on the 3.3v pin of the processor with 4.0 vdc coming from the battery pack.

Your suggested circuit has piqued my interest and looks like a practical solution. :+1:

edit-

could I still trickle charge the battery pack with the eBay converter and use your circuit?

Exactly how are supplying power to the D1?
From the schematics I see the only way is through the USB connector.
The nominal voltage for a Li-ion battery is typically 3.6V or 3.7V, is that what you are using?

Well, lithium batteries aren't supposed to be trickle charged. In any case, it doesn't appear that the eBay converter is a charger. Do you have a charger in your circuit?

Yes sir, I am employing a NI-MH for backup power; it puts out around 3.8 -3.9v. The battery
converter module provides about a 3.9v trickle charge when working off the wall wart.

The D1 mini has a +5v pin right on the corner with a GRD pin next to it. Across on the other side
is a 3.3v output pin.

The converter module has a +- DC IN and a +- Batt IN while on the other end is a +- DC OUT.
There is some voltage regulator circuitry for the trickle charge and a 5 pin SPDT micro miniature relay.

I had thought about simply replacing the existing mechanical relay with a solid state opto-coupled (SSR) unit but was not certain it would be the best approach.

edit- corrected battery type

Correction, I am all wet here. The battery pack is in fact NI-MH.

The eBay converter provides around 4.2v to the battery pack when the wall wart has AC.

https://www.ebay.com/itm/185821028909?chn=ps&mkevt=1&mkcid=28

$15 and it IS large....lol