Help to improve DC UPS Circuit

I have designed a simple DC UPS for my network equipment (Modem,Router and RPi). It uses 12v 5AHr Lead acid battery and an Arduino to control the 3 stage charger based on LM317. I haven’t build it yet, want to correct/improve from your valuable suggestions.

Feel free to ask/suggest anything, i really appreciate it.

The old circuit didn’t worked as expected, here is a revised one.

Circuit Features

  • Vin is ~18v DC (may be from an old Laptop charger)
  • Vout can be anywhere between ~11v and ~18v
  • TWO LM317. One is wired as Constant current charger, and one as a constant voltage charger + floating charger.
  • Activate relay for CV/Float charging.
  • The CV charger (~14.4v) function is enabled by default when relay is on. A high input at “FC” will enable float charging (~13.8v)
  • AVR can monitor the Battery voltage from “V1”.
  • Battery charge current can be measured using Instrumentation Amp AD620.
  • It has a HD44780 LCD display, and a button to turn on back-light.
  • During a power outage, the load will be switched to battery without interruption.

Welcome to the forum...

thanks for sharing.

To complete your offering, Could you please upload the code for those that think about building this project.

what did you use to draw your schematic? btw, i couldn't see the inductor value.

What's the purpose of S2, on pin 17 of the '328P?
Pin 17 should have a pullup resistor to 5V, to stop it 'floating' when the switch is open.

Ideally, R12, (the 10K pulldown resistor on the MOSFET gate), should be connected directly between the '328P's pin 4, (BL_PWM), and ground, rather than directly from the MOSFET's gate to ground. Otherwise, R11 and R12 become a voltage didvider when the BL_PWM pin goes high, slightly reducing the voltage applied to the MOSFET's gate. This isn't a really important issue, but moving that resistor would be technically more correct.

If you are going to do analog readings on v1,v2 and v3 I think it's better if you use a resistor voltage divider instead of zener.

Cheers, Ale.

2016-06-03_11-49-35.png

.

Guys, sorry I couldn’t check the forum for last few days. I made a partial prototype of the above circuit and it didn’t worked as i expected. So i made some changes and will upload it soon, along with code.

0xSAM:
Welcome to the forum…

thanks for sharing.

To complete your offering, Could you please upload the code for those that think about building this project.

what did you use to draw your schematic? btw, i couldn’t see the inductor value.

Thanks buddy.

As i said earlier, i will upload the code as soon as possible.

I used EAGLE free version to draw the circuit.

It is a ferrite bead and is optional, I followed the design guidelines from Atmel. It is to separate analog supply and digital supply.

OldSteve:
What’s the purpose of S2, on pin 17 of the '328P?
Pin 17 should have a pullup resistor to 5V, to stop it ‘floating’ when the switch is open.

Ideally, R12, (the 10K pulldown resistor on the MOSFET gate), should be connected directly between the '328P’s pin 4, (BL_PWM), and ground, rather than directly from the MOSFET’s gate to ground. Otherwise, R11 and R12 become a voltage didvider when the BL_PWM pin goes high, slightly reducing the voltage applied to the MOSFET’s gate. This isn’t a really important issue, but moving that resistor would be technically more correct.

S2 is just a switch to change display/turn on back light to read value. Since AVR got internal pullup resistor, you don’t need one externally. But be careful about bouncing.

You are right about R12, i made some changes in the new circuit and swaped it with a BJT.

ilguargua:
If you are going to do analog readings on v1,v2 and v3 I think it’s better if you use a resistor voltage divider instead of zener.

Cheers, Ale.

Since the voltage is supposed swing from 11.8v (empty) to 14.5v (Constant voltage charging), it make more sense to subtract a constant from the voltage and read the rest. It gives me more resolution. Anyway i made some changes in the new circuit, please check it out.

LarryD:
2016-06-03_11-49-35.png

.

Thank buddy.

btw why we need a cap at AREF. i dont see it in the design guidelines.

jishnu_j:
S2 is just a switch to change display/turn on back light to read value. Since AVR got internal pullup resistor, you don't need one externally.

Quite right. I should really have asked if you had the internal pullup enabled. A temporary brain lapse. :frowning:
(They get more common as I get older.)