rishi arora
Published © GPL3+

Battery Tester

The project helps in detecting a dead battery and checking the voltage supply of batteries in general.

IntermediateShowcase (no instructions)1 hour1,564
Battery Tester

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
3.6V 0.5W Zener Diode
3.6V 0.5W Zener Diode
×1
Breadboard (generic)
Breadboard (generic)
×1
Resistor 221 ohm
Resistor 221 ohm
×1
Resistor 10k ohm
Resistor 10k ohm
×1

Story

Read more

Schematics

MBhy035AF5OGl7Lkdon4.JPG

Code

battery_tester.ino

C/C++
int greenLed=3;
int redLed=4;
int yellowLed=6;

int analogValue=0;
float voltage=0;



void setup() {
 
pinMode(greenLed,OUTPUT);
pinMode(redLed,OUTPUT);
pinMode(yellowLed,OUTPUT);
}

void loop() {
  analogValue=analogRead(A0);
  voltage=0.0048*analogValue;
  if(voltage>=1.6)
  digitalWrite(redLed,HIGH);
  else if(voltage>1.4 && voltage<1.6)
  digitalWrite(yellowLed,HIGH);
  else if(voltage<=1.4)
  digitalWrite(greenLed,HIGH);

  delay(50);
  digitalWrite(redLed,LOW);
  digitalWrite(yellowLed,LOW);
  digitalWrite(greenLed,LOW);
  

}

Credits

rishi arora

rishi arora

11 projects • 4 followers

Comments