NiCd/NiMH Discharger

NOTE:

  • Please read the DISCLAIMER page.
  • Even small battery packs can store substantial amounts of energy and be hazardous. If you are considering building something similar, please buy an off the shelf piece of equipment instead and use it in accordance with the manufacturer’s specifications.
  • This project was designed for specific NiCd and NiMH cells from a specific vendor and is not relevant for any other cell type, size, brand, or chemistry

Why?

This is another project from the early 2000’s, pulled out of storage. Back then I had a steady source of used NiMH sub-C cells since I was working on the electronics and software of a battery management system at my employer. Old, used and abused engineering samples needed a good home. I put those cells together to make packs to power my RC model airplanes. This was the early days of electric power for RC planes – before BLDC motors and LiPo batteries. In reality, BLDCs and LiPo‘s were already around, but were still too expensive. Nowadays that’s hard to believe since they’ve largely replaced brushed motors and NiCd/NiMH‘s in that market.

Moving on, I built quite a few NiCd and NiMH sub-C packs, ranging from 7 cell (8.4V) to 11 cell (13.2V) for various airplanes. I was too cheap to buy one of the MCU-controlled fast charger / discharger that were just starting to become available in the $150 to $200 price range. Since I had access to lot of old used cells, I figured I’d just build a pile of packs, trickle them up overnight before going flying, and not have to bother with owning an expensive fast charger. Trickle charging is gentler on NiCd‘s and NiMH‘s compared to some of the crazy charge rates those early chargers were pushing anyhow. I don’t believe they were the best for pack life. So, I built a multiple pack trickle charger and a stand-alone pack discharger to condition the packs. At some point, this page is going to start talking about that discharger.

Discharging NiCd‘s and NiMH‘s fully was generally a good thing to do to prevent a memory effect those chemistries had. Since my planes discharged at high rate (up to 30 amps), the battery was never really empty when the throttle was cut and you came in for your dead stick landing. The BEC‘s at the time had a fixed voltage threshold where they’d shut off the motor (regardless of the throttle position on the transmitter) to let you know it’s time to land. This fixed voltage would mean the batteries are always discharged to about the same State of Charge, but not completely empty, since the threshold needed to be high enough to guarantee plenty of remaining energy in the pack to power the receiver and servos through the approach and landing. Discharging the pack fully at a gentle discharge rate – once it cooled – was good practice to avoid the memory effect and maximize the flight time from each pack. Expensive chargers could be configured to do this. I instead decided to build a cheap box to do the same for fun.

What is does

The main objective was to discharge a pack until a “empty” voltage threshold was reached, then stop discharging by removing the load. That voltage threshold would need to be configurable for the range of battery pack voltages mentioned above.

This also required a bit of smarts in the device, or at least some sort of memory or state information to prevent the device from limit cycling, i.e. oscillating on and off right around the discharge termination voltage.

Simple battery model and latching circuit

Why? Batteries, from the simplest perspective, can be modeled as an open circuit voltage in series with a source resistance. This is very simplified, and much more complicated models exist, but this is adequate for the discussion here. The point is that once a load is removed from a a battery, the terminal voltage climbs back to the open circuit voltage since there is no more voltage drop across the internal source resistance. Said another way, the battery terminal voltage droops under load, then springs back once the load is removed. Like watching your interior lights dim while cranking your car on a cold day.

Obviously this is just a simple electrical model to explain the more complicated behavior of the chemical reactions taking place inside the cell. But, the point is, a simple approach to the circuit would be that once the discharger circuit sees the battery voltage fall below the “I’m empty” threshold, it removes the load. However, the moment the load is removed and the current stops flowing, the battery voltage will jump back up toward the open circuit voltage, likely confusing the circuit. If the circuit is just a simple comparator, it will measure the increase in the battery voltage, see that it’s above the “empty” threshold, interpret that as “I’m not empty yet”, and re-engage the load. This is not desirable for the life of the battery. Once we hit the “empty” threshold, we want to disable the load, declare that the pack is empty and we’re done discharging, and stay disabled.

What’s inside

Nowadays, you’d be able to throw something like this together in an afternoon with an Arduino implementing those smarts, and driving a relay or a MOSFET, with the ADC inputs for the voltage measurements. You can even buy relay modules with built-in optoisolator or BJT drivers. This was 2002, pre-Arduino, pre-Sparkfun, pre-Adafruit, so the starting point was a bit less integrated. Nowadays I’d lay out a PCB with DipTrace and have them fabricated cheap at JLCPCB. In the early 2000’s, the options were mostly Eagle (pre-Autodesk acquisition) which had a limited size in the free version and places like PCBFabExpress and ExpressPCB for the PCBs. They were some of the few places that would do low quantity PCB runs, but they were expensive and long lead time. Instead … all that point to point wiring!

I could have done this with a number of microcontroller boards I had in the shop (PIC boards, 68HC11 boards), but I did enough of that during my day job, and just wanted to quickly throw something simple together with digital logic. To that end, the entire “smarts” is controlled by a single 74HC74 D-type flip flop. Why not, it was fun.

Moving on to the actual discharger box. Looking at the outside you can see what you’d expect. Anderson connectors to connect the battery pack and banana jacks for the load. Power resistors were used for the load and located outside of the box to avoid having to worry about heating on the inside. This was just going to be used in a controlled environment on my lab bench anyhow.

The rotary switch on the left selects one of three voltages to send to the off-the-shelf LCD voltage module. That way you can check the battery voltage, the “empty” threshold voltage, or monitor the current.

The potentiometer on the right sets the “empty” threshold voltage. Based on the size of the pack, the user would dial in the correct voltage, which they could monitor on the LCD while tweaking it.

Start and Abort buttons did what you’d expect. They directly controlled the PRESET and CLEAR inputs to the D flip flop in the 74HC74. PRESET sets the Q output high, turning on a relay which engages the load. Abort allowed the user to cancel discharging at any time and would force Q low, turning off the relay. Essentially the flip flop output represented a single Boolean flag, or state variable – high meant “discharging”, and low meant “battery empty, done discharging”.

I didn’t even bother using the D input or the CLOCK input of the flip flop. I just used the flip flop‘s ability to retain state to avoid the limit cycling behavior mentioned above. I could have just as easily used a latch since this is exactly what a non-clocked latch does – it maintains state, and does not have any CLOCK level or CLOCK edge-triggered sort of behavior. I had a ’74 lying around so, why not use it?

The only additional IC is a TLV2252 op amp. This was not used as an amplifier but rather as a comparator. I could have just as easily used something like a LM339, but I had this on hand.

The comparator provides an additional way to control the flip flop’s CLEAR line. Once the battery pack voltage falls below the “empty” threshold, the comparator output could also trigger the flip flop‘s CLEAR line. This would turn off the relay and remove the load. This would also prevent the oscillations since the flip flop would stay off, unless the START button was pressed again. The bounce back of the battery voltage was made irrelevant since the comparator could only terminate the discharge process. Despite the fact that the unloaded pack almost certainly jumped back above the “empty” threshold, nothing unintended would happen. Once the comparator told the flip flop to go low and stop discharging, the flip flop went low, and stayed low, entering and remaining in the the “battery empty, done discharging” state. Battery voltage bounce back above the “empty” threshold will have no unintended effect. The comparator only drives the CLEAR line, so it can force a transition from the “discharging” to “empty” state but not the other way around. A very, very simple state machine, but hopefully a decent example if you’re new to the concept.

This same state machine effect could be created a number of different ways. We just need a way to implement some “memory”. The flip flop works fine. Another approach, would be to add a second relay, wired up to latch itself “on” once the discharging began, and allow the comparator to disable it, clearing the latch condition. Also, a present day Arduino route would only be a few lines of code and a really quick build. Anyhow, I built it out of junk I had lying around at the time.

Not sure where the hand-drawn schematic is anymore, but looking inside, the only other noteworthy parts I see are:

  • A 0.1 ohm power resistor used as a shunt to measure battery current so it can be shown on the LCD display
  • A 7805 regulator for the 5V rail for the the op amp and 74HC74 flip flops
  • a relay to switch the load and a 2N3904 to drive it
  • R dividers to attenuate the battery voltage and “empty” threshold voltage to stay within the TLV2252 voltage rails
  • looks like I added some voltage dividers with some caps for low pass filters as well for good measure
  • Some potentiometers to tweak the shunt measurement
  • a fuse
  • excessive hot melt glue to keep a few things in place

Afterward

Back then I had a Kyosho ducted fan T-33 and twin pusher prop Multiplex TwinJet. Fun planes, but flights were short. They drew 20 to 30 amps at full throttle which meant 5 minutes of flight time tops. Since they went through battery packs quickly, having a handful of properly conditioned NiCd or NiMH packs was essential. LiPo‘s have changed all that with their tremendous energy density, power density, and cheap intelligent chargers. But it was a fun project at the time, and I actually got a lot of use out of it. Controlled discharging after use, without over-discharging, definitely extended the life of my battery packs.

Check out the project NiCd/NiMH Cycler for a charger based on the Motorola 68HC11 microcontroller.