This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

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
  • "Each step from 0000 0000 to 0000 0001 contribute to a certain degree C."

    Exactly - so all you need to do is apply the scale factor that relates the 1-bit step to a certain degree C.

    You may also need to add an offset to account for the Celsius temperature corresonding to the 8-bit binay 0000 0000.

    Assuming it's linear, it's your good old y = mx + c

    Note that this has nothing specifically to do with Keil - the principle is the same whatever tools you use, and whatever language, from whatever vendor!

    Try thinking about how you'd do it by hand!

Reply
  • "Each step from 0000 0000 to 0000 0001 contribute to a certain degree C."

    Exactly - so all you need to do is apply the scale factor that relates the 1-bit step to a certain degree C.

    You may also need to add an offset to account for the Celsius temperature corresonding to the 8-bit binay 0000 0000.

    Assuming it's linear, it's your good old y = mx + c

    Note that this has nothing specifically to do with Keil - the principle is the same whatever tools you use, and whatever language, from whatever vendor!

    Try thinking about how you'd do it by hand!

Children
No data