Introduction

This project uses one of the analog to digital converter (ADC) channels on the TINKERplate to measure and evaluate the capacity of a standard 1.5V alkaline battery. It then sends that information to the 8 channel LED strip that is included with the TINKERkit.

Required Parts

This project uses a few items from the TINKERkit:

  • the TINKERkit board connected tot the Raspberry Pi
  • the mini breadboard
  • nine male to male jumper wires
  • the 74HCT125 integrated circuit
  • the eight channel RGB LED strip

Steps

Assembly

Gather the materials above and connect everything together as shown in the diagram below:

When testing, place the red wire pn the positive terminal and the black wire on the negative terminal.

Code

Enter the following program into Thonny or copy the code below into you Home folder on your Raspberry Pi. The estimaed battery capacity will control how many LEDs are turned on. In addition, their colors will be set to indicate whether they are in the GOOD, OK, or BAD zone. The BAD zone is the bottom 4 LEDs which will be red. The OK zone will be two yellow LEDs in positions 5 and 6. And the GOOD zone will be the two green LEDs in positions 7 and 8.

For downloading:

The above code can be downloaded from github by typing the following instructions on the command line:

  1. git clone https://github.com/pi-plates/TINKERplate-Projects.git
  2. cd TINKERplate-Projects
  3. python3 BATTERYtester II.py

Output

Running the above code will drive the LEDs in the strip to a hight proportional to the battery capacity. The image below shows the ouput of a -mostly- GOOD battery. Note how the top LED is off? A brand new battery would illuminate all eight LEDs.

Series Navigation<< Battery Tester ILED Night Light >>