Recreating a battery charger to learn LTspice and EasyEDA

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I've got lots of NiMH cells around to power all sorts of things. But it seems that when I need a fresh set, I've always got to charge them first. I came across a video by Big Clive where he built a little trickle charger that was good for NiMH and NiCad cells.


First, I was curious about the thing he mentioned where when the cells are full they form oxygen and hydrogen on the electrodes, but then it recombines into water. So the cell neither vents nor dehydrates. I don't understand it all, but apparently, NiMH cells can be maintained by a very small current without damage.

Second, I was interested in how to choose the various components to build the charger. I don't know if Clive did a bunch of math off camera, or just intuited it, but rather than simply copy what he did, I want to see how it all works. I've been trying to learn LTspice, and this seems a good project to simulate.

Third, I thought it would be neat to finally get one of those custom PCBs that You Tube DIYrs are always advertising. So I figure this would be a good project for using EasyEDA too. I came across this video of a tour of JLCPCB, and thought it was rather fascinating:


Anyway, starting with the cells, I've read that a safe trickle charge current is 0.03-0.05C. My cells have 2,600mAh (I tested some) so to be on the safe side, I went with 0.03C which works out to 78mA. I've also read that NiMH cells have around 50mΩ internal resistance.

I drew up the schematic (with only 1 cell for now) in LTspice, and this is what I got:
AAchargerSchematic.png

AAchargerSimulation.png

I used the modified Ohm's Law (R=(Vt-Vf)/If) to find the resistor value for the power indicator LED, and LTspice agreed with my math. But I used the same equation to find the resistor value for the charge indicator LED, and LTspice says I'm way off. Either I'm using it wrong, or my math is wrong. Maybe both.

I've got some parts on the way, so I can build this circuit temporarily to see what the real values are. I wonder if it has something to do with there being a cell in the circuit that isn't the voltage source. Like maybe the voltage is causing some sort of "push back" against the forward current, and that's why the resistors have to be a smaller value?

It's late, but maybe tomorrow I'll try something like R=(Vt-Vf-Vc)/If where Vc is the cell voltage. I wonder if that would mean that putting a discharged cell in would allow too much current through the LED because of the lower cell voltage...
 
Last edited by a moderator:

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I spent some time searching around the internet, but haven't found any circuits like this, or anyone trying to do math like this.

I've simplified the circuit to only include the voltage source, the cell being charged, and the resistor to limit current. Now the only variables should be the voltage of the cell, and the resistance of the cell and resistor.
AAchargerSimplified.png

According to LTspice, I need a 46.74Ω resistor to limit the current to 0.078A. If I simplify further, and remove the battery, then I would need a 65.38Ω resistor for the same current. It seems the battery is acting like an 18.64Ω resistor rather than the 0.05Ω internal resistance that I'm using. I don't know how to explain this. Maybe I've entered the battery into LTspice wrong? Or maybe it has something to do with the fact that the battery has its own voltage and I'm not taking that into account somehow?

I wonder if I should be subtracting the cell voltage from the source voltage right away since they're apposed to each other. Maybe if I search for 2 sources in parallel. That's kind of what's happening here.
 
Last edited by a moderator:

crutschow

Joined Mar 14, 2008
38,322
According to LTspice, I need a 46.74Ω resistor to limit the current to 0.078A. If I simplify further, and remove the battery, then I would need a 65.38Ω resistor for the same current. It seems the battery is acting like an 18.64Ω resistor
No.
The removal of the battery means the battery voltage is no longer opposing the charger supply voltage, so there is 1.45V more voltage across the resistor which, from Ohm's law, increases its current.

If you want the current to be independent of the battery voltage, you will need an active-circuit (transistors, etc.) constant-current source.
 

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
The removal of the battery means the battery voltage is no longer opposing the charger supply voltage, so there is 1.45V more voltage across the resistor which, from Ohm's law, increases its current.
I think that is exactly what I've been doing wrong. This time I went through and subtracted the cell voltage from the source voltage, as well as the voltage drop across the cell (based on the internal resistance) and got the exact number that the simulator wanted.

In addition, I took one of my freshly charged cells and set it up in a real-life circuit and got nearly the same results.
1707273399833.jpeg

I also calculated the internal resistance of the cell using IR=ΔV/ΔA. I don't have the best measuring equipment, but I got around 0.2Ω rather than 0.05Ω like the internet suggested. I've been told that internal resistance of a cell will change depending on the cell's state of charge. But "full" is the one I'm interested in.

With all that figured out, I'm now able to add the other components back in, and the simulator still agrees with my calculations.
AAchargerSimulation.png

I can now limit the LED current to 25mA, and still get 78mA through the cell. Just for fun, I asked the simulation what the LED current would be if I were to put a 0.9V depleted cell in. Around 40mA is what I got back. That doesn't take into account the change in the cell's internal resistance though. I don't know how much it would change though.
 
Last edited by a moderator:

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I've got the rest of the charger designed, and the ideal resistors have been replaced with ones that are actually available. Didn't change the current significantly.
AAchargerSchematic.png

Next is to design the circuit board with EasyEDA. I have all the parts already except those two resistors I was having trouble figuring out.
 
Last edited by a moderator:

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
The wiring diagram in EasyEDA was pretty easy.
AAchargerWireDiagram.png

Not every component has a corresponding "footprint" to go with it. Seems I need those in order to design the actual circuit board. Still working on the measurements of the cell holders, but this is what I've got so far:
AAchargerCircuitBoard.png

It looks a lot like Big Clive's board, since that's what inspired the project in the first place. What other way would the cells be configured though? I did move the power LED to the top. I just like it there better.
 
Last edited by a moderator:

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I finally got all the parts together today. Also, I'm trying out my new work mat.
20240403_160622.jpg

It all went together pretty easy, except for the LEDs. Not sure if the soldering iron was getting them too hot or something else. But they kept failing after installation. Eventually I got all 5 working though. These LEDs are not new. I found them in a stash of old electronic parts. It could just be age making them fragile. But now that they're in, they seem to be fine.
20240403_172532.jpg

Hard to tell from the picture, but the power LED is on as well as the indicator for the 4th cell. Each LED is getting about 2.4V, which is what I was hoping for. I'm not sure yet exactly how I want to power it. I'm thinking of making several of these for different sized cells, and building some kind of enclosure for it that uses a single power cable. I made sure to include several holes for mounting.
 
Last edited by a moderator:

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
After maintaining 2 cells for about a day, the numbers settled to about 1.66V and 74.9mA. I was shooting for 1.46V and 78mA, but the real numbers are close enough for me. I decided to add an older 2.1Ah cell, and after a while I took a thermal picture:
2024-04-05-19-40-14.jpg

The resistors are a little warmer than I'd like, but I think they'll be ok. I also found an old NiCd 600Ah cell that turned out to be at 0V. It didn't take long to boost it up to 1.4V with a manually controlled power supply, and I added that to the maintainer too.
20240405_194833.jpg

The whole board uses 0.33A which is exactly what I figured it would. So at least I got that number right. From what I've read, NiCd cells can accept 0.05-0.1C as an indefinite trickle charge. So I figure this one should be fine in the maintainer. It's gotta be better than sitting around at 0V right?
 
Last edited by a moderator:

Audioguru again

Joined Oct 21, 2019
6,826
Energizer Ni-MH manual says that a Ni-MH battery should never be trickle-charged at more than 1/40th of its capacity rating. Their AA cells are 2300mAh then the maximum trickle-charge is 2300/40= 57.5mA.

When I used NiCad cells many years ago most ended-up shorted when trickle-charged.
 

crutschow

Joined Mar 14, 2008
38,322
NiCd cells can accept 0.05-0.1C as an indefinite trickle charge.
As noted by AGA, NiMH batteries are not as tolerant of trickle charge as the old NiCds.
You need to limit the charge current accordingly.
But most new NiMH batteries hold a high percentage of their charge for a year of more, so don't need to be trickle-charged.
 

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I probably won't keep the Energizers in there for long. Just seeing how things behave for now. The Tenergy cells are what I designed the board for, and they're higher capacity than the Energizers. I may only store a couple cells at a time.

After a couple days, the Tenergy cells are working out fine sitting at about 1.5V with 70mA going through them. The Energizer is a bit higher voltage than I'd like. About 1.6V. Not surprising since it's lower capacity. The Sanyo NiCd is also a bit high at 1.7V with about 60mA going through it. A bit high, but within the 0.05-0.1C that most sources suggest.

I don't really care about the longevity of the Sanyo. At 600mAh it would take 4 of them in parallel to equal the capacity of a single Tenergy. I'm just curious to see what it does.

I've had these cells for a long time, so they're pretty old. I've tested randomly selected ones on occasion and they still have very close to their rated capacity. I'm curious to see if the ones that get put in the trickle charger degrade faster than normal.
 

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I took my NiMH smart charger apart the other day to see what I could see.
20240514_151411.jpg

No temperature sensors that I could find. It must rely exclusively on the voltage drop to determine end of charge. Maybe it has a timer also. It seems to differentiate between cell sizes and position mechanically via some little tabs amongst some of the upper contacts. Each bay then gives the appropriate amount of voltage and current to the cells.
20240514_151224.jpg

On the back of the charger, there is some explanation of what each cell or cell pair gets:
20240514_151258.jpg
20240514_151258a.jpg

If I'm reading it right (and I'm not sure at all that I am) AAAs get 450mA, AAs get 550mA, Cs and Ds get 1100mA. None of this is all that important. I was just curious to compare the smart charger current to my trickle charger current. (550mA vs 78mA)

I've put the trickle charger together with a small power supply on a piece of scrap wood for now. That way I can run it from a regular wall outlet instead of my benchtop power supply.
20240517_211046.jpg

Eventually, when I get all the boards made, I want to build a proper enclosure to put them all in. I don't think I'll build one for D cells. It's been ages since I've even used a D cell. I think 2 boards for 2 C cells each, and one board for 4 AAA cells.
 
Last edited by a moderator:

Audioguru again

Joined Oct 21, 2019
6,826
Your AA Sanyo battery is very old, it has a low 600 mAh rating and is probably a Ni-Cad. In 2005, Sanyo invented their Eneloop version of their Ni-MH battery that holds a charge for one year, unlike all older Ni-MH cells made by all manufacturers that held a charge for only a few months. Then in 2009, Panasonic acquired Sanyo. Soon, Energizer Ni-MH batteries were advertised as pre-charged and to hold a charge for one year. Energizer Ni-MH batteries are/were made in Japan maybe by Sanyo or Panasonic.

A few years ago I bought a low cost package of Duracell Ni-MH batteries at Costco, 4 AA, 4 AAA and a charger for 4 cells. The cells are poor maybe because they were made in China, they have a low mAh rating and soon lose their charge.
The Chinese Duracell charger works well, I use it to charge my many Energizer Ni-MH batteries.
 

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
I don't remember where I got the old Sanyo, but yes, it's a NiCd. When I found it in my stash, it was at close to 0V. I've been curious to see how it will behave, and decided to try it out on the trickle charger (after charging it normally first), since NiCds tolerate a higher trickle charge current that NiMH cells do. Being only 600mAh, I don't really have a use fore it other than curiosity.

I was looking at my old Energizer cells and it turns out the AAs have a range of capacity from 2100mAh to 2500mAh. In the future I may keep one or two of the 2500mAh cells on the trickle charger. Primarily though, the charger was built for the 2600mAh Tenergy cells. I plan to keep at least two of those on the charger.

I haven't bought NiMH cells in probably over a decade. I've done an occasional capacity test on some and they seem to be keeping up just fine.
 

Thread Starter

rebelrider.mike

Joined Feb 2, 2024
53
Took a while, but I finally got around to making C and AAA cell maintainers. Here's the AAA:
20251230_231905.jpg

I'm not quite done with the C board yet. The parallel resistors are getting too hot. I'm going to replace them with ones that have a higher Watt rating. I took a couple thermal images to compare them:
AAAcellsThermal1.jpg
CcellsThermal1.jpg

Once I get the resistors straightened out, I plan to build some kind of box to put them all in and keep them safe. Meanwhile, the AA board I made back in 2024 has been in constant use with no problems at all. It's great to have at least one cell always ready to go when the one in my mouse dies.
 
Last edited by a moderator:
Top