ADC value to lcd display doubts

Status
Not open for further replies.

thannara123

Advanced Member level 5
Joined
Jan 7, 2010
Messages
1,602
Helped
122
Reputation
244
Reaction score
116
Trophy points
1,353
Visit site
Activity points
10,627
Hello experts , i want to know what value we get from an 8 bit ADC (0804) ?
Binary ,or hex ?
how it pass to LCD ?
i googled but the programs are available but not logic .
please help me ,.
any understandable c code
 

It is binary.
Datasheet says " The digital outputs vary from 0 to a maximum of 255".

To display it in a LCD -- you have to read the binary value (probably using a microcontroller) and drive the LCD accordingly.
 
thats means we need to converts that binary to decimal for the LCD display ?
 

Yes.
You have to remember the reference voltage value.
datasheet says
"The step size can be adjusted by setting the reference voltage at pin9. When this pin is not connected, the default reference voltage is the operating voltage, i.e., Vcc. The step size at 5V is 19.53mV (5V/255), i.e., for every 19.53mV rise in the analog input, the output varies by 1 unit. To set a particular voltage level as the reference value, this pin is connected to half the voltage. For example, to set a reference of 4V (Vref), pin9 is connected to 2V (Vref/2), thereby reducing the step size to 15.62mV (4V/255). "
Let say
Your Vref = 5V
You get ADC result = 10001100 i.e decimal 140
your value to be display = 19.53mV x 140 = 2.73 V
 
i am not connected vref . thats 5 v, taken as step size 19.53.

i want a simple program to display .
including the conversion ?
 


If ADC value is 255 and max voltage is 5V for 255. So 255 * 5.0 / 255 = 5.0 which is the volts.

If adc value is 100 then 100 * 5 / 255 = 1.9 approx.

If you change the scale to say 300 V then

255 * 300 / 255 = 300

ADC value * scale / 255 for 8 bit adc.
 
The value of adc result will be in binary form in the hardware but it doesn't matter whether the value is represented by binary or hex or decimal. To convert it to character you just add 0x30 or 48d (decimal) to it.

0 + 0x30 = '0' which can be print on LCD.
 
i have added the 0x30 with value and displayed ,but some asci higher value shows
 

Attachments

  • ADC0804+LCD 4bit + 8051.zip
    54.9 KB · Views: 95

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…