Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO Based Battery Voltage and Current Monitoring System with LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Battery Voltage and Current Monitoring System with LCD Display

Circuit Documentation

Summary

This circuit is designed to measure the voltage and current of a 12V battery and display the measured values on a 20x4 I2C LCD screen. The core of the circuit is an Arduino UNO microcontroller, which reads the analog signals from a voltage sensor and a current sensor (5A range), processes these signals, and then outputs the data to the LCD display. The sensors are powered by the 5V output from the Arduino, and the battery's voltage and current are monitored in real-time.

Component List

Arduino UNO

Voltage Sensor

Current Sensor 5A

Battery 12V

LCD Display 20x4 I2C

Wiring Details

Arduino UNO

Voltage Sensor

Current Sensor 5A

Battery 12V

LCD Display 20x4 I2C

Documented Code

/*
 * This Arduino sketch measures the voltage and current of a battery using
 * a voltage sensor and a current sensor. The measured values are displayed
 * on a 20x4 I2C LCD screen.
 */

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

// Initialize the LCD with the I2C address 0x27
LiquidCrystal_I2C lcd(0x27, 20, 4);

// Pin definitions
const int voltageSensorPin = A0;
const int currentSensorPin = A1;

void setup() {
  // Initialize the LCD
  lcd.begin();
  lcd.backlight();

  // Initialize serial communication
  Serial.begin(9600);
}

void loop() {
  // Read voltage sensor value
  int voltageValue = analogRead(voltageSensorPin);
  float voltage = (voltageValue / 1023.0) * 5.0 * (12.0 / 5.0); // Adjust for sensor

  // Read current sensor value
  int currentValue = analogRead(currentSensorPin);
  float current = (currentValue / 1023.0) * 5.0 / 0.185; // Adjust for sensor

  // Print values to serial monitor
  Serial.print("Voltage: ");
  Serial.print(voltage);
  Serial.print(" V");
  Serial.print("\tCurrent: ");
  Serial.print(current);
  Serial.println(" A");

  // Display values on LCD
  lcd.setCursor(0, 0);
  lcd.print("Voltage: ");
  lcd.print(voltage);
  lcd.print(" V");
  lcd.setCursor(0, 1);
  lcd.print("Current: ");
  lcd.print(current);
  lcd.print(" A");

  // Wait for a second before next reading
  delay(1000);
}

This code is designed to run on the Arduino UNO microcontroller. It initializes the LCD display, reads the analog values from the voltage and current sensors, calculates the actual voltage and current based on the sensor characteristics, and then displays the results on the LCD as well as outputs them to the serial monitor. The loop function repeats this process every second.