Skip to content

TOIT driver for SI7006, SI7013, Si7020, Si7021 and HTU21D i2c Temperature and Humidity

License

Notifications You must be signed in to change notification settings

xal88/TOIT_si70xx

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SI70xx

A low level TOIT driver for the Silabs Si70xx/HTU21D sensor family.

[ derived and based on the work from https://github.com/toitware/toit-si7006/ ]

These sensors are combined temperature and humidity sensors with different accuracy.

SI7006 addr: 0x40, device_id 0x06
SI7013 addr: 0x41, device_id 0x0D
SI7020 addr: 0x40, device_id 0x14
SI7021 addr: 0x40, device_id 0x15
HTU21D is the same as SI7021

Documentation is available at

Usage

A simple usage example.

import gpio
import serial.protocols.i2c as i2c
import si70xx show *
import math

main:
  sda := gpio.Pin 21
  scl := gpio.Pin 22
  bus := i2c.Bus --sda=sda --scl=scl --frequency=100_000
  i2c_device := bus.device Si70xx.I2C_ADDRESS
  sensor := Si70xx i2c_device

  print "Device Type: $sensor.device_type"
  print "Firmware: $sensor.firmware"
  print "SerialNr#: $sensor.serial_number"

  print "Temperature: $(%0.1f sensor.temperature)C"
  print "Humidity: $(sensor.humidity.round)%"

Features and bugs

Please file feature requests and bugs at the [issue tracker][tracker].

About

TOIT driver for SI7006, SI7013, Si7020, Si7021 and HTU21D i2c Temperature and Humidity

Topics

Resources

License

Stars

Watchers

Forks