Zbotic Logo Zbotic Logo
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

  • Shop
  • About Us
  • Contact Us
  • Reseller
  • Blogs
020 69134444
1800 209 0998
[email protected]
Help Desk
Facebook Twitter Instagram Linkedin YouTube
Zbotic Logo Zbotic Logo
0 0

View Wishlist Add all to cart

0 0
0 Shopping Cart
Shopping cart (0)
Subtotal: ₹0.00

View cartCheckout

All departments
  • 3D Print Service
  • 3D Printer
  • Batteries & Chargers
  • Development Boards
  • Drone Parts
  • EBike parts
  • Sensor Modules
  • Electronic Components
  • Electronic Modules
  • IoT and Wireless
  • Mechanical Parts and Workbench Tools
  • Motors & Drivers & Pumps & Actuators
  • DIY and Robot Kits
  • Show more
  • Home
  • Shop
  • Sale
  • 3D Print Service
  • PCB Service
  • B2B
  • Blogs
  • Contact Us
Return to previous page
Home Batteries & Power

Watt Hour Meter: Energy Consumption Logger Build

Watt Hour Meter: Energy Consumption Logger Build

April 1, 2026 /Posted by / 0

A watt hour meter tracks energy consumption in real time, logging watts, watt-hours, and cumulative kWh. Building a DIY energy logger helps you understand electricity usage patterns, identify power-hungry devices, and optimise your energy costs. This guide covers building an Arduino-based energy logger using the INA219 (for DC) or ZMPT101B+ACS712 (for AC) with SD card data logging.

Table of Contents

  1. What Is a Watt Hour Meter?
  2. Hardware Components
  3. Circuit Design
  4. Arduino Energy Logging Code
  5. Logging to SD Card
  6. Recommended Components
  7. FAQ

What Is a Watt Hour Meter?

A watt-hour meter measures energy (the product of power and time):

Energy (Wh) = Power (W) x Time (hours)
Energy (Wh) = Voltage (V) x Current (A) x Time (hours)

Digital measurement:
  Sample V and I every 100ms
  Wh += (V x I) x (0.1s / 3600)

Example: Monitor a 12V battery system
  11:00 - 11:30: Solar charging at 5A → 12V x 5A x 0.5h = 30Wh IN
  11:30 - 13:00: Load drawing 2A → 12V x 2A x 1.5h = 36Wh OUT
  Net: -6Wh (more consumed than generated)

Hardware Components

  • DC monitoring: INA219 module (measures V, I, P simultaneously via I2C)
  • AC monitoring: ZMPT101B (voltage) + ACS712 (current) for 230V Indian mains
  • Display: 0.96″ or 1.3″ OLED for real-time readings
  • Data logging: SD card module for long-term energy data recording
  • Controller: Arduino Nano (simple) or ESP32 (WiFi data upload)
  • RTC: DS3231 for accurate timestamps on logged data

Circuit Design

DC Energy Logger (battery/solar):
  INA219 in series with load
  Arduino reads V, I, P via I2C every 100ms
  Accumulates Wh over time
  Displays on OLED: V, I, W, Wh, kWh
  Logs to SD card every minute

AC Energy Logger (mains):
  ZMPT101B on live wire
  ACS712 (30A) on live wire
  Arduino samples both at 5kHz (100 samples per 50Hz cycle)
  Calculates RMS voltage, RMS current, real power
  Accumulates Wh

Arduino Energy Logging Code

#include <Adafruit_INA219.h>
#include <U8g2lib.h>

Adafruit_INA219 ina;
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0);

float totalWh = 0;
unsigned long lastSample = 0;

void setup() {
  Serial.begin(9600);
  ina.begin();
  u8g2.begin();
  lastSample = millis();
}

void loop() {
  float v = ina.getBusVoltage_V();
  float i = ina.getCurrent_mA() / 1000.0;
  float p = v * i;

  unsigned long now = millis();
  float dt_h = (now - lastSample) / 3600000.0;
  totalWh += p * dt_h;
  lastSample = now;

  // Display
  u8g2.clearBuffer();
  u8g2.setFont(u8g2_font_6x10_tr);
  char buf[32];
  sprintf(buf, "V: %.1fV", v); u8g2.drawStr(0, 12, buf);
  sprintf(buf, "I: %.2fA", i); u8g2.drawStr(0, 24, buf);
  sprintf(buf, "P: %.1fW", p); u8g2.drawStr(0, 36, buf);
  sprintf(buf, "E: %.1fWh", totalWh); u8g2.drawStr(0, 48, buf);
  sprintf(buf, "kWh: %.3f", totalWh/1000); u8g2.drawStr(0, 60, buf);
  u8g2.sendBuffer();

  delay(100);
}

Logging to SD Card

Add SD card logging for long-term energy tracking. Log timestamp, voltage, current, power, and cumulative Wh every 60 seconds. Import the CSV into Excel for charts and analysis. Over a month, you will have detailed energy usage data that reveals peak consumption times and inefficient devices.

INA219 Current/Power Monitor
High-precision I2C current and power sensor.
View on Zbotic →
0.96″ I2C OLED Display
128×64 OLED for battery monitors and dashboards.
View on Zbotic →
150A Watt Meter
Inline watt meter for battery and solar testing.
View on Zbotic →
ESP32 Development Board
WiFi+BT board for IoT monitoring projects.
View on Zbotic →

Shop All Batteries & Power →

FAQ

How accurate is a DIY watt-hour meter compared to the electricity board meter?

A well-calibrated INA219-based DC meter achieves 1-2% accuracy. For AC with ZMPT101B+ACS712, expect 3-5% accuracy (limited by sensor linearity and sampling rate). The electricity board’s meter is calibrated to 0.5-1% accuracy. The DIY meter is excellent for relative measurements and trend analysis.

Can I use this to verify my electricity bill?

For rough verification, yes. Monitor your main supply for 24 hours and compare daily kWh with the meter reading. If there is more than 10% discrepancy, investigate — either your DIY meter needs calibration or the electricity meter needs testing.

Tags: Arduino, Batteries, Batteries Power, Energy Meter, INA219, Watt Hour
Share Post
  • Facebook
  • Linkedin
  • Whatsapp
Bimetallic Strip: Temperature-...
blog bimetallic strip temperature activated mechanical switch 614859
blog thermal adhesive bond heat sinks without screws 614863
Thermal Adhesive: Bond Heat Si...

Related posts

Svg%3E
Read more

Power Electronics Lab: Equipment List for Students

April 1, 2026 0
Setting up a power electronics lab for students and hobbyists requires the right equipment to safely work with batteries, converters,... Continue reading
Svg%3E
Read more

Battery Recycling Process: Extract Materials Safely

April 1, 2026 0
Understanding the battery recycling process is essential as lithium-ion batteries reach end of life in growing numbers. India generates an... Continue reading
Svg%3E
Read more

Battery Formation: First Charge Process Explained

April 1, 2026 0
The battery formation process is the critical first charge cycle that transforms raw electrode materials into a functional lithium-ion battery... Continue reading
Svg%3E
Read more

Islanding Detection: Safety for Grid-Connected Solar

April 1, 2026 0
Islanding detection is the critical safety mechanism that prevents solar inverters from energising dead grid lines during a power outage.... Continue reading
Svg%3E
Read more

Grid Tied Inverter: Feed Solar Power to Grid India

April 1, 2026 0
A grid tied inverter converts DC solar power into AC electricity synchronised with the utility grid, allowing you to feed... Continue reading

Add comment Cancel reply

Your email address will not be published. Required fields are marked

Facebook Twitter Instagram Pinterest Linkedin Youtube

Get the latest deals and more.

Download on Google Play Download on the App Store

Call us: 020 69134444 / 1800 209 0998

Monday - Saturday 09:30 AM - 06:00 PM
For Technical Supports Email: [email protected]
For Sales / Enquiries Email: [email protected]

  • My Account

    • Cart

    • Wishlist

    • Checkout

    • My Orders

    • Track Order

    • My Account

  • Information

    • FAQs

    • Blogs

    • Career

    • About Us

    • Contact Us

    • Payment Options

  • Policies

    • Privacy Policy

    • Terms & Conditions

    • GST Input Tax Credit

    • Shipping Return Policy

    • E-Waste Collection Points

    • Our Sitemap

© Zbotic.in is registered trademark of Moxie Supply Pvt Ltd – All Rights Reserved
Login
Use Phone Number
Use Email Address
Not a member yet? Register Now
Reset Password
Use Phone Number
Use Email Address
Register
Already a member? Login Now