Search This Blog

Monday, June 18, 2012

DIY voltmeter using ATmega328 and 4 digits 7 segment display



Arduino Code: (Voltmeter Part)

float ATT_Volt=0;
float Voltage=0;
float R1=47000; // measure using a voltmeter to get accurate value
float R2=4660; // measure using a voltmeter to get accurate value
int Value=0;
Value=analogRead(AnalogPin);
ATT_Volt=(Value*5.0)/1204;   // 5.0 V of Vcc
Voltage=ATT_Volt/(R2/(R1+R2));  // Display Voltage using 7 segment, LCD or serial terminal

Concept by: Arduinoprojects101