MicroPython HS3003 Driver

hs3003

MicroPython Driver for the Renesas HS3003 Temperature and Humidity Sensor

  • Author(s): Jose D. Montoya

class micropython_hs3003.hs3003.HS3003(i2c, address: int = 0x44)[source]

Driver for the HS3003 Sensor connected over I2C. Resolution can be configured, however this is not implemented in this library, as is required to send commands after power up, to put the sensor in programming mode

Parameters:
i2c : I2C

The I2C bus the HS3003 is connected to.

address : int

The I2C device address. Defaults to 0x44

Quickstart: Importing and using the device

Here is an example of using the HS3003 class. First you will need to import the libraries to use the sensor

from machine import Pin, I2C
from micropython_hs3003 import hs3003

Once this is done you can define your machine.I2C object and define your sensor object

i2c = I2C(1, sda=Pin(2), scl=Pin(3))
hs = hs3003.HS3003(i2c)

Now you have access to the attributes

temp = hs.temperature
humidity = hs.relative_humidity
property measurements : tuple[float, float]

Return Temperature and Relative Humidity

property relative_humidity : float

The current relative humidity in % rH

property temperature : float

The current temperature in Celsius