Microcontroller › 8051 › plz let me know what is the error in this simple program…….. of lcd interfacing › Alright. Lets take LM35;LM35
Alright.
Lets take LM35;
LM35 is a 3-pin device with a VCC, GND and OUT (output pin). The voltage at the OUT pin is always the temperatue equivalent.
For example if the temperature is 32 degree, the voltage at the OUT pin will be 0.32 volts. All you have to do is to convert this anlog value to its digital equivalent using an ADC, so that the controller can read it.
Now the ADC;
ADC (Analog to Digital Converter) can convert the voltage at its analog input pin to corresponging digital at its digital pins.
For example an ADC0804 has an AIN (analog input pin). If you apply a 2 volts at this pin then the eight digital out pins (D0 to D7) will represent the binary equivalent of 2*(256/5); provided that you’ve connected the REF (ADC reference pin) to 5 volt.
As there are 8 digital output pins, you can directly connect the ADC to any of the 8-pin digital port of the controller and read the entire port. If you store it to a charater type data, it will represent the value;
(TEMPERATURE/100)(256/5).
Just to give you an idea, suggest you to cross check the expressions with the actual datasheet.