"UPS" for arduino with supercap, battery bank and relays

Hi all!

I'm "working" on a project (read: thinking it out, putting items in my basket, tinkering with parts I already have) where keeping power is VERY essential. It is connected to mains but if the power cuts out I need it to continue on without interuption. I have googled an thought of a few options, having a couple 18650 in line with mains, getting a ready made ups, etc etc, but I just thought of a solution I can't find much about which makes me think I am missing something that makes the idea stupid. The idea is as follows:

The mains power adapter goes through a super cap to the VIN, but mains also puts 5v on a NC relay, opening it (with nothing connected). On the NO terminal I have connected a battery bank. The second mains goes down the relay switches to the battery bank, the super cap bridges the fraction of a second the relay switches and it continues to have power. I also put the supercap through a relay on NC which opens right after the battery bank takes over. The battery bank then charges the supercap, and when mains comes back the relay between the arduino and the batterybank opens (thus cuts power), and the supercap charged by the battery bank but from then on by mains takes over again.

I am most likely missing something stupid here, but I can't figure it out.

Happy to get some input!

Don't mind the janky way I made this, I hope this is a clear enough representation. The red lines into the relays are the switching voltages

EDIT: The delay(100) can be skipped actually, but that isn't really the point. The point if it's physically possible or if I'm missing something stupid

What are your limits for voltage? i.e. if the board is running on 5v but could work at 3.6V, a simple pair of diodes with an 18650 will work. If you cannot stand the diode drop when operating on 5V there are ways to add a mosfet to eliminate the drop.

It has to be between 4.3V and 6V as far as I can find

EDIT: But yes I am planning on running it on 5v. What I understand is my plan isn't the right path? I don't know nothing but compared to you, probably, I do know nothing so I'm afraid if I go mess around with 18650 cells I'll mess up the charging circuit and creating a fire hazard. I was hoping to eliminate all that by just grabbing an off the shelve power bank situation and only messing with the 5v coming out.

No it WONT! The capacitor is a DEAD SHORT across the battery until the cap develops some charge, which may take some time with a supper cap. You MUST use a current limiting resistor in series with the capacitor to avoid the short. Recharging a super cap takes quite some time.

You might consider using 4 x AA alkaline batteries, two diodes and you should be fine. What Arduino board are you using? Where on the Arduino board are you connecting the current 5v supply?

I could make a quick sketch.

Oh shit, duh... I'm not even sure why the second relay would even be there now I look at it again... I only need a buffer, that's it. This would work, right?

Oh wow that would be amazing!! I'm using a Wemos D1 mini clone. It does not technically have a VIN pin, but the 5v pin can handle 4-6V from what I've read in documentation

No, your super cap is in series with the line to VIN. So it acts like an insulator. Any use at all has to be between VIN and ground to supply power. BUT! to charge it, you need a current limiting resistor.

Looking at the schematic for your board, internally everything works on 3.3V. So you can easily use some AA's. You need to use 3 x AA NOT 4 x AA.

D1 and D2 can be most any diode. The common 1N4001, 1N4002, 1N4004 will work fine.

In the below, the diodes (D1 and D2) only conduct when the Anode is higher in voltage than the Cathode. Think of it as a one way valve.

As long as the 5 volts coming in is greater than the 4.5 volts, the AC adapter will supply power. As soon as the 5v drops below 4.5 Volts, the batteries take over.

image

1 Like

That's genius. Thank you so much! I could have never come up with this but now I see it it makes so much more sense.

Oh yeah no that's the janky drawing. I've only drawn the + of the supercap, the - is connected to ground, so it would be parallel to the power sources (battery pack or mains depending on the relay). Current limiting resistor makes sense, I had not thought of that but I have made a mental note. I'm going with the design JohRob made for me though, but it nevertheless still is fun to think these things through (:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.