Measuring temperature and humidity with a digital sensor

The upm library includes support for the digital temperature and humidity breakout board that uses the TH02 sensor in the pyupm_th02 module. The TH02 class declared in this module represents a digital temperature and humidity sensor that uses the TH02 sensor, connected to our board. The class makes it easy to initialize the sensor and retrieve the temperature and humidity values through the I2C bus. The class works with the mraa.I2c class under the hoods to talk with the sensor, that is, to write data to and read data from the TH02 sensor that acts as a slave device connected to the I2C bus.

We will create a new TemperatureAndHumiditySensor class to represent the temperature and humidity ...

Get Internet of Things with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.