Page 1 of 1

driver for SI1132 UV/IR/Visible light sensors

Posted: Mon Dec 20, 2021 9:29 pm
by greentree
A driver for SI1132 sensors, minimally modified from https://github.com/ControlEverythingCommunity/SI1132 to work in micropython on an ESP8266.

It uses SMBus emulation from https://github.com/gkluoe/micropython-smbus.

Example:

Code: Select all

from machine import Pin
from usmbus import SMBus
from si1132 import SI1132 
bus = SMBus(scl=Pin(5, Pin.IN),sda=Pin(4, Pin.IN))
sensor = SI1132(smbus=bus)
sensor.read()
Output:

Code: Select all

si1132 uv, ir, visible = 2, 254, 261 lux
(2, 254, 261)
Tested on an ESP8266 running v1.17 using an Hardkernel Weatherboard 0.2, https://www.hardkernel.com/shop/weather-board-2/, but should work on other platforms and versions.