Arduino Project #1

This is a guide on how to make a D-battery charge tester using arduino.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: Step 1: MATERIALS

Here is a list of what you need for the D-battery charge tester.

- 1 Arduino Uno R3 and breadboard

- 3 LED lights

- 10 wires

- 1 1.5V (D) battery

Step 2: Step 2: Putting It Together

Use the attached image for assembly.

Step 3: Step 3: Code Time

If not already downloaded-

- download the arduino software from the arduino website

- Imput the code below and run

float a = 0;
float x; float y;

void setup() {



pinMode(13, OUTPUT); }

void loop() {

a = analogRead(0);

if (a > x) {

digitalWrite(13, HIGH);

digitalWrite(12, LOW);

digitalWrite(11, LOW);

} else if (a > y && a < x) {

digitalWrite(13, LOW);

digitalWrite(12, HIGH);

digitalWrite(11, LOW);

} else if (a < y) {

digitalWrite(13, LOW);

digitalWrite(12, LOW);

digitalWrite(11, HIGH);



float conversion(float a){

float b=((a/5)*1024);

return b;


Step 4: Step 4: You're Done!

The arduino should work perfectly now.

Be the First to Share


    • Made with Math Contest

      Made with Math Contest
    • Multi-Discipline Contest

      Multi-Discipline Contest
    • Robotics Contest

      Robotics Contest



    3 years ago

    Nice little project! I would recommend changing your title though, to tell people what this is. Maybe "Arduino Battery Tester" or something like that.

    Thanks for sharing your first instructable! Hope to see more projects soon :)