DC power meter with an ACS712 current sensor and I2C LCD on Arduino: design worksheet and code

A ₹1,070 design worksheet for a DC volts, amps, watts and watt-hours meter for robot batteries, using an ACS712 current sensor and a voltage divider, with the ADC resolution and offset calibration worked out.

About the author · Editorial & verification standards

  • Parts₹1,070
  • Bench time4–6 h
  • LevelIntermediate
  • ReviewedNov 2026

A ₹1,070 meter that tells you how much power your robot really uses. An ACS712 module measures current, a resistor divider measures battery voltage, and the Uno multiplies them to show volts, amps, watts and the watt-hours used so far. It is the quickest way to size a battery honestly, instead of guessing from the motor label.

Scope: intermediate. This is a design worksheet with illustrative costs. It has not been bench-tested by this site. The counts table was computed by script for the 5 A version of the module, which is commonly listed at 185 mV per amp. This build is for low-voltage DC only. Do not use it to measure mains, and do not connect a pack above the divider’s limit. Check your own module’s sensitivity on its listing, since 20 A and 30 A versions differ.

How it works

The ACS712 outputs half the supply voltage, about 2.5 V, when no current flows, and moves up or down from there in proportion to current: 185 mV per amp for the 5 A part. The Uno’s 10-bit ADC has 5 V / 1023 = 4.89 mV per count, so one count is about 26 mA. Currents smaller than a few counts, around 50 to 80 mA, are therefore lost in the noise, and the sketch treats them as zero.

Because the zero point differs between modules and with supply voltage, the sketch averages 200 readings at start-up with no load and calls that the zero. Current is (reading voltage − zero) ÷ 0.185. Voltage uses a 30 kΩ and 7.5 kΩ divider, a ratio of 0.2, so a 25 V pack reads 5 V at the pin; keep your battery well under that. Energy is power times time added up each loop and shown in watt-hours.

Bill of materials

PartQtyUnitTotal
Arduino Uno R3 (or compatible)1₹550₹550
ACS712 5 A current sensor module1₹150₹150
30 kilohm resistor, 1%2₹2₹4
7.5 kilohm resistor, 1% (or 2 × 15 kilohm in parallel)2₹3₹6
16×2 LCD with I2C backpack1₹250₹250
Breadboard1₹60₹60
Jumper wires1₹50₹50
Parts total₹1,070

Scroll the table sideways to see every column.

Prices checked Nov 2026. Shipping and tools are not included.

Prices are illustrative figures for Indian sellers in November 2026, before shipping, and have not been checked against current listings.

The numbers

Current (5 A module)Sensor outputADC count
-5 A1.575 V322
0 A2.500 V512
1 A2.685 V549
2 A2.870 V587
5 A3.425 V701
Output = 2.5 V + 0.185 V/A × current; count = output × 1023 / 5. One count is about 26 mA.

The module’s output moves with its supply voltage, so a Uno on a USB port that sags to 4.7 V shifts the readings. Power it from the same 5 V that serves as the ADC reference, as the Uno does by default, so the ratio stays right. A short 100 nF capacitor from the sensor output to ground helps with noise.

Power and wiring

PartConnects toNote
ACS712 VCC, GND, OUT5V, GND, A0
Current pathBattery positive to the module IP+, IP− to the loadThick wire; the module’s screw terminals carry the load current
Voltage dividerBattery positive → 30 kΩ → A1 → 7.5 kΩ → GNDJoin battery negative to the Uno GND
LCD SDA / SCLA4 / A5Address often 0x27 or 0x3F
Check polarity and the divider order with a meter before connecting a battery. Fuse the battery lead as you would for any robot.

The sketch

// DC power meter: Uno + ACS712 5A + divider + I2C LCD
// Design worksheet: low-voltage DC only. Calibrate against a multimeter.

#include <Wire.h>
#include <LiquidCrystal_I2C.h>

const int I_PIN = A0, V_PIN = A1;
const float SENS = 0.185;                 // V per amp, 5 A module
const float DIV = (30000.0 + 7500.0) / 7500.0;   // divider ratio, 5.0
const float VCC = 5.0;
const float DEAD_A = 0.06;                // ignore currents below this

LiquidCrystal_I2C lcd(0x27, 16, 2);
float zeroV = 2.5;
float wh = 0;
unsigned long last = 0;

float readPin(int pin, int n) {
  long sum = 0;
  for (int i = 0; i < n; i++) sum += analogRead(pin);
  return (sum / (float)n) * VCC / 1023.0;
}

void setup() {
  lcd.init(); lcd.backlight();
  lcd.print("Zeroing...");
  zeroV = readPin(I_PIN, 200);              // no load connected at start-up
  lcd.clear();
  last = millis();
}

void loop() {
  float amps = (readPin(I_PIN, 50) - zeroV) / SENS;
  if (fabs(amps) < DEAD_A) amps = 0;
  float volts = readPin(V_PIN, 50) * DIV;
  float watts = volts * amps;

  unsigned long now = millis();
  wh += watts * (now - last) / 3600000.0;   // watt-hours
  last = now;

  lcd.setCursor(0, 0);
  lcd.print(volts, 2); lcd.print("V "); lcd.print(amps, 2); lcd.print("A   ");
  lcd.setCursor(0, 1);
  lcd.print(watts, 1); lcd.print("W "); lcd.print(wh, 2); lcd.print("Wh  ");
  delay(200);
}

Start it with the load switched off so the zero is correct. Compare the volts and amps with a multimeter and adjust SENS or DIV by the ratio if they disagree; a module’s real sensitivity can differ a few percent from the listing. Watt-hours reset when the Uno resets. The sketch has been proofread but not compiled on this site.

Test plan

  1. Zero check: with no load the current should read 0.00 A; if it creeps, check the supply and the zeroing.
  2. Voltage check: compare the volts with a multimeter at two battery levels.
  3. Current check: run a known load, such as a bulb or a resistor with a calculated current, and compare with a clamp or series meter.
  4. Motor run: measure a robot’s idle, cruise and stall currents.
  5. Energy check: run a constant load for 10 minutes and compare the Wh with power × time.
  6. Noise: note how much the current flickers at light loads.

What usually goes wrong

SymptomLikely causeFix
Current reads 0.3 A with no loadZero taken with a load connectedRestart with the load off
Readings driftSupply voltage changesUse a stable 5 V and average more samples
Volts read wrong by a fixed ratioDivider resistors differ from the codeMeasure the resistors and edit DIV
Current very noisy at low loadResolution is about 26 mA per countAverage more, or use a more sensitive part
Module gets warmCurrent above its ratingCheck the model’s current range

Upgrades

  • Peak hold: record the highest current seen, useful for stall.
  • Logging: record watts over time to an SD card.
  • Battery gauge: estimate remaining capacity from Wh used.
  • Better sensor: try a shunt-based monitor chip for finer low-current readings.

Cost and parts notes

The ₹1,070 total is an illustration and does not include shipping. Use the cost calculator to compare sellers.

Common questions

How accurate is an ACS712?

Hobby modules are usually good for a few percent at best and are noisy at small currents. Calibrate against a meter.

Why measure zero at start-up?

Each module’s zero point differs slightly, and a small error there is a large error at low current.

Can I use the 20 A version?

Yes, with SENS set to its listed sensitivity, about 100 mV per amp; the resolution gets coarser.

Can it measure mains?

Not with this build. Mains work needs proper isolation and training.

Last reviewed: November 2026. This is a design worksheet with illustrative costs. It has not been bench-tested by this site; library names, pins and limits must be checked against your board and the current library versions, and measurements from your build are welcome.

More builds

Next builds to try

Free: the final-year project pack

A shortlist with BOMs, a report outline that matches the usual chapter scheme, a costing sheet and 40 viva questions. Built for the February–April submission season.

The Build Note

One short email when something is worth your bench time.

A new build sheet, a part price that moved, or a mistake worth avoiding. No daily drip, no recycled news.

One short email when a build or a price is worth your time. Unsubscribe in one click.