|
You probably know those onboard testers found on Energizer and Duracell batteries : press the two white dots printed on the wrapper, and magically the battery's state appears on a yellow bar. No need for a separate battery tester, everything is included on the battery itself. While not very precise, it's good enough to know if a battery is brand new, so-so, or completely dead.
These throwaway testers are quite clever : they use a layer of conductive ink that heats up when an electrical current runs through it, in combination with a layer of thermally-activated dye that turns transparent when heated up, revealing a third layer of colored ink underneath. Because the layers are printed with varying thickness from "0%" to "100%", parts of them become yellow before others, creating a bargraph effect that varies with the current applied, the battery's body itself sinking the heat produced by the conductive ink. Informative details about those testers can be found here :
HowStuffWorks
The Duracell Battery Tester
AA Battery Tester
Here are instructions to turn such a tester into a not-so-precise analog display to monitor the CPU load on a Linux system, controlled by a serial port.
Here's the really hard bit : making a somewhat reliable connection between the tester's conductive ink points and the rest of the circuitry. To do that, place the tester on the breadboard, near the upper edge, and mark out precisely the breadboard holes the wrapper's white dots fall on. Spend some time aligning the right white dot (on the "minus" side), as the patch of conductive ink there is very thin and right on the edge of the tester. The dot on the left ("plus") side is less problematic.
To make the connectors, solder bits of "hairy" copper wire (like that found on common mains electrical cords) in the holes you marked, and leave the "hairs" sticking out where the tester will be installed. They'll help make a correct electrical contact with the tester's conductive ink. Cut out a piece of clear plexiglas from the CD case, tape one edge to the upper edge of the breadboard, and punch a small hole near the bottom edge. This makes a window to hold the tester and press it flat against the breadboad and the connector.
Solder the circuit's components at the bottom of the breadboard, under the window (there should be about 3 cm worth of breadboard left there). Here's the circuit's schematic:
Notice the 2 switches around the 1N4004 diodes : those diodes are there to reduce the voltage fed to the tester, but depending on the individual tester and the quality of the contacts with the conductive ink, you might need to overload the tester a bit to reach 100%, or make it more reactive. With the switches, you can short one or both diodes, adding 0.6V per shorted diode.
Once the circuit is done, feed it 3V and close all the switches. Then carefully align the tester on its connectors, flip the window closed and short pins 4 and 5 of the optocoupler : if the connections are good, the display should very quickly turn completely yellow. If it does, unshort the pins quickly or you'll fry the tester (and possibly the window's plexiglas). Aligning the tester on the connectors is not easy to do, take your time to avoid stripping the conductive ink. Once you have good connection, insert a small metal wire through the hole at the bottom of the window and through the breadboard, and twist it, to close the window permanently.
The end result should look something like this:
Then, open both switches around the diodes and re-test the display by shorting the optocoupler's pins again : if it goes all the way up to 100% in a reasonable amount of time (less than 10s), you're good. Otherwise, short one diode and try again. The hardware is finished! Now switch the power supply off and connect the circuit to your computer's RS232 port. Leave the power off whenever you don't run the control software, as the RTS line on an RS232 is high at idle, and so you'd run the tester at full blast all the time and eventually could damage it.
You then need to calibrate the display, so that the control software knows which pulse widths correspond to loads between 0 and 100. To calibrate your display, invoke:
./duracell_cpumon /dev/ttySx -c
(replace "/dev/ttySx" by your serial port, ttyS0, ttyS1 ...)
Remember to switch off the display as soon as the software stops!
Once the display is calibrated (it should produce a "duracell.cal" file), finally run the CPU load monitor by invoking:
./duracell_cpumon /dev/ttySx
and switch on the display. The display should show the average CPU load, but because it's so slow, if your CPU load is usually not very high, try running tasks that load up the CPU for at least 10/15s to get it to move, especially when it starts out cold. Starting OpenOffice or Mozilla is a good test on slower machines.
This is how the display looks with some load on my system:
There you have it : the most imprecise, slow, power-hungry, finicky and unreliable CPU load monitor in the world. Aren't you happy ? :-)
The big problem with a using a heatsink is that the latency is even worse than it is now, and also there's the problem of making contacts with the conductive ink under the tester. I probably could have made something, but I've spend way too much time on this thing already.
![]() |
![]() |