Without regard to protection from draining the battery, for example if power outages were only a few seconds, can anyone see any problems with this simple design for supplying a low demand microcontroller (i'm thinking Arduino or ESP8266 with nothing attached)?
-
\$\begingroup\$ Depend on your charging current configuration of TP4056 module, the battery might never finished the charging as an ESP8266 could take anywhere from 80mA to over 100mA in active mode. You might want to read ww1.microchip.com/downloads/en/AppNotes/01149c.pdf. \$\endgroup\$– hcheungCommented Aug 30 at 1:00
-
\$\begingroup\$ I was thinking that as the paths to the boost are separated by the “or” diodes, when there is power available, the charging part would be separated due to the reverse biased diode, and be able to charge the battery without regard to the downstream draw. Have I got that bit wrong? \$\endgroup\$– ndavisonCommented Aug 30 at 9:45
-
\$\begingroup\$ You're not asking here for a UPS for a microcontroller, you're asking for a UPS for a microcontroller dev board. This is an important distinction! It also has implications as to the level of complexity you're comfortable with (for instance, if I were to do this project, I would integrate the whole thing onto one custom PCB, but if you're using arduinos and wiring diagrams rather than MCUs and proper schematics you probably want a "lego-like" solution, modules you can stick together with minimal design effort.) \$\endgroup\$– HearthCommented Aug 30 at 18:49
-
\$\begingroup\$ Yep, “lego like” is what I want, hence my original question, will it work ok, without wandering off into the other ways of skinning a cat? \$\endgroup\$– ndavisonCommented Aug 31 at 8:32
2 Answers
Using (schottky) diodes in series with the supply is always a naive solution.
Use a P channel MOSFET with drain towards incoming supply, source towards output and the gate pulled to GND with a pull-down resistor. And now you have a minimal voltage drop instead. And as a bonus, also reverse polarity protection.
I suppose one for the battery and one for your regular supply.
simulate this circuit – Schematic created using CircuitLab
-
\$\begingroup\$ Does the use of two mosfets in place of the diodes act in the same “or gate” manner as do the diodes? Forgive the naivety as I’m more of a coder than electronics guy and I certainly appreciate your input. \$\endgroup\$– ndavisonCommented Aug 30 at 11:49
-
\$\begingroup\$ @ndavison I'm a software guy as well, I just happen to work with electronics :) Neither is an OR gate as such, they just block reverse voltage. But a MOSFET "mounted in reverse" like this with its body diode will have much lower voltage drop than a diode, as specified by the Rds(on) parameter in the datasheet. And this also gives reverse polarity protection, which is strongly recommended whenever dealing with batteries. In case there's a voltage on the GND pin and GND where voltage should be, the gate will get pulled high and no longer conduct, meaning no current will flow through the circuit. \$\endgroup\$– LundinCommented Aug 30 at 11:52
-
1\$\begingroup\$ CircuitLab can show the body diode, just edit the MOSFET properties, and choose "ENH_BD" for the "DISP" parameter. \$\endgroup\$ Commented Aug 30 at 13:18
-
1\$\begingroup\$ @SimonFitch Obviously I should have thought of changing DISP to ENH_BD :) Fixed, thanks! \$\endgroup\$– LundinCommented Aug 30 at 13:27
No problems is to short for an answer.
So I'll mention that ESP8266 wants 3.3V not 5V, but making 3.3V from 5V or lithium battery voltages is not going to be problem for the XL6009 based SEPIC in your picture.
-
\$\begingroup\$ Thanks for that. I failed to mention the esp8266 is of the nodemcu type so it regulates the 5v down to 3v3 on its dev board. Sorry about that. \$\endgroup\$– ndavisonCommented Aug 30 at 9:48