Introduction

Documentation Status Discord Build Status

CircuitPython driver for the TMP006 contactless IR thermometer.

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Installing from PyPI

On supported GNU/Linux systems like the Raspberry Pi, you can install the driver locally from PyPI. To install for current user:

pip3 install adafruit-circuitpython-tmp006

To install system-wide (this may be required in some cases):

sudo pip3 install adafruit-circuitpython-tmp006

To install in a virtual environment in your current project:

mkdir project-name && cd project-name
python3 -m venv .env
source .env/bin/activate
pip3 install adafruit-circuitpython-tmp006

Usage Example

Ensure your device works with the simple test in the examples folder.

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

For information on building library documentation, please check out this guide.

Table of Contents

Simple test

Ensure your device works with this simple test.

examples/tmp006_simpletest.py
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
import time
import board
import busio
import adafruit_tmp006

# Define a function to convert celsius to fahrenheit.
def c_to_f(c):
    return c * 9.0 / 5.0 + 32.0


# Create library object using our Bus I2C port
i2c = busio.I2C(board.SCL, board.SDA)
sensor = adafruit_tmp006.TMP006(i2c)

# Initialize communication with the sensor, using the default 16 samples per conversion.
# This is the best accuracy but a little slower at reacting to changes.
# The first sample will be meaningless
while True:
    obj_temp = sensor.temperature
    print(
        "Object temperature: {0:0.3F}*C / {1:0.3F}*F".format(obj_temp, c_to_f(obj_temp))
    )
    time.sleep(5.0)

adafruit_tmp006

CircuitPython driver for the TMP006 contactless IR thermometer.

  • Author(s): Carter Nelson

Implementation Notes

Hardware:

Software and Dependencies:

class adafruit_tmp006.TMP006(i2c, address=64, samplerate=2048)

Class to represent an Adafruit TMP006 non-contact temperature measurement board.

active

True if sensor is active.

read_register(register)

Read sensor Register.

temperature

Read object temperature from TMP006 sensor.

Indices and tables