TMP006 Temperature Sensor Python Library using Raspberry pi,

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!

TMP006 Temperature Sensor Python Library

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:

  1. sudo aptget update
  2. sudo aptget install buildessential pythondev pythonpip pythonsmbus git

You can ignore warnings about dependencies which are already installed.

TMP006 Temperature Sensor Python Library

Raspberry Pi

On a Raspberry Pi execute the following to make sure the RPi.GPIO library is installed:

 sudo pip install RPi.GPIO

BeagleBone Black

On a BeagleBone Black execute the following to make sure the Adafruit_BBIO library is installed:

 sudo pip install Adafruit_BBIO

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


About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:
LinkedinTwitter

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top