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

Arduino Nano-Based Voltage and Current Monitoring System with 16x2 LCD Display

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Voltage and Current Monitoring System with 16x2 LCD Display

Circuit Documentation

Summary

This circuit is designed to measure voltage and current using a voltage sensor and a current sensor, respectively. The measured values are displayed on a 16x2 LCD screen. The circuit is controlled by an Arduino Nano microcontroller, which reads the sensor values and updates the LCD display accordingly.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly microcontroller board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. Voltage Sensor

    • Description: A sensor used to measure voltage.
    • Pins: Ground, Phase, Vcc, Out, Gnd
  3. 16X2 LCD

    • Description: A 16x2 character LCD display.
    • Pins: VSS, VDD, V0, RS, RW, E, D1, D0, D2, D3, D4, D6, D5, D7, A, K
  4. Potentiometer

    • Description: A variable resistor used to adjust the contrast of the LCD.
    • Pins: GND, Output, VCC
  5. Resistor

    • Description: A 220 Ohm resistor used to limit current.
    • Pins: pin1, pin2
    • Properties: Resistance: 220 Ohms
  6. Current Sensor 5A

    • Description: A sensor used to measure current up to 5A.
    • Pins: 1, 2, GND, OUT, VCC

Wiring Details

Arduino Nano

16X2 LCD

Voltage Sensor

Current Sensor 5A

Potentiometer

Resistor

Code Documentation

/*
 * This Arduino Sketch reads voltage from a voltage sensor connected to A1
 * and current from a current sensor connected to A2. It displays the measured
 * voltage and current on a 16x2 LCD. The LCD is connected to the Arduino Nano
 * as per the specified pin connections.
 */

#include <LiquidCrystal.h>

// Initialize the library with the numbers of the interface pins
LiquidCrystal lcd(7, 8, 9, 10, 11, 12);

// Voltage sensor pin
const int voltageSensorPin = A1;
// Current sensor pin
const int currentSensorPin = A2;

void setup() {
  // Set up the LCD's number of columns and rows:
  lcd.begin(16, 2);
  // Print a message to the LCD.
  lcd.print("Voltage:");
  lcd.setCursor(0, 1);
  lcd.print("Current:");
}

void loop() {
  // Read the input on analog pin A1
  int voltageValue = analogRead(voltageSensorPin);
  // Convert the analog reading (0 - 1023) to a voltage (0 - 5V):
  float voltage = voltageValue * (5.0 / 1023.0);
  // Read the input on analog pin A2
  int currentValue = analogRead(currentSensorPin);
  // Convert the analog reading (0 - 1023) to a current (0 - 5A):
  float current = currentValue * (5.0 / 1023.0);
  // Set the cursor to column 0, line 0
  lcd.setCursor(0, 0);
  // Print the voltage to the LCD
  lcd.print("Voltage: ");
  lcd.print(voltage);
  lcd.print(" V");
  // Set the cursor to column 0, line 1
  lcd.setCursor(0, 1);
  // Print the current to the LCD
  lcd.print("Current: ");
  lcd.print(current);
  lcd.print(" A");
  // Wait for a bit before the next loop
  delay(500);
}

This code initializes the LCD and sets up the pins for the voltage and current sensors. In the loop function, it reads the sensor values, converts them to voltage and current, and displays the values on the LCD.