Temperature sensor from Analogue to Digital

I am currently doing a mini-project on temperature sensor using 8051 micro-controller.

The 8051 micro-controller will receive 8bit temperature data from Analogue-to-Digital Converter which is connected to a temperature sensor(eg. LM35)

I have a problem in translating the 8bit data from ADC to a temperature reading (eg. 38 celcius)in keil. I hope to understand the structure or the procedure in carrying out this step. Thank you!

Parents
  • The data sheet

    http://www.national.com/pf/LM/LM35.html

    says that the part produces a linear +10 mV per degree C. So, take the voltage measurement from the ADC and divide to get a temperature. You might need to add a constant to account for the "zero" point of the device.

    Or, to look at it another way, you have an 8-bit ADC, which 8 bits have to cover the whole temperature range. So you could just scale the 0-255 value to the range of temperatures for the LM35.

    It should be a nice, simple, one-line calculation. What problem are you having, exactly?

Reply
  • The data sheet

    http://www.national.com/pf/LM/LM35.html

    says that the part produces a linear +10 mV per degree C. So, take the voltage measurement from the ADC and divide to get a temperature. You might need to add a constant to account for the "zero" point of the device.

    Or, to look at it another way, you have an 8-bit ADC, which 8 bits have to cover the whole temperature range. So you could just scale the 0-255 value to the range of temperatures for the LM35.

    It should be a nice, simple, one-line calculation. What problem are you having, exactly?

Children
More questions in this forum