ATMEGA128 and DS2438 ?

Status
Not open for further replies.
I made :
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 - - -

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
What's the calculation for displaying voltage input on LCD ?
thanks

- - - Updated - - -

is it this one ?
Code:
adc_volt = ((adc_steps*0.00488)*4000)-(((1023-adc_steps)*0.00488)*4000);  //Formula for positive
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…