Introduction: Homemade Battery Monitor Using AVR

Picture of Homemade Battery Monitor Using AVR

Guys,

I want to share my experiment with voltage divider, ADC and AVR
Homemade battery monitor using AVR
It's pretty simple the sensor are only two resistors and zener diode with capasitor, I don't buy them, I've found it in my box.
We can use it for monitoring our car battery voltage.

Step 1: The Part I Used

Picture of The Part I Used

1.ATMEGA128
2.10K and 56K resistors as a voltage divider
3. 5V1 Zener diode
4.  1uF Caps,
5. 16x2 LCD
6.    3 wires to connect the sensor into ADC

Let's continue to the code

Step 2: The Code and Atmel Studio

Picture of The Code and Atmel Studio

Guys, the main key for this experiment is ADC and calculation,
you can calibrate first with 5V from 7805

This is the equation I used
adcA = ((int)((5000/1024)*adc_result));

Step 3: Let's Enjoy My Home Made Battery Monitor

Picture of Let's Enjoy My Home Made Battery Monitor
Let's enjoy my home made battery monitor

Comments

carlos66ba (author)2013-09-19

Also remember folks: by default the avr's (at least in the arduinos) use the 5V line as a reference for the ADC (0V = 0, 5V = 1023), but if your 5V is not too good or stable (e.g., using batteries directly hooked to the AVR not through a regulator) you can also use the INTERNAL BANDGAP REFERENCE (I believe it is 1.1 V).