Usecase 17
Usecase 17
🎯 Objective:
Develop a hardware system that monitors the voltage, current, and temperature of individual battery cells to prevent overcharging,
overheating, and failures using Arduino and sensors.
Voltage Sensor 1 A0
Voltage Sensor 2 A1
Current Sensor A2
Relay Module D3
Buzzer D4
// LCD setup
LiquidCrystal_I2C lcd(0x27, 16, 2);
void setup() {
Serial.begin(9600);
lcd.begin(16, 2);
lcd.backlight();
pinMode(VOLTAGE_SENSOR_1, INPUT);
pinMode(VOLTAGE_SENSOR_2, INPUT);
pinMode(CURRENT_SENSOR, INPUT);
pinMode(TEMP_SENSOR, INPUT);
pinMode(RELAY_PIN, OUTPUT);
pinMode(BUZZER_PIN, OUTPUT);
pinMode(LED_GREEN, OUTPUT);
pinMode(LED_RED, OUTPUT);
void loop() {
// Read sensor values
float voltage1 = analogRead(VOLTAGE_SENSOR_1) * (5.0 / 1023.0) * 5; // Scale voltage
float voltage2 = analogRead(VOLTAGE_SENSOR_2) * (5.0 / 1023.0) * 5;
float current = analogRead(CURRENT_SENSOR) * (5.0 / 1023.0) * 30; // Scale to real current range
float temperature = analogRead(TEMP_SENSOR) * (5.0 / 1023.0) * 100; // Convert to °C
lcd.setCursor(0, 1);
lcd.print("I:");
lcd.print(current, 2);
lcd.print("A T:");
lcd.print(temperature, 1);
lcd.print("C");
// Safety checks
if (voltage1 > MAX_VOLTAGE || voltage2 > MAX_VOLTAGE || current > MAX_CURRENT || temperature >
MAX_TEMPERATURE) {
digitalWrite(RELAY_PIN, LOW); // Disconnect battery
digitalWrite(BUZZER_PIN, HIGH);
digitalWrite(LED_GREEN, LOW);
digitalWrite(LED_RED, HIGH);
lcd.setCursor(10, 1);
lcd.print("ALERT!");
} else {
digitalWrite(RELAY_PIN, HIGH); // Keep battery connected
digitalWrite(BUZZER_PIN, LOW);
digitalWrite(LED_GREEN, HIGH);
digitalWrite(LED_RED, LOW);
}
Serial.print("V1: ");
Serial.print(voltage1);
Serial.print("V | V2: ");
Serial.print(voltage2);
Serial.print("V | I: ");
Serial.print(current);
Serial.print("A | T: ");
Serial.print(temperature);
Serial.println("C");
delay(1000);
}
3️⃣Alert System
● LED Indicator:
✅ Final Outcome
✔ Monitors battery cells in real-time
✔ Prevents overcharging, overheating, and overcurrent
✔ Automatically disconnects battery in unsafe conditions
✔ Alerts user with buzzer and LED indicators
✔ Displays data on LCD and Serial Monitor