Digital Amp hour Meter Without Microcontrollers

       I wanted to have an amphour meter for my renewable energy system at home so that I can easily monitor the battery state of charge. Looking around the internet, there seems to be a lack of readily available amphour meter modules, if there are any. The ones I've seen are full fledged data loggers with lots of bells and whistles and a hefty price tag.

       So I looked around for a DIY version. There are a few that uses special parts or PIC/Microcontrollers that aren't locally available so checked them off the list. Inspired by this project, I decided to design my own. Since the special current monitor IC used in the project was already discontinued, I had to make do with what I had on hand. I modified the circuit to use two MAX4172's instead which I do have in my parts inventory.

The schematic (large).

       The circuit uses the MAX4172 along with an external shunt as a current source and an integrating capacitor with a 555 timer IC is used to convert the current into pulses in which the frequency is directly proportional to the battery current. This frequency (typical = 455.11Hz at 1A load) is then divided by 16384 by a CD4020 (14 stage counter) resulting to a pulse every 36sec at 1A. The circuit is duplicated twice, one for each current direction (charge and discharge).

       The clock outputs are then combined using an XOR (since the direction can change with the other counter output stopped at either high or low state) and then sent to the clock input of a CD4510 decade counter. The BCD outputs are decoded by a 4511 and sent to a 7 segment common cathode display. Duplicate this four times to get a 4 digit display showing zero to 99.99 Amphours. Using a 1mOhm shunt, adding another 4510/4511/7seg combo or CD4017 decade counter after the XOR gate (this I used below) would expand the display to 999.9Ah max. An XOR gate is used for reset switch/ power on reset and to invert the signal from the carry out of the most significant digit and feeding this to the reset inputs of the decade counters prevents the display from going below 00.00. Without this circuitry, once the countdown reaches 00.00 and the charge current is still flowing, the display will read back to 99.99 then 99.98 and so on. Counting up or down is controlled by a 74HC74 flip flop used as an RS flipflop feeding directly from the 555 timer outputs. The Q output is either high or low depending on which 555 timer IC is oscillating.

       The operation of the device is simple. You connect power to it and a twisted pair wire going to the shunt resistor. All your loads and chargers to be monitored go through this shunt. Since the circuit uses an isolated DC-DC converter, it doesn't really matter if the shunt is connected to the positive or negative side, just take note of the polarity. This version is different from the usual Amphour meters on the market. My version actually counts up amphours that are consumed (taken out of the battery) and goes to zero as as the battery is recharged. So, if you wanted to use up only 20% capacity of a 100Ah battery (80% left in battery) you'd turn the loads off when the display reads "20.00". By having separate oscillators for charge and discharge, this circuit has the advantage that you can set the charge oscillator slower than the discharge oscillator since it takes about 107-115% of the energy taken out to bring the state of charge to 100% in an AGM battery so that the Ah displayed is accurate to the actual charge accepted by the battery.

       The schematic was actually drawn after building and debugging the circuit since it is assembled the "hard way". Using three breadboards and lots of #30 wire. In all, the schematic showed 237 nets or connections and it took me the better part of the day (and night!) to hand assemble the prototype wiring each point one by one.

I had to cram all those chips on that tiny protoboard.

The three boards from left to right: Display board, logic/counter board, analog/power supply board.

Underneath the logic board, Spaghetti!!!

7 segment display, reset button and display brightness pot.

Some completed pics.

Added "direction" LEDs. Green means charging, Red for discharging.

       Current consumption is about 80mA (varies depending on display brightness). Here's how to calibrate without a frequency counter. A signal generator which can be adjusted to a precise frequency is connected to your scope's channel 2 input. Probe the circuit and trigger on channel 1. If the frequency is the same, the channel 2 waveform should "lock" to the waveform on channel 1. It's pretty hard to describe on text so go check out Dave's video on youtube using the same technique. I triggered mine on the frequency I'm adjusting so that the scope can display the trigger frequency and I can see how far off I had to adjust.

Probing the oscillator output.

Frequency calibration.

       I decided that for my battery bank, 99.99Ah max might not be enough so I grafted a CD4017 (SOIC package deadbug style) after the XOR gate and moved the decimal point for a 999.9Ah max readout. I also added a red color filter to the display to improve contrast and dimmed it a bit for less current draw since this will be on 24/7.

       I later aqcuired a 75mV 100A shunt. I then removed the 4017 counter and adjusted the timing capacitor values (68nF + 22nF caps) to achieve the correct frequency. The meter is then calibrated by using a variable supply and resistor divider. The frequency and linearity pots are adjusted alternately until the voltage-frequency relationship is as linear as possible in the entire current range.

       Calibration starts with the linearity pots at min resistance, Apply the full scale voltage (75mV for a 100A load in my case) using an isolated variable supply and resistor divider to the input and set the freq adjust to the desired frequency (2275.55Hz) adjust the input voltage to about 7.5mV (10A load) and do not touch the freq adjust pot. Tweak the linearity pot to get close to the desired frequency (227.555Hz) repeat until the frequencies are as close as you can get it.

       25 Jan 2014:

       Finally installed it in a case. Just hot glued it in place

Page updated and copyright R.Quan © 27 Oct 2013.