driver for SI1132 UV/IR/Visible light sensors

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
greentree
Posts: 15
Joined: Wed Dec 16, 2015 3:16 am

driver for SI1132 UV/IR/Visible light sensors

Post by greentree » Mon Dec 20, 2021 9:29 pm

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.

Post Reply