Navigation

»Home
»Projects
»Photos
»About Me
»Links
»Guestbook

 


ECE112 - 14 Segment Battery Status Display

ECE112 - 14 Segment Battery Status Display - Winter 2005

As per EE TA Matt Shuman's suggestion, I designed a component that uses a Tiny26 and a 14 segment LED display to show the current status of the battery. I have programed the Tiny26 to measure (on pin B04) the voltage at T7 on the battery charger board. I have programmed "steps" at which the voltage will be as the battery discharges. The Tiny26 uses these steps to then display the battery's remaining capacity, in estimated (abysmally estimated) percentage, which can be shown between digits 0 through 10. Currently, the hardware is finalized, but I'm still sorting out the software. A major design flaw has been discovered (thanks Matt) in which as the voltage to the Tiny26 drops, the 5 volt reference to the analog-to-digital converter is skewed. Further testing in the coming weeks should create a work-around for this.

UPDATE: With the help of Matt Shuman, I was able to slightly change the hardware layout to allow Pin A03 to remain free. This allowed me to change the ADC reference voltage, correcting the above-mentioned problem.

As per Atmel's Tiny26L reference sheet, the ADC_VREF_TYPE register in the ECE111.h file needs to be changed from it's default 0b00100000 (Using a 5V reference) to 0b10100000 (Using an internal 2.56V reference without capacitor on pin A03).

ADMUX ADC Voltage Reference Register Settings (Atmel.com):

Now with the ADC voltage reference set to an internal 2.56V, the equation for the ADC measure function set points changes to:

ADC Result=(Vin*256)/2.56.

Using this equation, and the known range of voltages possible during the battery pack's discharge cycle, the battery percentage set points can be programmed. As shown in the following graph, it is possible to see that a single Ni-Cad battery cell's discharge rate is relatively linear in it's useful region. The programming reflects this, as the set points determined by the measure function change in linear increments of 10. Due to the extended lenght of time it would take to test the programming using the actual discharge rate of the batteries, an "artificial" battery discharge voltage was created with a 10K Potentiometer (As seen in the video). It was placed between 5V VCC and ground, with the output soldered to pin B04 on the Tiny26. By varying the resistance, it's possible to quickly test the the code.

600mAh AA Ni-Cad Battery Discharge Voltage Graph (Sanyo.com):

Click to View Current Code

14 Segment LED Display Pin-Out:

14 Segment Display Schematic:

 

First Test After Assembly:

Revised Design, Allowing Access to the Tiny26 Board:

Testing Battery Voltages During Discharge (Between T7 and GND):

Complete and Working Display Mounted on Tekbot:

Click to See a Video of the Display! ~5.4MB

-Requires Windows Media Player

© 2005 | Andrew Sanford