Recently, I decided to give the engine inside the Raspi-Riscy box a rehab. As part of the rehab, I decided to add an internal battery supply, and to give its charging circuits an alternative configuration. As with the first homemade tablet, this one is set to use NiMH batteries (I love those things!) But – my intention this time is to do the battery charging in a whole different manner than was done in the first tablet.
Notice the battery pack. Only six cells are shown, but an additional two packs of NiMH batteries are to be installed as part of this rehab. They will be positioned to the right of the breadboard and the Raspberry Pi2 board. I’ve gone back to “AA” cells for the Raspy-Riscy, because the tiny monitor display (shown at the right of the photo) draws so little power. With twelve cells, I should have (maybe) 350-400 mA of current drain thru the cells, and at that level I think they’ll stay happy (we’ll see how exactly how well that goes as the project progresses!)
The DC-DC converter (lower left) takes the 14.4 volts from the pack, and produces 5.0 VDC for both the monitor and the Pi2 board. Does the 14.4 VDC figure look familiar? It should, because power tools often use (internally) a pack of twelve NiMH batteries. I’m not quite done with the battery installation, so only six of the twelve cells have been laid into the enclosure. Yet – as you can see in the photo, I’m testing the inter-connections made up to this point, and running (temporarily for test purposes) only six cells. The current drain for six cells is around 700 mA, which is a little too much for an AA in my opinion. I’d never recommend that number of cells in a final layout. What’s different about the new charging setup? I haven’t laid the additional charge components into the backshell of the tablet. Let me explain what I intend to do:
Normally, with NiMH batteries you have to either time the charge (not a good thing to do, if you’ve forgotten how much the batteries have left in them, and just want to top them off) – or use another technique. Overcharging NiMH cells can damage them, so with a timed charge you pretty much have to start with depleted batteries. The other two methods are more complicated to implement. The first alternative method uses a thermister to measure the point at which the batteries start to heat up, and the second method tries to detect a slight “burp” in the voltage as the batteries charge. Most likely (since the parts are cheap) – I’ll implement both methods, control it all from the computer (why not?) – and make a decision about what to do based on both inputs.
Some prebuilt chargers have ciruitry to measure the temperature or the “voltage burp” – and that’s all well and good. When using such a charge system, you don’t really know what’s going on. That’s because all of the decision making is happening inside of the charge circuit, with hard wired control and logic circuits, or a microcontroller, but in the latter case the charger doesn’t supply any additional information, other than an alert (usually an LED indicator) saying that the “charge has finished.” I want to know what is *really* happening as it happens. I thought I’d use the power of the Pi2 to calculate the charge parameters in software!
Yes – in software! So, I can watch every little thing that happens as the charge progresses, make adjustments real time, collect the data for analysis, and to stop the process (if necessary) based on the information. Data will no longer be buried inside of a microcontroller or inside of the hard wired logic and analog circuitry. The new system needs to be failsafe (what if the computer program crashes?) Therefore; it’ll have to have some mechanism (watchdog?) to kill the charge if anything goes wrong. I haven’t yet decided on the failsafe system.
In figure 2 is shown a battery bank with ADC pick-off points. Notice that different voltages are shown at each battery terminal. This is because NiMH batteries can measure as much as 1.4 VDC for a brief time after a fresh charge, then “flatten out” to ~1.2 VDC for most of the rest of the discharge period, and finally land somewhere around 1.0 VDC (or a little less) when exhausted. The figure shows a serial configuration, which of course is needed at runtime in order to have sufficient voltage to drive the DC-DC converter. But which configuration will we use for the charge circuit? Regardless of the configuration chosen, it must be ensured that no more than the manufacturer’s recommended voltage is ever applied to any particular cell. Both overvoltage and overcurrent conditions must be prevented. More on those aspects can be found on page two.
To monitor the voltage well enough to “smart charge” the battery pack, we will need a slew of ADC (Analog to Digital) converters. It just so happens that there exists a single sixteen pin chip that contains eight of them. Multiple such chips should do the job, and still not take much space in the box. We would use multiple ADC inputs to measure multiple heat sensors, since using only one would assume that all the batteries are characteristically similar. It’d be better to put a thermistor on every cell, although that’d add twelve more ADC channels. Since we have plenty of ADC channels, that is no problem, and thermisters can be had for fifty cents each. One ADC will measure the drop across a low value resistor (to monitor current), and the others will monitor individual battery voltages. I may need sets of op amps for burp detection. The ADC channel is selected via an SPI interface.
Figure 3: Individual charging is NOT the same as parallel charging!
I thought about charging all of the cells individually (which is really the best way to charge them). Some “in place” chargers (i.e., the ones that are built into the equipment that uses the batteries) do exactly that. But, it’s really complicated, electrically, to isolate each battery for charging purposes, and then to put them all back into a series configuration at run time. That’s why (at least the cheaper “in place” chargers) – do a serial charge. My original design used banks of EMR (mechanical relays) – to switch the batteries for individual charge, but was *way* too messy, even with diodes factored into the sketch in order to replace a portion of the relays. If we have the ability to monitor every aspect of every battery, in real time, we can “bail” on a lot of conditions that might damage the batteries. We’ll need to look at every little nuance to do it correctly though …
Note: This author and site is not affiliated with the Raspberry Pi in any way. For information about those projects visit http://www.raspberrypi.org “Raspberry Pi” is a trademark of the Raspberry Pi Foundation.
Note: the author does not have a recent, applicable background in circuit building, or battery related issues, so this is presented as the work of a hobbyist, and is not meant for duplication by others. Readers should look elsewhere for design advice and info.