A DIGITAL AMPERE-HOUR METER Mark A. Peterson c.1992 Mark A. Peterson Introduction In designing any electronic instrument a few fundamental principles should be kept in mind throughout the creative process. Economy of design is perhaps foremost. This implies that the complexity, cost, size, and concessions be minimized. Rule 1: Make your ideas into "recyclable" building blocks. You get spin-off technology that way. Rule 2: Don't reinvent the wheel. Take advantage of existing devices. In the design of my digital ampere-hour meter I used an IC (the AD654 voltage-to- frequency converter) which took care of most of the engineering problems associated with the cost, accuracy, and complexity constraints. After all, this is supposed to be a practical project. Amp-hour Meters:General Theory Ampere-hour meters can be engineered in many different ways. A Fluke 87 multimeter can be used to collect data and provide accurate results over a 36 hour period. The Homebrew in Home Power #26 featured an amp-hour meter with an architecture termed "charge-balance" in electronics jargon. It uses entirely analog components (op-amps) except for the counter/LCD display. My meter uses a precision voltage-to- frequency converter (VCF) which converts the millivolt analog input signal to a digital data stream. The digital information is then processed, stored and displayed in ampere-hours (counts up to 9999.9 Ampere-hours). Finding an accurate VCF capable of sensing millivolt inputs and needing only a single 5 Volt supply was a non-trivial task. Single-supply circuits like this one can be battery operated, important for hand-held instruments. Block Diagram Parts List U1ÄLM 7805 five Volt regulator U2ÄAD654 voltage-to-frequency converter (VFC) U3-U7ÄCD4017 decade divider U8ÄCD4066 Quad analog switch RSÄ0.01 ê precision shunt 1% 2 Watt Dale type LVR-2 (for 20 Amperes maximum current) or 0.001 ê precision shunt (for 200 Amperes maximum current) R1Ä1.5 kê wire wound, low temp coefficient (100 ppm) R2Ä10 turn quality potentiometer (PC mount) C1Ä10,000 æF 35V electrolytic C2Ä0.01 æF ceramic C3Ä1æF tantalum C4Ä1000 pF polystyrene or mylar F1Ä2 Amp fuse SW1Ämomentary on-off switch (normally off) Circuit Operation The meter was designed to produce 100 counts-per-hour with a 100mV input across the precision shunt RS. This is equivalent to 10 Amperes flowing through a 0.01 ohm shunt or 100 Amperes through a 0.001 ohm shunt. The 5 digit display should therefore have a decimal point placed before its last digit. The voltage drop across the shunt controls the VCF's squarewave output frequency (CMOS compatible). This frequency is directly proportional to the magnitude of the input voltage. The resultant data stream (digital information) requires scaling because the VCF produces a kHz range output (necessary for accuracy and dynamic range at low level signals) and the LCD display/counter requires a very low frequency input (well under 1 Hz). Information scaling is achieved by sending the data stream through a cascaded series of five decade dividers (U3 through U7) to derive a data stream of frequency 1x10-5 (1/100,000th) of the VCF's output. The resultant low frequency squarewave is ready to be counted. The divider chain output is fed to an analog switch (U8) which acts as a relay, shorting the appropriate pins of the LCD counter to advance the count. An external reset button provides a CLEAR DISPLAY function. Breadboarding the circuit Total assembly time can be cut to a minimum by being well prepared. Purchase a couple of quality 'prototyping breadboards' (JAMECO sells some excellent ones with dual supply busses on the top and bottom). You'll need about 40 pieces of #20 gauge solid wire in 2.5"-3" lengths. The wires should be red, black and white to keep wiring errors to a minimum. Use red for 5v, black for ground, and white for signal path interconnects. It is essential that the digital ground be connected to the analog ground at one point at one point only. Failure to do this will cause ground loop currents to flow into the AD654's input amplifier and severely degrade performance. The power supply can be external or 9V transistor battery operated. CAUTION: When handling CMOS devices wear a grounded wristband! These ICs are static-sensitive and can be destroyed if you're not careful. Calibration If you have a frequency counter, such as a Fluke 87, or can borrow one, the meter will be very easy to calibrate. Obtain a 100mV reference and apply it to the input of the AD654. Monitor the frequency output at pin 1, and adjust the 10 turn pot (R2) to give a reading of 2777.7 Hz. The frequency output of the divider chain will be 0.0277 Hz. which corresponds to 100 counts-per-hour, THE DESIRED COUNT. If you don't have access to a frequency counter there is an alternate method. You'll need a stopwatch, and a little more time, but the meter can be calibrated to within 5% error this way. Remove (temporarily) the signal jumpers connecting to and from U7. Connect pin 12 of U6 to the control input of the analog switch pin 13 of U8. The counter will now count 10 times as fast. Adjust the trimpot to give 16.66 counts-per-minute (perhaps do a 3 minute or 5 minute sample to get higher accuracy). Now reconnect U7 into the circuit and you're ready to go. If you want a counter which counts to 999.99 instead of 9999.9 Amp-hours, leave out the last decade divider. Testing the meter About a year and a half ago I measured the output of my Arco 50 watt and Solarex 45 watt self-regulating panels for about a week during the summer. I used both the digital amp-hour meter and a Fluke 87 and found that my meter agreed with the Fluke to within 1%. Close enough. Since I live on the coast of Northern California, the panels put out a variable amount of power. They averaged between 15 and 30 Amp-hours per day. I tested the meter's accuracy recently and found it to still be in calibration, and am now fully satisfied that it has good stability with respect to time and temperature variation. The AD654 (and probably the equivalent LM331) does indeed hold true to the manufacturers claims regarding precision, and stability. The only real limitation of the meter is that it doesn't measure current in both directions (although that limitation could be overcome with the AD654 in an enhanced circuit). The meter is therefore not suitable for monitoring your Sun Frost or any load that returns current to the battery bank. Beyond Amp-hour Meters This meter is really a "long-term integrator" with a current sensing module as a front end. Another front end could be substituted for the shunt. The AD654 will accept any millivolt input from thermocouples, phototransducers, etc. So the meter could be used to integrate environmental parameters such as insolation, temperature, pressure or whatever. Access Author: Mark A. Peterson is production manager at Sun Frost. He can be reached at POB 4902, Arcata, CA 95521 Parts sources AD654; Analog Devices, Route 1 Industrial Park, Norwood, MA 02062 ù 617-329-4700 $50 minimum order Prototype breadboards and misc. components; Jameco Electronics, 1355 Shoreway Rd. Belmont, CA 94002 ù 415-592-8097 $30 minimum Misc components; Digi-Key, 701 Brooks Ave. S. POB 677, Thief River Falls, MN 56701-0677 ù 800-344-4539 LCD counter/display; Radio Shack