Saturday, May 5, 2012

amp hour , watt hour meter working

We got the ah and wh functions working. All that's left is to integrate the 4 line white on blue lcd.

All code and schematics, photo's etc., are listed at

Recommended Parts:

Arduino UNO R3

Arduino Ethernet SD

Resistors for voltage divider

ACS712 or ACS715 Sensor

The Instructable is online at

Monday, April 30, 2012

Voltage Monitor

Now that we have the current monitor working, the next step is to build the voltage monitor circuit. I built a voltage divider that will break down the highest voltage my battery can possibly see, into a 0-5v input for the Arduino. Here is a great tutorial explaining the math behind determining the resister values,, and a schematic of our version:

Here is a screen shot of the monitor showing both current and voltage being monitored.

Now the trick is to multiply the current with the voltage to get watts.

The next step is to sample over time to display the amp hour and watt hour values. Still working on that. I've posted a spreadsheet for calculating the resistor values (and amp hour formulas) at

There's a good discussion of this project at

Monitoring Power Consumption with the ACS715

We needed a power meter for monitoring power consumption of our ham radio's when in emergency communications mode (no grid). Although you can get these commercially, from the fully featured off grid power system capable Bogart Trimetric, to the single item Watt's UP, we wanted a diy homebrew unit that is educational, and customizable. Based on a ACS715 Hall Effect Current Sensor, connected to an Arduino, we are now monitoring the current consumption of our radio gear. The following screen shot shows both TX and RX power modes.
I'm posting the code below for the current monitor, and now I'm off to add voltage monitoring, and to calculate watts, watt hours, and amp hours.

 /* This sketch describes how to connect a ACS715 Current Sense Carrier ( to the Arduino, and read current flowing through the sensor.

Vcc on carrier board to Arduino +5v
GND on carrier board to Arduino GND
OUT on carrier board to Arduino A0

 Insert the power lugs into the loads positive lead circuit, arrow on carrier board points to load, other lug connects to power supply positive */

int analogInPin = A0; // Analog input pin that the carrier board OUT is connected to
int sensorValue = 0; // value read from the carrier board
int outputValue = 0; // output in milliamps

void setup() { // initialize serial communications at 9600 bps:
Serial.begin(9600); }

void loop() {
// read the analog in value:
sensorValue = analogRead(analogInPin);

// convert to milli amps
outputValue = (((long)sensorValue * 5000 / 1024) - 500 ) * 1000 / 133;

 /* sensor outputs about 100 at rest. Analog read produces a value of 0-1023, equating to 0v to 5v. "((long)sensorValue * 5000 / 1024)" is the voltage on the sensor's output in millivolts. There's a 500mv offset to subtract. The unit produces 133mv per amp of current.*/

 // print the results to the serial monitor:
 Serial.print("sensor = " );
Serial.print("\t Current (ma) = ");

 // wait 10 milliseconds before the next loop
 // for the analog-to-digital converter to settle // after the last reading:
 delay(10); }
Related Posts Plugin for WordPress, Blogger...