Battery Tester

Intro: Battery Tester

This Arduino project will help you test your battery. You will get an estimate of the amount of battery your battery has. DO NOT EXCEED 5V

MATERIALS:

  • 10 wires
  • 3 LED lights(color doesn't matter)
  • 1 bread board
  • 1 Arduino board
  • 1 battery(5V or less)

Step 1: Code

float on = 1.4;

float off = 1,4;

float Volts;

void setup(){

pinMode(13,OUTPUT);

pinMode(12,OUTPUT);

pinMode(11,OUTPUT);

Serial.begin(9600);

}

void loop(){

Volts = analogRead(0);

if(convert(Volts) > on){

digitalWrite(13,HIGH);

digitalWrite(12,HIGH);

digitalWrite(11,HIGH);

}

if(convert(Volts) > off){

digitalWrite(13,HIGH);

digitalWrite(12,HIGH);

}else

if(convert(Volts) < off){

digitalWrite(13,HIGH);

}

Serial.println(convert(Volts));

}

float convert(float watts){

return((watts/1024)*5);

}

Step 2: Assembly

Different types of batteries can be used. Just a few tweaks of the code are needed. Do not use a battery that is higher than 5V.

Share

    Recommendations

    • Fix It! Contest

      Fix It! Contest
    • Metalworking Contest

      Metalworking Contest
    • Tiny Home Contest

      Tiny Home Contest

    Discussions

    0
    None
    Penolopy Bulnick

    6 months ago

    Sounds good! Did you get a chance to make this?