Temperature sensor


13 posts
by Dark » Thu Aug 30, 2012 1:50 pm
Hi,

I'm looking to buy some temperature sensors for my Raspberry Pi. I don't have much experience with buying sensors.

What interface should I use? I2C, usb-serial, something else?

I was thinking of I2C because i would not need any extra devices. This is wat i've found allready: LM 75Temperature Sensor
But this sensor has a accuracy of 2 degrees Celsius. Isn't that allot? Also it's a SMD component and I honestly don't know how to solder something that small. (Tips?)
Posts: 21
Joined: Thu May 10, 2012 4:39 pm
by joan » Thu Aug 30, 2012 2:20 pm
User avatar
Posts: 6557
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Dark » Thu Aug 30, 2012 2:38 pm
joan wrote:A breakout board such as http://www.hobbytronics.co.uk/sensors/temp-pressure/tmp102-temperature-sensor may be easier to handle.


Seems a good options! It's has a much better accuracy and easy soldering.

So if i connect the 3.3v, ground, sda, scl pin's directly to the raspberry pi this would work? I can remember something about needing resistors when using I2C (long time ago)
Posts: 21
Joined: Thu May 10, 2012 4:39 pm
by joan » Thu Aug 30, 2012 3:00 pm
Yes, those connections will work. You will not need resistors. The Raspberry Pi already has resistors built in to the I2C pins.

Look around. You may be able to find a similar or better breakout board closer to home.
User avatar
Posts: 6557
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK
by Dark » Thu Aug 30, 2012 3:06 pm
Ok thanks ! I'm buying some as soon as possible :)
Posts: 21
Joined: Thu May 10, 2012 4:39 pm
by texy » Sat Sep 01, 2012 9:15 pm
"2.8inch TFT LCD + Touch screen" add-on boards for sale here :
http://www.raspberrypi.org/phpBB3/viewtopic.php?f=93&t=65566
50p goes to the Foundation ;-)
Forum Moderator
Forum Moderator
Posts: 2480
Joined: Sat Mar 03, 2012 10:59 am
Location: Berkshire, England
by mahjongg » Sat Sep 01, 2012 9:22 pm
Yes, a 2 degrees Celsius resolution seems imprecise. but sensing precise temperatures is a lot harder than people realise! However the TMP102 has four times that resolution (0,5 degrees). You won't easily find a cheap solution with a better resolution.
Also note that up to eight LM75 sensors or two TMP102 sensors can be connected to the same I2C bus.
User avatar
Forum Moderator
Forum Moderator
Posts: 6014
Joined: Sun Mar 11, 2012 12:19 am
by Dark » Sun Sep 02, 2012 3:56 am
mahjongg wrote:Yes, a 2 degrees Celsius resolution seems imprecise. but sensing precise temperatures is a lot harder than people realise! However the TMP102 has four times that resolution (0,5 degrees). You won't easily find a cheap solution with a better resolution.
Also note that up to eight LM75 sensors or two TMP102 sensors can be connected to the same I2C bus.


Why is there a limitation on that? And can you solve this anyway?
Posts: 21
Joined: Thu May 10, 2012 4:39 pm
by chickey » Tue Sep 04, 2012 7:14 am
Anyone know a cheap source of these in the UK? I only need one for a project and they end up being £6-7 once you factor in shipping.

Col.
Posts: 61
Joined: Thu Jan 05, 2012 11:17 am
by mauorrizze » Sat Sep 29, 2012 7:07 am
The LM75 really is inaccurate, I'd also go with the TMP102, though this one is missing in my own comparison (my blog).

The TMP102 is quite rare (and even more in Germany), if you are looking for a cheaper alternative, try a 1-wire DS18B20, which is also very accurate, easy to connect (only 3 cables/1 data cable, 1 resistor and some more can be connected without using more pins on the pi) and kernel drivers are included in the current debian images or Adafruit images I believe. If it isn't availabe in a shop near you and time doesn't matter alot, you can order it in Asia on ebay (10 pieces < £10, 1 for about £2).

Furthermore there are still analog sensors that can be used with an ADC, but connecting them would be more complex and more expensive.
Posts: 1
Joined: Sat Sep 29, 2012 6:48 am
by repton » Sat Sep 29, 2012 9:40 am
The cheapest solution is a single DS18S20 or DS18B20 temperature sensor from Maxim and a 4.7k resistor and then use the kernel based 1-Wire driver.

Connect the sensors 0V pin to GND, data to GPIO4 and power to 3V3 on the expansion header and then put the 4.7k resistor between the power and data lines and then:

sudo modprobe w1_gpio
sudo modprobe w1_therm

This should give you stuff in /sys/bus/w1/ which allows you to read the temperature. I am in the process of designing a simple plug-in board with all the components you need on.

See this thread for more information:

viewtopic.php?f=44&t=6649

HTH,
Paul
UK Supplier of 1-Wire components, kits and modules:
http://www.sheepwalkelectronics.co.uk/
Posts: 91
Joined: Sat Mar 17, 2012 6:06 pm
Location: North Yorkshire, UK.
by rooster » Mon Oct 01, 2012 10:31 am
Dark wrote:
mahjongg wrote:Yes, a 2 degrees Celsius resolution seems imprecise. but sensing precise temperatures is a lot harder than people realise! However the TMP102 has four times that resolution (0,5 degrees). You won't easily find a cheap solution with a better resolution.
Also note that up to eight LM75 sensors or two TMP102 sensors can be connected to the same I2C bus.


Why is there a limitation on that? And can you solve this anyway?


temperature measurement is difficult. a thermometer may read out in 0.1 C intervals but it is not actually that accurate. in the lab, instead of measuring the potential difference generated across a thermoelectic element (as is usual), you measure the difference between the potentials generated at your measurement site and at another element of known temperature (ice/water mix, boiling liquid nitrogen etc).
Posts: 100
Joined: Thu Aug 02, 2012 8:09 pm
by yoctopuce » Tue Oct 02, 2012 7:56 am
We just completed a similar project with a temperature sensor connected to the Pi, in Python (see http://www.yoctopuce.com/EN/article/cook-and-hold-with-raspberry-pi-video).
We have used a thermocouple, but the same API can be used with an ambiant temperature sensor, which precision can go down to 0.3deg precision (0.1deg sensibility).
We produce USB controllers, USB sensors as well as embedded USB hubs for DIY projects
User avatar
Posts: 19
Joined: Sat Mar 03, 2012 11:27 pm