Are you looking for an easy way to measure the temperature of something without having to attach a sensor directly to it? Consider using a non-contact temperature sensor like the TMP006! This sensor reads the infra-red radiation, or heat, emitted from an object and can be easily read over an I2C connection. With the TMP006 Python library you can now use the TMP006 non-contact temperature sensor with your Raspberry Pi or BeagleBone Black project!
Before you get started make sure your Raspberry Pi is running the latest Raspbian or Occidentalis operating system, and your BeagleBone Black is running the latest official Debian operating system. It will also help to familiarize yourself with the TMP006 sensor by reading its Arduino guide.
Hardware
Wiring the TMP006 to a Raspberry Pi or BeagleBone Black is easy because the board only uses an I2C bus for communication.
Raspberry Pi
Connect the TMP006 to a Raspberry Pi as follows. Note that you must have I2C enabled on your Raspberry Pi.
- Connect Pi 3.3V power to TMP006 VCC.
- Connect Pi GND to TMP006 GND.
- Connect Pi SDA to TMP006 SDA.
- Connect Pi SCL to TMP006 SCL.
BeagleBone Black
Connect the TMP006 to a BeagleBone Black as follows. If you aren’t familiar with how GPIO pins are numbered, check out this guide on BeagleBone Black GPIO.
- Connect BeagleBone Black P9_1 DGND to TMP006 GND.
- Connect BeagleBone Black P9_3 3.3V power to TMP006 VCC.
- Connect BeagleBone Black P9_19 SCL to TMP006 SCL.
- Connect BeagleBone Black P9_20 SDA to TMP006 SDA.
Software
To install and use the TMP006 Python library follow the steps below.
Before you get started make sure your board is connected to the internet through an ethernet or wireless connection so you can download dependencies.
You’ll also want to be familiar with connecting to a Raspberry Pi or BeagleBone Black terminal with SSH.
Dependencies
First install dependencies by executing in a terminal:
- sudo apt–get update
- sudo apt–get install build–essential python–dev python–pip python–smbus git
You can ignore warnings about dependencies which are already installed.
Raspberry Pi
On a Raspberry Pi execute the following to make sure the RPi.GPIO library is installed:
BeagleBone Black
On a BeagleBone Black execute the following to make sure the Adafruit_BBIO library is installed:
Library Install
Next download the TMP006 Python library to your home directory and install it by executing:
For more detail: TMP006 Temperature Sensor Python Library