|
In my previous post, I showed how to add a real-time clock (RTC) to Raspberry Pi via the I2C bus. Another device that is simple to interface with the Raspberry Pi via the I2C bus is the TMP102 temperature sensor. Technically, its datasheet states "Two-Wire Interface", but TWI can be treated as synonymous with I2C in this context. For convenience, I bought SparkFun's TMP102 breakout board:
Unlike with the DS1307 RTC in my previous post, this device can run at 3.3V so no logic level converter is needed. I was able to add the TMP102 to my existing broadboard configuration with the RTC. I simply added to the SDA and SCL lines on the 3.3V side of the logic level converter that is used for the DS1307 RTC:
(From Left to Right: Adafruit 4-channel I2C-safe logic level converter, Adafruit DS1307 RTC board, TMP102 temperature senor, SparkFun logic level converter board [connected to FTDI cable for serial console])
(same order as captioned above)
As I described in the RTC post, I am using Chris Boot's Wheezy image which features the Linux 3.2 kernel and a proper I2C driver (UPDATE: Adafruit's Occidentalis v0.2 now supports the tmp102, too). Chris demonstrates in his I2C and the Raspberry Pi post how to setup and read from the temperature sensor:
# echo tmp102 0x48 > /sys/class/i2c-adapter/i2c-0/new_device
# sensors
tmp102-i2c-0-48
Adapter: bcm2708_i2c.0
temp1: +21.6°C (high = +160.0°C, hyst = +150.0°C)
Screenshot of sensors on the Pi:
And finally I decided to replace the jumper wires connecting the breadboard and the Pi with the Adafruit Pi Cobbler:
Cheers,
Drew
Product Name* | Description | Supplier | ||
Raspberry Pi Model B | Raspberry Pi model B | Raspberry Pi |
| |
Optical mouse | Basic USB optical mouse | IONE / Pro Signal |
| |
Raspberry Pi power supply | 120-240v to 5V power supply with micro USB connector | Raspberry Pi |
| |
Keyboard | Basic USB keyboard | Gear Head / A4 Tech |
| |
Pre-programmed 4GB SD card | 4GB Class 4 SD card preloaded with Debian 6 Linux | Samsung |
| |
Adafruit Pi Cobbler | GPIO breakout kit for Raspberry Pi | Adafruit Industries |
| |
Breadboard | Basic breadboard with 830 connection points | Twin Industries |
| |
Jumper wire bundle | Jumper wires for use on breadboard | Bud Industries |
| |
TI TMP102 breakout | TI TMP102 I2C temperature sensor on breakout board | TI / Sparkfun electronics |
*Products and resources listed are listed to help members build their own Pi Projects. They are suggestions and listed for educational purposes. For substitutions of any parts, please post a question asking the original author.
Top Comments