The following article discusses a simple automatic micro UPS circuit which can be used with modems for acquiring uninterrupted power from a DC source, and battery during mains power failures. The circuit also incorporates an automatic over charge cut off, and a low battery indication feature. The circuit was requested by Mr. Kapil Goel.
Technical Specifications
Hi Swagatam, How are you, and was really happy to read your blog as I was scrolling through circuit sites for my requirement.If you can help me out for that, I have a requirement:
This is exactly what my requirement is: I have a 12volt operated device, it consumes approx 35 watts right now I power it up using a 12volt adapter, but when main power fails its get rebooted..
I wanted to use 12volt 2200mh Li-ion battery pack so that whenever there’s a power cut it will automatically shift to battery.
Also, the circuit should have over charge protection, and low battery indicator.
At last I am not asking this circuit for free, as I am ready to pay for it. Many thanks in advance
Regards, Kapil Goel
UPDATE: New Simplified Micro-UPS Circuit
No need to build the op-amp based complex circuits explained in the following article. You can simply build and the implement the below shown simple micro-UPS circuit for your modem UPS application:

The zener diode D1 value must be selected such that the output voltage across R3 is slightly less than the maximum full-charge level of the battery. For example, if the maximum full charge level of the battery is 14.3V, then select the D1 value appropriately which generates around 14V across R3.
The R2 value can be calculated using the following formula:
R2 = 0.6/Battery charging current.
For lead acid battery, the suitable battery charging current can be around 10% of the battery Ah, and for Li-Ion battery this can be around 50% of the battery Ah.
Micro-UPS Circuit with Battery Over Charge Cut-off using Op-amp
The design was actually presented in one of my earlier posts also, however it does not include an automatic over charge cut off feature.The present design has similar functions, but has an added protection feature in the form of an automatic battery over charge cut off and also an under voltage indicator.
The proposed circuit diagram of an automatic micro UPS may be understood with the following points:
The input supply is acquired from any standard AC/DC adapter rated anywhere within 15 and 19V DC, current at anything above 1.5 amps.
The above supply is regulated via a 7812 IC whose ground pin is elevated to about 2.4V so that the output from the IC gets raised to about 14.4V rather than the normal 12V.
This is required because the attached 12V battery needs to be supplied with a slightly higher potential than its rated value.
How the IC 741 is Configured
The 741 IC stage is configured as a comparator.
Its pin#2 is clamped to a fixed reference voltage of 4.7V using a suitably rated zener diode.
Pin#3 is rigged as the sensing input if the IC via an adjustable preset.
The preset is adjusted such that the potential at pin#3 just exceeds the potential at pin#2 when the battery voltage crosses the 13.5V mark.
As long as the above situation is not sensed, the output of the IC at pin#6 sticks to it initial zero voltage level which in turn keeps the BC547 transistor switched OFF. With BC547 being switched OFF, the TIP122 gets a chance to conduct via the 1K resistor and charges the connected battery.
The battery terminals are directly connected with the modem which is being used for some application.
This allows the modem to remain powered via the external AC/DC adapter while the battery gets charged simultaneously.
The battery is allowed to charge freely until it reaches the over charge threshold when the output at pin#6 of the IC goes high, switching ON the connected BC547 transistor.
The above switching cuts off the base bias to the TIP122 transistor and stops the battery from getting further charged. This does not affect the modem as it continues to acquire power from the external power supply.
During mains failure, the supply from the external adapter gets inhibited, and the modem starts receiving back-up supply from the battery.
Since no relays are used the transition is within micro seconds which keeps the supply to the modem interrupted during power failures or even under heavy power fluctuations.
If the mains stays absent for long, and the battery reaches its over discharge threshold, the situation is immediately indicated with the green LED, which can be also replaced with a buzzer. The modem should be switched OFF then, to stop damage to the battery due to over discharge.
The adjustment of the 100K preset determines the low voltage threshold mark or the lower indication. level.
Once the green LED is lit, it will remain lit until the battery is fully charged, similarly once the red LED illuminates, it will stay illuminated until the green LED lights up or when the battery voltage level falls below the set lower threshold.

Using a PNP BJT for the above Charger Circuit
The above circuit can be also configured in the following manner, here the LED indications get reversed, meaning red LED shows low voltage while the green LED indicates high voltage threshold.
The following circuit also incorporates a current limiting facility which can be used for providing a current controlled charging to the connected battery.

FEEDBACK from Mr. Kapil
Hi Swagat,
Thanks for the circuit.. I really appreciated your swift and kind response..
I have couple of questions on the same.
1) What will be the max current it will support, my device requires atleast 5 amps 12 volts, will this be able to handle that.
2)As per the circuit, I can see, you have directly connected the modem to the battery, but if I am not wrong, this means that modem will keep on taking the power from battery, and battery will not get charged?
Please I clear out this confusion.
Also I am using a li-ion battery, which has a voltage of 12.6 volts on full charge and 11 when discharged.
Also my input volt is also 12volts, I cannot use a higher volt rated adapter.. will it be able to charge my battery at fullest.
Regards,
Kapil Goel
My Reply
Hi Kapil,
Presently the above shown circuit is rated at 3 amps maximum, so I may have to amend the design to suit your requirements, however the input voltage will need to be above 13V otherwise the battery will never get optimally charged.
The direct connection of the battery with the modem will not affect the battery charging as long as the input source power is active....both outputs will be simultaneously taken care of.Regards.
The modified 5 AMP micro UPS circuit design:





Comments
Gentilissimo Ingegnere Swagatam
Ho scoperto il suo prezzioso sito, con l’occasione le porgo un mio problema, possego un inverter di 1000 watt, vorrei collegare alla rete in modo che quando va via la luce l’inverter si accende in automatico e viceversa puo’ farmi avere un circuito non troppo complicato, nel mio paese ci sono 230 vl.
Aprezzo il suo sito e’ sopratutto la sua professionalita’ e’ gentilezza.
Un grande saluto dall’ Italia. grazie
Thank you Tommy,
If you want to convert an inverter into an UPS, then you can simply use the concept explained in the following article…
https://www.homemade-circuits.com/how-to-convert-inverter-to-ups/
Please reply sir 🙏
Rolland, I have already replied to all your previous comments, please check then again…
mc78t12 and 78h12a components, can they be replaced with other components, because these components are not available in my location?
You can replace them with this circuit:
https://www.homemade-circuits.com/wp-content/uploads/2021/01/simple-pass-transistor-emitter-follower-volateg-regulator.png
sorry my friend, can you send me a wiring diagram, to replace the 78H12A component, because I saw the picture you sent and I don’t know what kind of transistor it uses?
Hello Rolland, here’s another diagram, you can try:
https://www.homemade-circuits.com/wp-content/uploads/2022/07/simple-voltage-regulator-circuit.jpg
You can replace the transistor with a TIP122.
The zener diode can be a 13V zener which will give you an output of 12V.
https://www.homemade-circuits.com/wp-content/uploads/2013/04/micro-ups-circuit-1-2.png
https://www.homemade-circuits.com/wp-content/uploads/2022/07/simple-voltage-regulator-circuit.jpg
can you help me design one, to replace 78H12A?
That circuit is unnecessarily too big,, i can make it smaller, please tell e your complete requirement I will try to provide you the appropriate circuit design…
3x wifi routers 12v/1.5amp, please help?
You can try the following concept:
https://www.homemade-circuits.com/wp-content/uploads/2024/11/DC-to-DC-UPS-for-routers.jpg
Assuming the routers consumption is 3 * 1.5 = 4.5 Amps, all the diodes should be 6A4 diodes.
The TIP122 must be also replaced with TIP142.
Battery should be rated at 12V, 20 Ah.
Zener diode D1 must be selected such that the voltage across R3 is equal to the full charge level of the battery (without battery connected)
Good day Mr Swagatam,
thanks for your awesome website you have.
Q. Can the li-ion battery be replace by a lead acid battery in the same curcuit.
kind regards
Moerdyk
Thank you Moerdyk,
Yes you can replace the Li-Ion with a lead acid battery. Just make sure the input current is not more than 10% or 15% of the battery’s Ah rating
Your comment is awaiting moderation.
I have made the pnp bjt circuit. And when i give power in power pins just green led bright shine and red one also lighting in little shine. And even i provide power in only battery pins also same happening. Should i connect battery and power togeather at once to work this? And also when i turn 10k preset only green led goes to dim mode and never completele shut off. And 100k preset do nothing. But i never tried circuit with battery and power both at once. Only trying to test. Please help me.sir.
And sir please tell me how to wire this 100k preset correctly? Maybe my circuit issue is with this preset.
Please remove the 100k preset and the 1K series link, it may be difficult for you to set it up, because the process is complex. Anyway, it is optional.
When green LED shuts off the red LED must illuminate. If this is not happening then something is not correct with your PNP transistor.
I would recommend you to try the first circuit with NPN transistor because it is easier to understand and set up. But again remove the 100K preset link it is not required.
I have connected all correctly but nothing changes. When i rotate 10k only green led status changing no complete shut off any led. Always one goig dim when i rotating 10k preset. And 100k preset do nothing. I can not understand whats wrong. Please help me
Hi, Did you try the first circuit as recommended by me earlier?
If you are newcomer in the field of electronics then you will have to do it step-wise manner.
Please build the first circuit and
Dear Mr. Swagatam,
Greetings from Sri Lanka. First my appreciation of your untiring effort to generously answer each and every question or comment, this is rare in Youtube.
My question is about using three (3) 3.7v 18650 Li-ion batteries instead of a single 12v battery. Could you propose a modification to accommodate this request? Frankly I tried a number of mini UPSs as per some Youtube channels using 3.7v batteries with 3S BMS and Booster converters. But did not succeed in holding the backup for more than 5 minutes for my wifi router. I am using some good Samsung batteries taken out of laptop battery packs.
Look forward to your kind response since our country is going through sever economic crisis and has long our powercuts.
Thank you very much Upul, I appreciate your kind thoughts.
No modifications would be required in the circuit for 3nos 3.7V Li-ion cells in series, except the voltage regulator IC, which can be removed in this case.
If you are not able to get proper back up time, then it is not related to the circuit, rather it is related to the battery or the modem specifications. If the batteries are old or degraded then the backup time will be less, or if the modem is drawing high current also then the battery will discharge quickly and provide lower backup time.
You can connect an ammeter in series with the modem positive line and check how much current the modem is consuming from the battery, this will prove whether the battery is faulty or the modem current is high compared to the battery specifications.
Sir i found 1ohm 1w can i use 3 of them in parallel to get .4 ohm 1w??? And i found 5.1v 1w zener or 3.3v 500mw zener.. can i use any of them??
Arnab, yes you can use the mentioned resistors in parallel, and use the any of those zener diodes.
I think the BC547 feedback with the 0.4 ohm can be eliminated and instead we can provide a current controlled stage at the input stage using LM338 or a simple transistor circuit.
The BC547 stage can be eliminated for simplicity and to avoid confusions during troubleshooting if something goes wrong.
I can provide the alternative diagram if you wish to see it.
Obviously, if you can show it.. it will be the best sir..
Here’s the finalized design, make sure to check all the new modifications included in the circuit, and the things which have been removed:
Actually i already bought the components for 5amp modified which is using 10k and 100k so thought that lets try once. No input was in dc terminal, in the battery terminal i gave 14.3v (100k disconnected) i set the 10k value just to light up the green. (Red goes off). Then connected the 100k without losing the power in the battery terminal (still dc input disconnected) then made the voltage input in the battery terminal in 11V. And adjust the 100k to just shut off the green led, and red lights up. Now, i gave 19v in dc input (disconnected the battery side input)to check the output in modem side. Also in the battery side i got 6 v in modem side.. 0v in battery side..
And also tried disconnecting the dc side and giving 12v in battery side got 13v output in modem side.
Your setting up procedure is OK, but you must have a battery connected at the collector side of the transistor otherwise the circuit will not be able to detect the battery voltage and the circuit will remain switched OFF. You can see in the diagram that IC 741 supply lines get the voltage from the battery, so battery must be connected for the circuit to work.
you can remove the 100K preset link, it is not crucial, according to me.
Sir last one thing from ic741 pin 7
connects with pot 10k to ground and from pin 3 one 10k connects with them OR there is a pot 10k between pin 7 and 3 and connects to ground. Just elaborate me that part.
Sir I tried 5amp modified circuit. But i used lm317t .. the 10k and 100k pot was set as per your information. But when i am giving 12 input instead of battery in the battery input(dc disconnected). I got 13v output in the modem side.. and when i was giving 19v input(12v 3a adapter and xl6009 boosted to 19) i was getting 6v in modem side and 0v in battery port. I can’t understand why this is happening. ( I used 2 6a4 just before the modem output, and 1 6a4 in between the battery and modem side.) Should i replace all tahe 6a4 to 4007???.
Arnab, there’s no 100k pot in the modified diagram. Please do it exactly as shown in the following diagram:
https://www.homemade-circuits.com/wp-content/uploads/2021/06/micro-UPS-with-current-control-compressed.jpg
You said you adjusted the preset correctly, so did the LEDs respond accordingly?
For adjusting the the 10k preset you must provide the maximum cut off voltage across pin#7 and pin#4 of the IC 741, and then adjust the perset so that the green LED just lights up, and the red LED shuts off.
Once this is done you will have to connect the battery across the indicated position, and then switch ON the input voltage. Remember the circuit gets the voltage from the battery and then detects its voltage level. unless the battery is connected the circuit will not initiate.
….Since your are using LM317, the current controller stage can be removed.
Arnab, the 10k preset has 3 terminals, the center terminal goes to pin#3 through a 10k resistor. Out of the remaining two outer terminals of the 10K preset one goes to the line which is connected to pin#7, and the other goes the ground line.
Thank you, Sir, for your quick reply, your project is very helpful. some things I need to know that,
1> MC78T12 also LM338 is not available, can I use LM1085 – ADJ (3A Adjustable Low Dropout) or LM350T or LM317 for my purpose? as I want 1.5 – 2 A output max.
2> For the second circuit can any replacement for .4 ohm resistor?
You are welcome Arnab, yes you can use the mentioned ICs, they are all good regulator ICs.
for 0.4 ohms you can put 4nos of 0.1 ohms/ 1 watt resistors in series, because 0.1 is easy to get.
Thank you sir, two more things to know.
1. For the second circuit 4.7v 400mw zener is unavailable, i found 4.7v 500mw and 4.7v 250mw which one to use?? And what is the 3v zener wattage??
2. For the second circuit all the resistors are 1/4 watt right??
Hi Arnab,
Both the zeners will work, you can use any one of them. The 3V zener can be eliminated and replaced with a wire link, since we already have an LED at the base of the transistor.
all the resistors can be 1/4 watt, except the 0.4 ohm, which can be calculated as = 0.6 x battery current limit
can you send me the components list for 3A supply?
You can try the first circuit, all the part numbers are given in the diagram, you just have to copy them and show it to the part dealer….all the resistors are 1/4 watt 5% CFR
Hi, I really like the above-designed circuit. But in my case, I would like to make a circuit that uses 5S lipo 18650 battery together in a pack for more maH. Can it be used? Also, I need to have 3 output: 5V,7V,12V.For that what changes needed? I’d be very grateful if you amend the design to meet my requirements. Thanks.
Glad you liked the design! Yes it can be used for the mentioned requirement simply by upgrading the transistors to TIP142 or TIP147 depending on which circuit yo intend to build….however for getting 5V, 7V you may have to employ a DC to DC smps
Can you please provide me an entire the modified entire circuit diagram for my requirements,please? As well i want to ise 5S 18650battery together.
There’s nothing complicated in it….You can try the first circuit with the TIP122 replaced with TIP142, that’s all. The circuit for getting 7V and 5V can be attached externally afterwards, by attaching this stage between the router and the UPS output. Here’s one example which can be used
https://www.ti.com/lit/ds/symlink/lm2674.pdf?ts=1610686190808&ref_url=https%253A%252F%252Fwww.google.com%252F
you can try the following also
PWM Solar Battery Charger Circuit
Hi Swagatam,
I have an issue with an existing 5V UPS. Here is the photo: https://www.homemade-circuits.com/wp-content/uploads/2021/01/mini-UPS.jpg
I use it for a lattepanda v.1 uninterruptible ups.There is a strange behaviour to it. When my power supply (led switching power supply 5v, 5a) is plugged in AND is ON everything works as expected (I can unplug it and plug it in a million times), however when the power supply is plugged in to lattepanda BUT I forget to turn it on BEFORE I plug it in, for some reason it interrupts power to the lattepanda. Is there a modification to do to make it work? I’ve tried adding a capacitor (1000mf-2000mf) does not work, a diode does not work, thicken the wire that comes from the power supply (there is no voltage drop). I’m also using a 18650 battery that is rated for 10a. I also used two batteries. I can’t think if something else. Please help 🙁
Hi Haris, You said
“BUT I forget to turn it on BEFORE I plug it in….”
What exactly you forget to turn ON?
My house wall power outlet (sorry for the confusion). If my house wall power outlet is turned OFF and THEN plug the 5v, 5a power adapter to the latte panda’s 5v UPS, then it interrupts power. IF my house wall power outlet is ON then there is no problem pluging and unpluging to the UPS (it does not interrupt power). It is very annoying because if I forget that the wall power outlet is off the lattepanda restarts. Why is it behaving this way?
Haris
Does the problem also happen with loads other than the lattepanda? If no then the issue could be something related to lattepanda, may be an initial high current draw etc. If the problem is happening with all loads then the issue is with the UPS board which can be diagnosed only by testing it practically.
There doesn’t seem to be a quick external solution to this, except connecting an LED at the input side of the UPS which will indicate whether the supply to the UPS is ON initially or not.
Sorry for the poor connection diagram, I’m not an electrician.

The power supply is a 5v 5 amp LED driver ( I did tried other power supplies and I have the same issue). I tried more powerful batteries same result. I tried the 1k resistor mod that you said, same result.
Thanks for the detailed diagram.
Now it seems much easier to analyze the fault.
You said right, a diode should solve the issue. A diode in series with the socket positive wire should do the trick.
The problem could be happening due to the high value capacitor across the output leads of the SMPS. This capacitor could be causing a momentary drop in the battery voltage and consequently the erratic behavior from the lattepanda….
It is quite strange. Everything works great when the power supply is connected on the lattepanda and the wall outlet is ON. Initial current of 1.8 amps and then it drops down to 1.2 amps. I can plug and unplug the adapter just fine….the problem is that it restarts even when I have the power adapter in my hands! (its not connected to the wall outlet). I just plug the power adapter connector to the lattepanda and it restarts! Will a diode work? I did try many 5v UPS’s from china. Most are up to 1amp max current and they don’t work. However, the eletchsup DD04CVSA was the only one that did support 2a and wasn’t restarting the lattepanda BUT it couldn’t charge my battery while the lattepanda was on (too much current is drawn from the lattepanda).
That sounds strange, it could be due to some low voltage discharge from the UPS board capacitor. I do not know much about lattepanda, so I am not sure what exact “restarting” means, because whenever it is powered it should naturally reboot just like any other computer….unless it has an internal battery.
A diode won’t help, since it will still allow any residual voltage to pass to the lattepanda and cause rebooting. A transistor switch might just help solve the issue.
You can try connecting a 1k resistor across the output leads of the adapter, so that it discharges any residual voltage from the adapter. By the way how is the adapter connected to the UPS board?
A proper wiring diagram across the respective units would help to understand the situation better.
It is given in the diagram itself.