Build an Ampere-Hour Meter Hollister McNeal copyright 1991 Hollister McNeal On any alternative energy installation knowing the amount of energy produced or consumed is very useful. When storage batteries are used, Amp-hour meters on the input and output provide information on the energy production or consumption (since Amp-hours x battery voltage = energy in watt-hours). Although such Amp-hour meters can be purchased commercially, I chose to build one. Block Diagram A block diagram of the Amp-hour meter is shown in Figure 1. The SHUNT is used to measure the current. It must be inserted in the negative leg of the battery input or battery output. A shunt is actually a very low resistance that produces a voltage across it proportional to the current flowing through it. The voltage that develops across the shunt is then amplified by 100 in the AMPLIFIER section. The ADDER output then goes to the COMPARATOR SECTION. The output of the AMPLIFIER is then summed (integrated) in the ADDER section. When the ADDER output reaches a certain voltage level, the comparator changes its output state. This causes two things to happen: The LCD COUNTER is incremented by 1 and the ADDER is reset. The 5-digit LCD counter actually indicates hundredths of Amp-hours. Therefore the maximum count is 999.99 Amp-hours. The POWER CONVERTER section is needed to provide the appropriate regulated voltages to the electronics. It receives power from the 12 Volt battery bank and has +5, -5, and 1.5 Volt outputs. One power converter can easily support two separate amp-hour meters with a current draw of approximately 0.01 Amp. Amplifier Section Figure 2 shows the AMPLIFIER section in detail. It uses an LM324 op- amp configured as a differential amplifier with a voltage gain of 100. The resistors should be 1% tolerance for best accuracy. As there are 4 separate op-amps in a single LM324 package, the other 3 op-amps are available for the ADDER section or a 2nd Amp-hour meter. Adder Section Figure 3 shows the ADDER section in detail. It uses an LM324 op- amp configured as an integrator. The adder is actually a subtracter, as its output from 0 to -2.5 Volts as it accumulates the current input. Note that the resistors R1, R2, R3, and capacitor C1 do not have values specified. R1 and C1 are selected to obtain the correct counting rate. Their values are also dependent on the resistance of the shunt (RS). The values can be approximately determined from the equation R1 = 1.44/(RS x C1), with R1 in kiloOhms, C1 in µF, and RS in Ohms. I would recommend choosing C1 from available values, then calculating R1. R1 should be between 1k and 200k Ohms. For example, my input shunt is 0.001 Ohm. I chose a 15 µF capacitor. R1 is then calculated to be 1.44/(.001 x 15) = 96 kiloOhms. My output shunt is .0001 Ohm. I chose a 4.7 µF capacitor. R1 is then calculated to be 1.44/(.0001 x 4.7) = 31 kiloOhms. To compensate for component tolerances, I would recommend using a potentiometer for R1 and adjusting it after the circuit is built for proper calibration (see CALIBRATION). Also, R2 should be chosen approximately equal to R1 (within 10%). Capacitor C1 should be tantalum for best accuracy. Make sure the capacitor is installed to match the indicated polarity. Resistor R3 is selected to optimize offset adjustment using the 100k Ohm potentiometer. Offset adjustment is necessary to assure that the Amp-hour meter is accurate for low or zero input currents. If R3 is too low a value, it is very difficult to set the pot to the optimum value, since a slight change in the pot will cause a large output variation. If R3 is too high a value, no pot setting will compensate for the offset. I used two 10 megaOhm resistors in parallel (5 megaOhm effective) on my two meters. I used an IRFZ40 MOSFET to rest the adder by shorting out the capacitor C1. Other MOSFETs such as the IRF511 (Radio Shack #276-2072) will probably also work. Note that the MOSFET has an integral diode to keep the tantalum capacitor from going more than a few tenths volt reverse polarity. Comparator Section Figure 4 shows the COMPARATOR section in detail. It uses an LM339 comparator. As there are 4 comparators in a single LM339 package, the other 3 comparators are available for a 2nd Amp-hour meter or other circuitry (I used 2 comparators to implement a high battery voltage/low battery voltage detection circuit). The zener diode in the schematic is a precision reference diode LM385Z. When the adder output reaches -2.5 Volts, the comparator output will rise to approximately 3.7 Volts, which will both increment the counter and reset the adder. The comparator output will remain high until the adder output approaches 0 Volts. The comparator output will then go back to approximately -5 Volts. LCD Counter Section Figure 5 shows the LCD COUNTER section in detail. The LCD counter is Radio Shack#277-302. As 1.5 Volts is generated by the power converter circuitry, no 1.5V AA battery is needed. The zener diode in the schematic is a precision reference diode LM385Z-1.2. It is used along with the 22k½ resistor to provide the correct logic level to the counter. The reset switch is used to reset the counter display to 00000. The display will read up to 999.99 Amp-hours. There is no decimal point in the display. Perhaps one could be "taped" onto the display if desired. Power Converter Section Figure 6 shows the POWER CONVERTER circuitry in detail. I used a 1/2 Amp fuse although a smaller fuse (1/4 Amp) should also work fine. The fuse was placed in a Radio Shack #270-1211 inline fuse holder. An On-Off switch after the fuse could be added also. Four op-amps are used, with 3 being in one LM324 package (U3) and the 4th in another LM324 package (U4). Do not attempt to combine these op- amps any other way as their power pins are hooked-up differently (U3 uses +12 and GND, U4 uses +5 and -8). Be careful to observe the polarities on the 10 µF and 47 µF capacitors. The +5 and -5 voltages are not exact and will vary with the tolerances of the resistors used. The-8 voltage is not regulated and varies with the 12 Volt battery voltage and with the current draw on the -5 voltage output. Pin 8 of U3 oscillates at approximately 1300 Hertz. Construction I placed the electronic circuitry for two Amp-hour meters on a single Radio Shack #276-162 printed circuit board mounted inside a Radio Shack #270-232 box. The circuit board was quite crowded. I would recommend using either two of them or else using a larger board. I mounted the switches and LCD counters on the surface of the box. Terminals mounted on the surface of the box were used to wire the shunt inputs and battery inputs. The inline fuse was placed close to the batteries. I drilled holes for access to the pots mounted on the printed circuit board inside. I also brought the adder outputs terminals for ease in offset adjustment. Calibration The offset potentiometers are best adjusted with zero current in the shunt. Adjust the pot until the output of the ADDER section is a stable (unchanging) negative voltage between 0 and -2.5 Volts. Particularly with the 0.0001 Ohm shunt this is difficult to do. Use a digital voltmeter if possible. A rate of change of .01 Volt per second will give a total error of 3.6 Ampere-hours per day. The counting rate is adjusted by changing R1 in the ADDER section. The shunt should be drawing a now steady current (preferably on the high side, such as with the solar panels in full sun for an input shunt ,or a water pump or other heavy load for an output shunt). Measure the voltage across the shunt with an accurate digital voltmeter and divide by the shunt resistance to determine the current. Use a watch or preferably a stop-watch to time a set number of counts on the LCD counter (the more counts the more accurate the result). The number of seconds should then be SECONDS = COUNTS X 36/CURRENT. For example, with a current input of 10 Amps, 10 counts should take 36 seconds. For a current output of 50 Amps, 100 counts should take 72 seconds. Operation In my setup in Northwestern Pennsylvania, one Amp-hour meter monitors battery input from six Solarex MSX-60 solar panels. The other monitors the battery output going to a Trace 2012 inverter. Each day before sunrise both meter readings are recorded and then the meters are reset to 00000. The meters have been in operation for about eight weeks. So far I have been averaging about 100 Amp- hours per day for both battery input and battery output. I expect these mid-summer readings will drop considerably by late fall and winter. Limitations If the voltage drop across the shunt is more than .03 Volts (corresponding to 30 Amps on an .001 Ohm shunt or 300 Amps on a .0001 Ohm shunt) the 100x amplifier may saturate. This will not damage anything but it will cause the Amp-hour meter not to record at more than the amp rate corresponding to .03 volts. Reducing the gain from 100x will solve the problem. Replace both 110K Ohm resistors with the same smaller value. However, R1 and R2 or C1 in the ADDER section will also need to be proportionately reduced. The LCD counter has a maximum counting frequency of 7 counts per second which corresponds to approximately 250 amps. Again, no damage will occur if this frequency is exceeded but the counter may not increment correctly. The solution would be to have the counter increment for tenths of amp-hours instead of hundredths of amp- hours. The easiest way to do this would be to replace both 100K Ohm resistors in the amplifier section with 10K resistors, thereby making a 10X amplifier. It is not possible for this Amp-hour meter to count backwards. Therefore the shunts should be placed so that the current flow is always in one direction. The shunts have to be installed in the negative leg of the battery. As the temperature of the circuitry changes the offset adjustment will change. I would recommend setting the offset at least once a month, preferably at a temperature that is "normal" for that month. The circuitry should be indoors and not exposed to excessive heat, cold, or humidity. Probably the best improvement in this Amp-hour meter would be to use op-amps for the AMPLIFIER and ADDER that have a lower offset voltage and less drift with temperature. The OP177 op- amp is much better than the LM324, although it is not at all pin for pin compatible. Access Designer: Hollister McNeal, 714 Pleasant Dr., Warren, PA 16365 LM385Z, LM385Z-1.2, IRFZ40, & most other parts: Digi-Key Corp., 701 Brooks Ave. S., POB 677, Thief River Falls, MN 56701-0677, 800-344-4539. LM385Z, LM385-1.2, & most other parts: Jameco Electronic Components, 1355 Shoreway Rd., Belmont, CA 94002, 415-592- 8097 ($30 Minimum order). LCD Counter &, most other parts: Radio Shack. Shunts: Deltech, 13065-H Tom White Way, Norwalk, CA 90650, 310- 926-2304. HOME POWER #24, Page 45: information on making shunts.