Projects / Car battery voltage monitor

Car battery voltage monitor

Beginner1 hGuided buildReviewed

Build it step by step

0 of 7 done
  1. NANO

    Measure the divider

    Apply 12 V from a bench supply and read A0 with a multimeter.

  2. NANO

    Test on the bench

    Calibrate with the CAL constant.

  3. NANOLM2596

    Set the buck module

    Adjust to exactly 5.0 V with no load first.

  4. NANO

    Add the display and buzzer

    Show voltage and test the thresholds.

  5. NANO

    Add the fuse

    Fit a fuse holder in the 12 V lead.

  6. NANO

    Box it

    Place everything in a plastic case with a strain relief on the lead.

  7. NANO

    Try it in the car

    Compare with a multimeter at the battery.

In short

How do you build a car battery voltage monitor?

A small display plugged into the cigarette socket shows battery voltage and warns if it is weak or overcharging. You need Arduino Nano, SSD1306 OLED Display, Resistor 10 kΩ, Resistor 3.3 kΩ, Zener diode 5.1 V (1N4733A), LM2596 Buck Module and Active buzzer 5 V. It takes 7 steps and about 60 minutes.

Level
Beginner
Time
About 60 min
Parts
7

Parts list

Tick what you already own. It saves to My Garage, so “Build with what I have” knows.

Wiring

FromToWhy
12 V supply (from the socket, through a 1 A fuse)LM2596 module IN+ and IN−Buck to 5 V
LM2596 OUT+ and OUT−Nano 5V and GNDSet to 5.0 V before connecting the Nano
12 V supply10 kΩ resistor to A0Upper divider resistor
A03.3 kΩ to GNDLower divider resistor
Zener 5.1 VCathode to A0, anode to GNDClamps the input
OLED SDA, SCLNano A4, A5I2C display
OLED VCC and GNDNano 5V and GNDPower
BuzzerNano D8 and GNDWarning sound

Code

A divider of 10 kΩ and 3.3 kΩ turns 16 V into about 3.9 V at the analogue pin, safely under 5 V, and the 5.1 V zener clamps anything above that. A car's electrical system has spikes, so use the buck module to make 5 V and set its output with a multimeter to 5.0 V before the Nano is connected; a wrong setting can destroy the Nano. Fit a fuse of about 1 A in the supply lead, as close to the socket as you can, and use proper automotive plug and wire. Typical readings are about 12.6 V for a rested battery, 13.7 to 14.4 V while the engine runs, and below about 12.0 V for a weak battery. These are general guides; treat them as hints and have a weak battery tested by a garage. Arduino IDE, board "Arduino Nano" (try the Old Bootloader option if the upload fails).

Runs on a virtual Arduino Nano in your browser, with sliders for the sensors. Happy with it? Verify and upload to your real board from the same page (Chrome or Edge on a computer).

// Car battery voltage monitor. Board: Arduino Nano. Libraries: Adafruit SSD1306, Adafruit GFX.
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

Adafruit_SSD1306 oled(128, 64, &Wire, -1);
const float R_TOP = 10000.0, R_BOTTOM = 3300.0;     // divider, measure your real resistors
const float VREF = 5.00;                            // measure the Nano 5V pin and enter it here
const float CAL = 1.000;                            // adjust against a multimeter
const int BUZZ = 8;

float readVolts() {
  long sum = 0;
  for (int i = 0; i < 32; i++) { sum += analogRead(A0); delay(2); }
  float v = (sum / 32.0) * VREF / 1023.0;
  return v * (R_TOP + R_BOTTOM) / R_BOTTOM * CAL;
}

void setup() {
  pinMode(BUZZ, OUTPUT);
  oled.begin(SSD1306_SWITCHCAPVCC, 0x3C);
  oled.setTextColor(SSD1306_WHITE);
}

void loop() {
  float v = readVolts();
  oled.clearDisplay();
  oled.setTextSize(3); oled.setCursor(8, 6); oled.print(v, 1); oled.print("V");
  oled.setTextSize(1); oled.setCursor(0, 44);
  if (v < 12.0)       { oled.print("Weak: below 12.0 V");   tone(BUZZ, 1500, 200); }
  else if (v > 14.8)  { oled.print("Over 14.8 V: charging high"); tone(BUZZ, 2500, 200); }
  else if (v > 13.2)  { oled.print("Engine running, charging"); }
  else                { oled.print("Parked, battery OK"); }
  oled.display();
  delay(1000);
}

Test checklist

What you should see at each check. If a reading is far off, stop and use the troubleshooting list.

CheckExpected
Bench at 12.0 VDisplay within 0.1 V of the multimeter
Below 12.0 VWarning shows and the buzzer chirps
Above 14.8 VHigh-charge warning
In the car, engine onAbout 13.7 to 14.4 V

If it does not work

Reading far too high

Check the divider values and VREF.

Display shows 0

Check A0 and the lower resistor.

Resets when starting the engine

Add a 1000 µF capacitor on the buck input.

Noisy reading

Average more samples.

Still stuck? Find the fault step by step with your multimeter →

Ask Lark AI

Common questions

What parts do I need for the car battery voltage monitor?

Arduino Nano, SSD1306 OLED Display, Resistor 10 kΩ, Resistor 3.3 kΩ, Zener diode 5.1 V (1N4733A), LM2596 Buck Module and Active buzzer 5 V.

How long does the car battery voltage monitor take to build?

About 60 minutes for a beginner maker, in 7 steps.

How do I know the car battery voltage monitor works?

Bench at 12.0 V: Display within 0.1 V of the multimeter. Below 12.0 V: Warning shows and the buzzer chirps. Above 14.8 V: High-charge warning.

Reading far too high: what should I check?

Check the divider values and VREF.

Display shows 0: what should I check?

Check A0 and the lower resistor.

Resets when starting the engine: what should I check?

Add a 1000 µF capacitor on the buck input.

Noisy reading: what should I check?

Average more samples.