Here's how to connect a MCP9804.
You can use it like this:
Converting 0x67c1 to a temperature is a little convoluted. The MSB is 0xc1 and the LSB is 0x67
The first 4 bits of the MSB are dropped and which leaves the temperature in 16ths of a degree
You may use the Raspberry Pi built in serial port, and connect it to a digital thermometer IC (e.g. DS1620)
You can find out serial port interfacing of Raspberry Pi here
Important: Remember the RPi UART runs at TTL 3.3V - Be careful not to use High Voltage 5v/12volt Uart direct to the RPi. It will cause damage!
I've tried two approaches to temperature sensing. For I2C, I used a TMP102 module which is similar to what gnibbler describes. Here's my post on that:
For 1-wire, Adafruit recently released there own image, and it contains 1-wire support. I was able to read a DS18B20 1-wire temp sensor with it. More details in this post:
Finally, another approach is to use analog temp sensor and an external ADC. Adafruit has a nice tutorial on this.
A simple, cheap USB "HID TEMPer" thermometer also works, and is much easier to connect for those who are yet to fiddle with UARTs or GPIO, like me.
My RPi provides enough power to drive it directly from the USB port without a hub.
To set this up with Raspbian Wheezy, I followed these instructions which were written for Ubuntu (disclaimer: link is for a post on my own blog). For the Raspberry Pi, I only had to make one small tweak to set
To get a simple reading without any of the munin stuff, install the dependencies as follows (as root):
And run that as root to see the output. In my case, it's a little chilly in the garage this evening:
The One I'm currently using is the DS18B20: http://www.adafruit.com/product/381
First open the Pi and type:
Then add the word "untested" after "main". Then type:
In my case it took a long time, though it depends on your wifi/ethernet speed. After that, you Reboot!
Connect the white wire to GPIO4, The red wire to 3V3, and the black to GND. You also connect a 4.7K resistor between the white and red wires.
You can read it by doing the following commands:
Then is should list the serial number of the temperature sensor, followed by
And then it should show 2 lines of code, where the 5 digits at the end of the second line are the temperature.
This utilizes something called the "Dallas One-Wire Temperature Sensor Protocol", or something.
I'm currently reading this book and like it. Going that route my vision is that you'd have a temperature sensor, an arduino, and an xbee radio glued together. That's your remote sensor which could be anywhere as long as it's in range of the home station. Then for the home station have a rasberry and another xbee. I'm guessing that it might be easier to also have the home station xbee on an arduino, and then have the arduino and rasberry talk to each other. With that you could have multiple remote sensors, and different types of sensors.