Same-day dispatch before 2 PM · Free delivery over ₹999 · GST invoices Get the appPrices incl. GST
Geekobot
Snap & SendNEWGeeko AIWhere's myOrder
Log in
Products
  • Projects
    • Component guidesHow parts work, with code you can run
    • Learning pathsFrom your first LED to your first robot
    • Workshops & eventsOnline sessions for makers and classes
    • ElectrolarkFree guided builds, simulator and certificates
    • Students & teachersStudent discount and classroom help
    • CommunityShare builds and ask other makers
    • CalculatorsOhm's law, LED resistor, 555 and 100+ more
    • Circuit builderWire parts and run the circuit, powered by Electrolark
    • Geeko AIAsk what to buy or how to wire it
    • Snap & SendPhotograph a part or list, we find it
    • Part finderAnswer a few questions, get the right part
    • Compatibility checkWill these two parts work together?
    • Compare partsSpecs side by side
    • Business & bulk ordersGST invoices, credit and volume prices
    • Request a quotationSend your list, get a quote
    • Classroom kitsPer-student kits and lab bundles
    • Gift cardsFor students, teams and events
  • Atal Tinkering Lab
BOM to cart
Geekobot

Components, kits and know-how for makers, students, engineers, labs and businesses across India.

Ask Geeko AIOrders, parts and projects, any timeEmail supportReply within 1 working dayGet the Geekobot appAdd it to your home screen, free

Follow us

Shop

  • Boards & SBCs
  • Sensors & Modules
  • IoT & Wireless
  • Drone & FPV
  • 3D Printing
  • Filaments & Resins
  • Motors & Drivers
  • Power & Batteries
  • Semiconductors
  • Passive
  • Displays & LEDs
  • Switches & Relays
  • Wires & Cables
  • Prototyping
  • Tools & Test
  • Robotics
  • STEM Kits
  • Atal Tinkering Lab
  • Mechanical Parts
  • Audio

Orders

  • Track your order
  • Help & support
  • Shipping and delivery
  • Refunds and cancellation
  • Contact us

Learn

  • Projects
  • Geeko AI project assistant
  • Learning paths
  • Guides
  • Calculators
  • Electrolark: free guided builds

Part tools

  • Part finder
  • Compare parts
  • Will it work with my board?

Institutions

  • Classroom kits
  • Atal Tinkering Lab
  • Students & teachers
  • Workshops & Events

Business

  • Business & education
  • Request a quotation
  • BOM bulk upload
  • Quick order by SKU

Company

  • About Geekobot
  • Community
  • Gift cards
  • Terms & conditions
  • Privacy policy
  • Product directory
  • Sitemap

© 2026 Geekobot, a trade name of OLatus Systems Private Limited. All rights reserved.

20, 1st Floor, Neeladri Complex, 10th Cross, Sampige Rd, 2nd Main, Malleshwaram, Bengaluru, Karnataka 560003 · GSTIN 29AACCO0462F1ZM

+91 91810 15607 · connect@geekobot.in · Monday to Saturday, 10 AM to 2 PM IST

UPI · CARDS · NETBANKING · GST INVOICES

ShopProjectsGeeko AIGuides
Compare 0 parts →
Log in

Shop by category

Shop all components
  • Boards & SBCs1,910 products
    • Alternative Single Board Computers
    • Arduino Ecosystem
    • FPGA & Logic Boards
    • Microcontroller & Wireless Boards
    View all
  • Sensors & Modules4,701 products
    • Biomedical & Heart Rate
    • Current, Voltage & Power
    • Force, Weight & Pressure
    • Gas, Weather & Environmental
    View all
  • IoT & Wireless2,314 products
    • RF Modules
    • RFID & NFC
    • Antennas & RF Accessories
    • Cameras & Smart Vision
    View all
  • Drone & FPV3,558 products
    • Flight Control & Navigation
    • FPV Video & Optics
    • Frames & Structural Parts
    • Motors & Propulsion
    View all
  • 3D Printing2,204 products
    • 3D Printers
    • 3D Scanners & Digitizers
    • Laser Engravers & Cutters
    • Material Management & Upgrades
    View all
  • Filaments & Resins1,472 products
    • Filaments
    • Photopolymer Resins
    View all
  • Motors & Drivers463 products
    • BLDC Motor Drivers
    • DC & Geared Motors
    • DC Motor Drivers
    • Linear Actuators & Solenoids
    View all
  • Power & Batteries557 products
    • Battery Holders & Connectors
    • Breadboard Power
    • Chargers & BMS
    • DC-DC Converters
    View all
  • Semiconductors295 products
    • Diodes & Rectifiers
    • Interface & RF Encoder ICs
    • Logic ICs (74xx)
    • Logic ICs (CD4000)
    View all
  • Passive67 products
    • Capacitors
    • Circuit Protection
    • Crystals & Oscillators
    • Inductors
    View all
  • Displays & LEDs572 products
    • 7-Segment & Dot Matrix
    • Addressable LEDs
    • Character LCDs
    • Graphic LCDs
    View all
  • Switches & Relays184 products
    • Keypads & Touch
    • Push Buttons & Tactile
    • Relay Modules
    • Relays
    View all
  • Wires & Cables233 products
    • Board-to-Wire Connectors
    • Crimp & Splice
    • Headers & Dupont
    • Heat Shrink & Sleeving
    View all
  • Prototyping101 products
    • Breadboards
    • Interface Modules
    • PCBs & Perfboards
    View all
  • Tools & Test717 products
    • Bench Power Supplies
    • Hand Tools
    • Measuring Tools
    • Meters & Testers
    View all
  • Robotics180 products
    • Humanoid & Legged Robots
    • Robot Chassis & Platforms
    • Robotic Arms & Grippers
    • Wheels & Casters
    View all
  • STEM Kits268 products
    • Arduino Learning Kits
    • Coding & IoT Kits
    • Early Coding (Ages 3-8)
    • Invention Kits
    View all
  • Atal Tinkering Lab196 products
    • Package 1: Electronics, Robotics, IoT and Sensors
    • Package 2: Rapid Prototyping Tools
    • Package 3: Mechanical, Electrical and Measurement Tools
    • Package 4: Power Supply, Accessories and Safety Equipment
    View all
  • Mechanical Parts212 products
    • Bearings
    • Brackets & Mounts
    • Couplers
    • Fasteners & Standoffs
    View all
  • Audio109 products
    • Amplifier Modules
    • Buzzers & Sirens
    • Speakers
    View all
  1. Home
  2. ›Projects
  3. ›12 V solar battery monitor

Sensor projects

12 V solar battery monitor: volts, amps and amp-hours

See how much current your panel puts in and your load takes out, and track the battery's state in amp-hours.

By Geekobot Learning Team

Intermediate
Difficulty
2 to 3 hours
Build time
₹5,060
Parts cost
15
Parts
Arduino
Platform
Add all parts · ₹5,060Start building
  • Energy & power
  • Measurement & tools
UNO5.1V
Tap a part to see what it does
OverviewPartsWiringBuildCodeTroubleshootFAQIdeas

What you'll build

A Hall-effect current sensor measures up to 50 A in either direction without breaking the circuit's ground, and a simple divider module measures battery voltage. The Arduino adds up current over time to show amp-hours in and out. A blade fuse right at the battery protects the wiring, and a buck-boost module turns 12 V into a clean 5 V for the electronics.

What you'll learn

  • Bidirectional Hall current sensing
  • Integrating current to amp-hours
  • Why every battery lead needs a fuse
Safety

A shorted 12 V battery can melt wires and start a fire: fuse the positive lead first.

Do not connect or disconnect the sensor while current is flowing.

  1. SenseBattery voltage and current
  2. ThinkArduino integrates amp-hours
  3. ActOLED shows V, A, W and Ah

Parts list

Tick anything you already have and the total updates.

PartQtyPrice
  • Double Head Spot Welding Copper Needle Electrode Tip (100 mm)
    GB-PWRB-0233

    Copper electrode tips for a battery spot welder, if you build your own 18650 pack

    × 1₹170₹170
  • UNO
    Uno R3 CH340G ATmega328p Compatible Development Board
    GB-SBCD-0329Guide

    Reads both sensors

    × 1₹204₹204
  • Allegro MicroSystems ACS758LCB-050B-PFF-T Hall Current Sensor Module – 50A Bidirectional
    GB-SENS-2778Guide

    ACS758 ±50 A Hall current sensor, 40 mV per amp

    × 1₹350₹350
  • Voltage Detection Sensor Module, 0-25V DC
    GB-SENS-4383

    0-25 V divider module for the battery voltage

    × 1₹40₹40
  • Automotive Blade Fuse
    GB-PASV-0051

    Automotive blade fuse at the battery positive

    × 1₹7₹7
  • Generic DC-DC Boost & Buck Converter Module, ±3–30V Adjustable Output, Input 3.6–30V
    GB-SENS-2879

    Buck-boost converter: 12 V battery to a steady 5 V for the Uno

    × 1₹749₹749
  • 0.96" OLED Display 128x64
    GB-DISP-0005Guide

    Shows the readings

    × 1₹167₹167
  • INA3221 Triple-Channel Current and Voltage Monitor Module
    GB-SENS-4366Guide

    INA3221: three small channels (up to about 1.6 A each) for USB loads and sensors

    × 1₹250₹250
  • Digital Watt Meter and Power Analyser
    GB-SENS-4397Guide

    Ready-made watt meter to check your readings

    × 1₹650₹650
  • Seeed Studio Studio Grove LTC2941 Coulomb Counter Module 3.3-5V – I2C Interface
    GB-SENS-2808Guide

    Coulomb counter for a single-cell LiPo project

    × 1₹1,339₹1,339
  • DFRobot Solar LiPo Charger 3.7V – 500mA Max, 33x33mm Module
    GB-SENS-2948Guide

    Solar LiPo charger for a small 3.7 V sensor node

    × 1₹509₹509
  • DFRobot Gravity Analog Voltage Divider V2 – Voltage Detection Module
    GB-SENS-2968Guide

    Plug-in voltage divider for the Gravity system

    × 1₹389₹389
  • Hi-Link HLK-PM03L Open Frame AC-DC Power Module – 3.3V 600mA Output
    GB-SENS-4265Guide

    Mains-to-3.3 V module for a sealed product (installed by a qualified person)

    × 1₹169₹169
  • Solderless Breadboard
    GB-PROT-0001Guide

    Holds the parts without soldering

    × 1₹18₹18
  • Dupont Jumper Wires (40 pcs)
    GB-WIRE-0001Guide

    Connects the parts

    × 1₹49₹49

Complete kit

15 of 15 parts in one tap

₹5,060

GST included

3% off these parts while the whole kit stays in your cart

Parts you still need

₹5,060

15 of 15 parts. Tick anything you already have.

About ₹1,51,800 before bulk pricing for 30 kits.

Request bulk quote

Learn the parts

  • Atal Tinkering Lab (ATL)
  • ACS758 50A, 100A and 200A Hall Current Sensor Module
  • MAX30102 Heart Rate and SpO2 Sensor Guide
  • INA3221 3-Channel Current Monitor
  • Digital Watt Meter and DC Power Analyser (150A)
  • Grove LTC2941 Coulomb Counter Module
  • CN3791 MPPT, CN3065 and DFRobot Solar LiPo Chargers
  • Voltage Sensor Modules
  • Hi-Link AC-DC Power Modules (HLK-5LS05, HLK-PM03L)
  • Arduino Uno

Calculators for this build

  • Solar charge controller sizing calculator (PWM vs MPPT)
  • Transformer turns ratio and current calculator
  • AC power, kVA and power factor calculator

Wiring

Follow the colours: red is power, dark grey is ground, blue is a signal.

Battery, panel and charge controller are sold separately. Fit the fuse within 20 cm of the battery terminal.

PartPinConnect toNote
Voltage moduleVCC / GND (screw side)Battery + (after the fuse) / Battery −
Voltage moduleS / −A0 / GND
ACS758IP+ / IP−In series with the battery positive leadUse wire rated for your maximum current
ACS758VCC / GND / OUT5V / GND / A1
Buck-boostIN+ / IN−Battery + (after the fuse) / Battery −Set the output to 5.0 V before connecting the Uno
Buck-boostOUT+ / OUT−Uno 5V / GND
OLEDSDA / SCLA4 / A5
  • Voltage moduleVCC / GND (screw side) → Battery + (after the fuse) / Battery −
  • Voltage moduleS / − → A0 / GND
  • ACS758IP+ / IP− → In series with the battery positive leadUse wire rated for your maximum current
  • ACS758VCC / GND / OUT → 5V / GND / A1
  • Buck-boostIN+ / IN− → Battery + (after the fuse) / Battery −Set the output to 5.0 V before connecting the Uno
  • Buck-boostOUT+ / OUT− → Uno 5V / GND
  • OLEDSDA / SCL → A4 / A5
Built it? Check your wiring before you power up.Pick the pin each wire went to and we'll point out swapped pins, power mistakes and pins that clash.

Step-by-step build

0 of 6 done

Code

solar_monitor.inoVerify & upload in Electrolark
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
Adafruit_SSD1306 oled(128, 64, &Wire, -1);

const float V_SCALE = 5.0;            // the 0-25 V module divides by 5
float ZERO_V = 2.50;                  // ACS758 output at 0 A (about VCC/2)
const float MV_PER_A = 40.0;          // ACS758LCB-050B at 5 V
double ah = 0;
unsigned long last;

float avgVolts(int pin) {
  long s = 0;
  for (int i = 0; i < 64; i++) s += analogRead(pin);
  return s / 64.0 * 5.0 / 1023.0;
}

void setup() {
  Serial.begin(115200);
  oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  last = millis();
}

void loop() {
  float vbat = avgVolts(A0) * V_SCALE;
  float vout = avgVolts(A1);
  float amps = (vout - ZERO_V) * 1000.0 / MV_PER_A;   // + = into the battery
  unsigned long now = millis();
  ah += amps * (now - last) / 3600000.0;
  last = now;

  Serial.print("raw "); Serial.print(vout, 3);
  Serial.print("  V "); Serial.print(vbat, 2);
  Serial.print("  A "); Serial.print(amps, 2);
  Serial.print("  Ah "); Serial.println(ah, 3);

  oled.clearDisplay(); oled.setTextColor(WHITE); oled.setTextSize(2);
  oled.setCursor(0, 0);  oled.print(vbat, 2); oled.print(" V");
  oled.setCursor(0, 22); oled.print(amps, 1); oled.print(" A");
  oled.setTextSize(1); oled.setCursor(0, 46);
  oled.print(vbat * amps, 0); oled.print(" W   "); oled.print(ah, 2); oled.print(" Ah");
  oled.display();
  delay(1000);
}

Run it: what this code does

The sketch above runs here on a simulated Arduino Uno. Move the sliders for the sensors and buttons it reads, and watch the Serial monitor, display and outputs change.

Troubleshooting

Current reads about 1 A with nothing connected+

Set ZERO_V from the raw value at 0 A. Keep magnets and current-carrying wires away from the sensor.

Voltage reads high+

The Uno's 5 V may be lower than 5.0 V; measure it and replace 5.0 in avgVolts.

Readings jump when the inverter runs+

Average more samples and twist the sensor wires together.

FAQ

Is amp-hours the same as state of charge?+

Not exactly. It drifts over days; reset it when the battery is known to be full.

Can it measure 100 A?+

Use a higher-range ACS758 or a shunt; this one is ±50 A.

Does it work with lithium batteries?+

Yes for measuring; charging and protection stay with a proper BMS and charge controller.

What parts do I need to build the 12 V solar battery monitor: volts, amps and amp-hours?+

15 parts: Double Head Spot Welding Copper Needle Electrode Tip (100 mm), Uno R3 CH340G ATmega328p Compatible Development Board, Allegro MicroSystems ACS758LCB-050B-PFF-T Hall Current Sensor Module – 50A Bidirectional, Voltage Detection Sensor Module, 0-25V DC, Automotive Blade Fuse, Generic DC-DC Boost & Buck Converter Module, ±3–30V Adjustable Output, Input 3.6–30V, 0.96" OLED Display 128x64, INA3221 Triple-Channel Current and Voltage Monitor Module, Digital Watt Meter and Power Analyser, Seeed Studio Studio Grove LTC2941 Coulomb Counter Module 3.3-5V – I2C Interface, plus 5 more. On this page you can tick the parts you already have and add only the rest to your cart.

How hard is it and how long does it take?+

It is a intermediate project and takes about 2 to 3 hours. The build on this page has 6 steps.

Do I need to write the code myself?+

No. This page has the complete, tested code (solar_monitor.ino).

Can I see what the code does before I build it?+

Yes. The Run it panel under the code runs this exact sketch on a simulated board. Move the sliders or press the buttons for the sensors it reads, and the Serial monitor, display and outputs react as they will on the real build. It is a simulation, so real readings depend on your parts and wiring.

How much does the 12 V solar battery monitor: volts, amps and amp-hours cost to build?+

About ₹5,060 for the parts at the prices on this page. Quantity price breaks lower the cost when you build several.

What will I learn from this project?+

Bidirectional Hall current sensing; Integrating current to amp-hours; Why every battery lead needs a fuse.

Is it safe to build?+

A shorted 12 V battery can melt wires and start a fire: fuse the positive lead first. Do not connect or disconnect the sensor while current is flowing.

What can I build next with these parts?+

Ideas that reuse this build: Raspberry Pi relay HAT garden timer. They are listed under Take it further on this page.

Take it further

  • Raspberry Pi relay HAT garden timer

Related projects

  • UNO
    Sensor
    Beginner· 1 hour

    LPG gas leak alarm

    A kitchen gas sniffer that beeps and flashes the moment LPG levels climb.

    ₹505 · 8 partsArduino
  • NANO
    Sensor
    Beginner· 1–2 hours

    Smoke alarm with OLED readout

    See the smoke level live on a crisp screen and get a loud warning when it spikes.

    ₹539 · 6 partsArduino
  • UNO
    Sensor
    Beginner· 45 minutes

    Flame detector fire alarm

    An infrared eye that spots an open flame and raises the alarm.

    ₹434 · 8 partsArduino
  • UNO
    Sensor
    Beginner· 1 hour

    PIR intruder alarm

    Walk into the room and it sounds the alarm: the classic first security build.

    ₹459 · 8 partsArduino

Learning project. Check every circuit and the datasheet of each part before you power it up.

Run itChange the inputs and watch the output
7. 50 V
-2 5. 0 A
-187 W -0.01 Ah
Serial monitor115200 baud
raw 1.501  V 7.50  A -24.97  Ah 0.000
raw 1.501  V 7.50  A -24.98  Ah -0.007
raw 1.501  V 7.50  A -24.98  Ah -0.014

A simulation of the sketch above, so you know what to expect. Real readings vary with your parts and wiring.

Ask the Community

Ask a question Share your build