on 30 July 2013
These temperature sensors appear to be very popular for hobbyists as well as real world application. In order to get this thing to work, you can apply a direct current of 5 Volts (if using a microcontroller) to +Vs, ground it via GND, and you will get a temperature reading from Vout. Lay the flat side of the sensor on a surface with the pins pointing to you, from left to right, the pins are GND, Vout, +Vs.
Do NOT mix the +Vs and GND pins around, applying voltage to the wrong ones will cause the sensor to burn up rapidly and will burn you if you touch it. Someone had reported that the sensor climbed up to 481.5°F (250.5°C) as a result of this.
I've compared the output readings of this sensor with other thermometers I have and seems to give a fairly stable reading, however calibration is required I'm sure.
Using an Arduino, use this: analogRead(sensor_pin)*(5.0/1023.0); to convert the 0 to 1023 scale to a 0 to 5 scale (meaning Voltage) and then simply multiple by 100 to receive the temperature in Fahrenheit. You will have this code: float temp = analogRead(sensor_pin)*(5.0/1023.0)*100; To convert to Celsius, just do: temp = (temp-32.0)/1.8;
Now, I have seen people's code subtract certain values to obtain an offset on the results. Some people subtract 100mV, some people subtract 750mV. Please read the datasheet for more information about that.
on 24 May 2014
There's not much to say about this, except that it works exactly as specified. There are a few other sites on the interface saying that this can measure temperature with an accuracy of 0.1 degrees, but this is not really true, especially if would are reading the device from a ADC with limited resolution. I have this attached to an Arduino Uno and the ADC is only 10 bits, which covers the range 0-1024 representing 0-5V. The temperature range of the device is ~-50 upto 150oC, but this only covers the actual voltage range of 0-2V. By the time you calculate the temperature according to the data sheet, you find that a 1 bit difference from the Arduino's ADC represents a temperature difference of ~0.48oC. That's more than accurate enough for my needs, but others might need to use a 12-bit or 16-bit ADC if you want more accuracy.
on 25 March 2015
Really simple to use, and the precision with an Arduino – effectively about 0.5°C as far as I can see – is fine for many purposes. But the readings seem to be quite variable, beyond what can be explained by a 1-bit change in the ADC output, and also not very accurate. I have a 0.1 µF ceramic capacitor on the power pin, as recommended in the datasheet. Perhaps my code is wrong. For room temperatures I'm using the Arduino's 1.1 V reference voltage, and the info from the datasheet: 10 mV per °C plus 500 mV offset:
analogReference(INTERNAL); // Use built-in 1.1 V reference for extra A/D accuracy
float tvolts = analogRead(tempPin) / 1024.00 * 1.1; // Convert sensor reading to volts
float roomtemp = (tvolts - 0.5) * 100; // Convert sensor volts to °C