UC3906 SLA Battery Charger 2.5Amp
This project is a follow-on to my original SLA charger project. If you're not familiar with it, please have a look for the background information. The UC3906 datasheet can be found here, and the UC3906 application note here, and VK3EM's project here. (If the UC3906 links are broken, do a web search on UC3906.)
2020-08 Update: As interesting and useful as this project has been, there are commercial products available today that are neater and cheaper than projects like this. For example, the NOCO Genius series. I'm not throwing my chargers away but I probably wouldn't build another.
My 55 AH Gel-Cell battery finally packed it in after more than 10 years. I credit its long life to my UC3906 charger. I replaced the battery with a larger 100 AH deep-discharge marine SLA battery. I wanted a charger with more oomph since the previous one was only 1 Amp. This one is good for 2.5 Amps. It is based on the same UC3906 charger chip, with a beefier power supply and pass transistor. In addition, I added an ATtiny461A to monitor the state of the charger.
(Click to enlarge the schematics.)So to know what state the charger is in you also need to know the charge current. If OC is on, it may be in bulk or overcharge mode. If the current is at or near Imax, it is in bulk charge mode. When the current drops off, it is in overcharge mode. When SLC goes on (and OC off), the battery is in float charge mode. You might also be able to distinguish between bulk and overcharge mode by watching the battery voltage, if you know what Voc is, but current is more useful.
VK3EM's project provides for an LED to indicate float charge mode by monitoring SLC, which is fine as long as everything is working right. I don't agree with VK3EM's comment about the elevated charge (overcharge) indicator circuit, that the OC pin changes state from bulk to overcharge mode. I did not observe this consistently (although it would have been nice if it had). Interestingly his Elevated Charge circuit is 'not fitted', possibly because it didn't work as planned.
VK3EM's charge current monitor circuit is of dubious value, as he documents in his paper. Measuring tiny voltages across a small value resistor sitting at the supply voltage rail is very difficult and even harder to interface to a microprocessor. I decided to try a different approach, to use a Hall-Effect current sensor from Sparkfun Electronics, p/n BOB-08882*. This contains a ACS712 5 Amp Hall-effect linear current sensor chip. The in-line resistance is almost negligible, so I put it in the output line to the battery. It is completely isolated from the circuit it is sampling, and it outputs nominal 185mV/A which can be measured by the ATtiny861 A/D at ADC0 using the 2.56V internal reference voltage. The ACS712 is a bipolar sensor, and it needs a way to indicate both positive and negative currents. It does this by outputting 2.5V (assuming Vcc is 5.0V) when the current is zero. Since I'm using 2.56V as Aref, I can't allow the voltage to increase with increasing current, so I wired the sensor the other way around, so the Vout decreases with increasing current. In this application, Vout goes from 2.50 volts at no current to around 2.0 volts at max current. There's no problem dealing with this in the software. There are defines for Vcc and the sensor transfer function ("Sens"), which can vary from 180 to 190 mV/A according to the spec sheet. You can measure AVcc, and infer Sens from the accuracy of the current display. Note that the resolution of the A/D is not quite up to the job, so at the low end the readout goes from 0mA to 16mA to 27mA etc., but it's good enough for this project.
* Sparkfun has another version of the ACS712, with an op-amp built in, p/n SEN-08883, I didn't use this part, please don't confuse them.
(Sorry about the messy build. I usually don't plan things in much detail, except to ensure all the parts will fit somewhere, and the front panel looks decent. The case comes from a fleamarket minus the front panel and chassis, which I provided from my scrap bin.) You can see the ACS712 breakout in the right photo, on the right-hand side, wired between the fuse holder and the wire going to the output connector.
The ACS712 Hall-effect current sensor module.
Id | 67 mA |
Vf | 13.8 V |
Voc | 14.3 V |
Imax | 2.5 A |
Vt | 10 V |
It | 25 mA |
Vin | 18 V |
RA | 157.5K |
RB | 14.15K |
RC | 34.3K |
RD | 789.5K |
RS | 0.1 |
RT | 220 |
Fault PI | The UC3906 PI (Power Indicate) status is off. Possible failed UC3906 or power supply. |
Fault TM | Charger has been in bulk (or over) charge for too long. May indicate a bad battery. |
Fault VO | Charger is in Float mode but Vout is too low. May indicate a failed UC3906. |
O=x SL=x |
"Unknown
state" which my routine determine_state has not accounted for. For
example, when OC=0, SLC=1 which indicates float charge but the current
is too high. |
Further, I added R110 to make the fan run slowly all the time to counter the small heat build-up in the case during float charge.