This is V2 update of Atmega8 Volt-Ammeter. This new version features the following upgrades,
- Low power consumption
- Better Amperes display resolution while using low value drop resistor.
- Much smaller PCB size, only 5cm x 5cm. Still no SMD components.
- Easy calibration, only one voltage adjust and one ampere adjust preset, no voltage out detection.
Atmega8 based Voltmeter Ammeter v2 used Component List: |
1x Atmega8L/Atmega8A Pre-Programmed microcontroller (PDIP) 1x 1×16 LCD with Green/Blue Backlight 1x Custom PCB (5cm x 5xm) 1x LM7805 5V Voltage Regulator 2x 22uF 50V Electrolytic polarized capacitor 1x 100kpF Ceramic Capacitor 2x 10K Multiturn Trimmer Potentiometer in 3268 package 1x 10K 1/4watt Metal Film Resistor +-5% (brown, black, orange, golden) 2x 1K 1/4watt Metal Film Resistor +-5% (brown, black, red, golden) 1x 0.1~0.5Ohm / 3W Power Resistor 1x 1x16 and 1x 1x6 female pin header for LCD and ISP |
Voltmeter Ammeter v2 Technical Specifications: |
Voltage Supply: 6V – 30V Current Consumption: ~ 30mA with LCD backlight Voltage Input: 6-30V Voltage Resolution: 50mV Current Input: 0-5A Current Resolution: 100mA |
Schematics diagram
Board Top
Board Bottom
Assembled PCB
Voltage supplied by my 12Volt benchtop PSU(The resistor at output terminal is disconnected)
The 10Ohm resistance is connected and is burning :P. Voltage dropped to 8.75~8.80V and hence Amperes would be 0.875~0.88Amps and it is displayed here as 0.90Amps. It's perfect as the meter is having 100mA resolution.
Callibration and usage:
- Connect a 5V DC supply to the voltage input. And short pin 1 and pin 3 of the LM7805 regulator.
- Now tune the rightmost preset to show 5.00V on the LCD.
- Now connect any real power supply of say 12volts. Connect a load at output, say a auto lamp, Measure current with multimeter, or calculate Amperes, and then tune the 2nd rightmost preset to show that reading of Amperes on LCD.
Software is written in WinAVR and Peter's LCD library is used.The code below,
#include <avr/io.h> #include “lcd.h” #include <util/delay.h> void InitADC() { ADMUX=(1<<REFS0); // For Aref=AVcc; ADCSRA=(1<<ADEN)|(1<<ADPS2)|(1<<ADPS1)|(1<<ADPS0); //Prescalar div factor =128 } uint16_t ReadADC(uint8_t ch) { ch=ch&0b00000111; ADMUX|=ch; ADCSRA|=(1<<ADSC); while(!(ADCSRA & (1<<ADIF))); ADCSRA|=(1<<ADIF); return(ADC); } void print(uint16_t parameter) { parameter%=10000; lcd_putc((parameter/1000)+48); parameter%=1000; lcd_putc((parameter/100)+48); parameter%=100; lcd_puts(“.”); lcd_putc((parameter/10)+48); lcd_putc((parameter%10)+48); } void main() { int adc; while(1) { lcd_init(LCD_DISP_ON); lcd_clrscr(); lcd_gotoxy(0,0); lcd_puts(“Volts”); lcd_gotoxy(8,0); lcd_puts(“Amperes”); lcd_gotoxy(0,1); InitADC(); adc=ReadADC(0); print(adc*5); lcd_puts(“V”); InitADC(); adc=ReadADC(1); lcd_gotoxy(8,1); print(adc*10); lcd_puts(“A”); _delay_ms(100); } }
Downloads:
UPDATE:- The previously uploaded compiled HEX file had some problems. Use this hex file with fuse settings.
-U lfuse:w:0xe1:m -U hfuse:w:0xd9:m
Luis says
Hello Friend. I like your project, I have a question, to measure the power enters the 7805, not understanding. thanks
pal says
Hi
i have tried i have problem with hex code ,can i know what compiler i have to use to modify
Thanks
PAL
John says
Which is better Version 1 or Version 2? Can I put a switch for the LCD back light? Thanks
Kevcav says
Is there any update on the bug fix for this project.
Thanks
Arup says
Yes. v3 is almost ready, PCBs came from factory and after few days I'll have a final code for this and that would be published.
Kevcav says
Thanks for the good news.
V2 is a real challenge.
The update time of the data appears to be to long where have you implemented the time delay to allow me to change and recompile. Winavr works for me.
kevin
Arup says
Use the atmega8 in 8Mhz to have lesser delay without recompiling the modified source.
AVRDUDE args: -U lfuse:w:0xe4:m -U hfuse:w:0xd9:m
DMS says
Hi Arup,
I have one question for you. How remove and change (as i want) words on the LCD startup screen?
"Volt-Ameter V2 Circuits DIY.com"
Arup says
Download the source files, edit the 'main.c' then recompile it and burn the main.hex file to the AVR again.
Ciro says
Hello Arup. I built up this project with the SMD version of ATMEGA8. But it does not work at all. Nothing appears on LCD even after resetting the MCU. LCD contrast change
Please kindly let me know what is wrong with it. Thank you.
Arup says
You need to flash the firmware. Did you?
Jose says
Hello Aurp,
Great job!
I am waiting for v3. You will publish v3 also?
Thanks!
loeti says
Hallo!
Great work! Beginners question:
my problem is to get hexfile into mega8.
make all - no problems - exit code 0
if i select programm i only get: make.exe: Nothing to be done for `program'.
i dont unsed this prog. bevore.
Pavel says
Are you sure that the software (main.hex) downloadable here is for the schematic diagram published also on this page?
I mean, with connection PD1 to D7 / PD2 to D6 / PD3 to D5 / PD4 to D4 / PD5 to E, PD6 to R/W, PD7 to RS and D3,D2,D1,D0 not connected, the LCD shows nothing!
Thanks,
Pavel
choi says
Nice to see you.
atmega8 pony prog in the fuse bits
What happens?
PEYGIR says
tanks for ur help
how do i can change atmega 16 and 7segment for this project
please help me
DILIP RAJA says
mr.arup.
is the program written just below the images in "C" ,in winAVR is the total program for the project.
because i would like to make some modifications for my project in winavr.
fat loss factor review says
What's up i am kavin, its my first occasion to commenting anyplace, when i read this paragraph i thought i could also create comment due to this sensible article.
alex says
is possible test 100amp with arduino with other components?