bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
I made :
The code above is already displaying the voltage on ADC pin, am I right ?
Then,
What's the calculation, so the display on LCD is equal to "Input voltage" ?
Currently I used 56K : 10K resistor voltage divider.
Thanks
- - - Updated - - -
thanks
- - - Updated - - -
is it this one ?
Code:
int adc_result;
double adcA,d,adcresistance;
char voltage[50];
adcA = ((int)(5000/1023)*adc_result);
lcd_xy(0,0);
lcd_string("Voltage:");
if (adcA != 0)
{
sprintf(voltage,"%.2f",adcA);
lcd_xy(1,0);
lcd_string(voltage);lcd_string(" mV");
}
The code above is already displaying the voltage on ADC pin, am I right ?
Then,
What's the calculation, so the display on LCD is equal to "Input voltage" ?
Currently I used 56K : 10K resistor voltage divider.
Thanks
- - - Updated - - -
What's the calculation for displaying voltage input on LCD ?Ok I'm here.
Use 12V-20V-30V input voltage and measure voltage on output with voltmeter.
Try R1 47K and R2 10K trimmer.
Best regards,
Peter
thanks
- - - Updated - - -
is it this one ?
Code:
adc_volt = ((adc_steps*0.00488)*4000)-(((1023-adc_steps)*0.00488)*4000); //Formula for positive