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

Arduino UNO Based Hybrid Energy Management System with I2C LCD Display and Relay Control

View and Edit Project In Cirkit DesignerImage of Arduino UNO Based Hybrid Energy Management System with I2C LCD Display and Relay Control

Circuit Documentation

Summary

The circuit is designed to manage a hybrid energy system that utilizes solar panels, a battery, and an AC power source to supply electricity. It features an Arduino UNO microcontroller to monitor voltage levels from the different energy sources and control relays to switch between these sources based on their availability and voltage levels. The system also includes a 20x4 LCD with an I2C module to display voltage readings and the current power source. Voltage sensors are used to measure the voltage from the solar panel, battery, and grid. A 4-channel relay module is used to control the power flow to different loads and charge controllers.

Component List

Wiring Details

Arduino UNO

I2C Module

4 Channel Relay Module

Voltage Sensor

Solar Panel

Battery

POWER SUPPLY 12V 5AMP

Resistor

LED: Two Pin (red)

Documented Code

Arduino UNO Code (sketch.ino)

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

LiquidCrystal_I2C lcd(0x27, 20, 4);

const int solarPin = A0;
const int batteryPin = A1;
const int gridPin = A2;

const int relaySolar = 13;
const int relayBattery = 12;
const int relayGrid = 11;
const int relayHighLoad = 7;
const int relayNormalLoad = 6;
const int relayLowLoad = 5;
const int Gcharge = 4;
const int Scharge = 3;
const int Emer = 1;

float solarVoltage, batteryVoltage, gridVoltage;

void setup() {
  Serial.begin(9600);
  lcd.backlight();
  lcd.begin(20, 4);
  lcd.init();
  
  lcd.setCursor(0, 1);
  lcd.print("HYBRID ENERGY SMART");
  lcd.setCursor(5, 2);
  lcd.print("MANAGEMENT");
  delay(2000);

  pinMode(relaySolar, OUTPUT);
  pinMode(relayBattery, OUTPUT);
  pinMode(relayGrid, OUTPUT);
  pinMode(relayHighLoad, OUTPUT);
  pinMode(relayNormalLoad, OUTPUT);
  pinMode(relayLowLoad, OUTPUT);
  pinMode(Gcharge, OUTPUT);
  pinMode(Scharge, OUTPUT);
  pinMode(Emer, OUTPUT);

  digitalWrite(relaySolar, HIGH);
  digitalWrite(relayBattery, HIGH);
  digitalWrite(relayGrid, HIGH);
  digitalWrite(relayHighLoad, HIGH);
  digitalWrite(relayNormalLoad, HIGH);
  digitalWrite(relayLowLoad, HIGH);
  digitalWrite(Gcharge, HIGH);
  digitalWrite(Scharge, HIGH);
  digitalWrite(Emer, HIGH);
}

void loop() {
  solarVoltage = analogRead(solarPin) * (5.0 / 1023.0) * (26.0 / 5.0);
  batteryVoltage = analogRead(batteryPin) * (5.0 / 1023.0) * (23.5 / 5.0);
  gridVoltage = analogRead(gridPin) * (5.0 / 1023.0) * (23.5 / 5.0);

  lcd.clear();
  lcd.setCursor(0, 0);
  lcd.print("Solar: ");
  lcd.print(solarVoltage, 2);
  lcd.print("V");

  lcd.setCursor(0, 1);
  lcd.print("Battery: ");
  lcd.print(batteryVoltage, 2);
  lcd.print("V");

  lcd.setCursor(0, 2);
  lcd.print("Grid: ");
  lcd.print(gridVoltage, 2);
  lcd.print("V");

  // Logic to control relays based on voltage readings
  // and update the LCD with the current power source.
  // (The full logic is omitted for brevity.)
  
  delay(1000);
}

This code is responsible for reading the voltage levels from the solar panel, battery, and grid, and controlling the relays to switch between these power sources. It also updates the LCD with the current voltage readings and power source information.

POWER SUPPLY 12V 5AMP Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This code is a placeholder for the power supply unit and does not contain any functional code. It is included for completeness.