taking measurements from sensors with Arduino

I connected a temperature sensor on a PC board to my arduino. I wrote code for the arduino to print the results from the sensor but arduino prints out some weird numbers like 562,126,...as the temperature when the temperature should be like room temperature. How do you interpret the results from arduino? Any ideas?

Does the device have a number? A datasheet or some other spec? Does the device maybe read out in Kelvin?

Also how are your wiring the PC temp sensor to the Arduino board, how many wires? is there a common ground connection, etc.

Lefty

If you're using an LM34 or similar sensor, a number like 562 would mean ~60F. Without your code I can only assume it's reporting the value straight out of the ADC (0 to 1023).

Analog inputs have 10-bit analog to digital converters, and by default they are referenced to the internal reference of 1.1V.

60F from an LM34 would be 0.6V.

(562/1023) * 1.1V = 0.60V = 60F (1023 = 2^10 - 1 for the number of values you can get out of 10-bit readings)

That 126 is kind of low to make sense, though.

(126/1023) * 1.1V = 0.14V = 14F (Fridge/Freezer???)

hope this is helpful. I have a post in Exhibition about a temp sensor I made with it's code. I don't feel like posting the link, but I will if you can't find it yourself and are interested.

General ADC formula:

Analog Reading = (Reported step value / Full-scale step value)*Voltage Reference

LM34 reports a voltage proportional to 10mV (0.01V) per degree Fahrenheit.

Again as an example: 0.6V = (562/1023)*1.1V 0.6V * 10mV/degree Fahrenheit = 60 degrees Fahrenheit

Scott S: Thanks a lot! I think your explanation makes a lotta sense. Shout out to errybody that contributed also. Case solved!!! ...at least for now

no problem. i responded to your PM with a more detailed explanation of how it all works. check that out.