MicroPython Person Sensor

A MicroPython I²C driver for the Useful Sensors Person Sensor (opens in a new tab). This is a port of Guy Dupont's CircuitPython driver (opens in a new tab), distributed under the MIT license (opens in a new tab).

Installation

mpremote mip install github:mattytrentini/micropython-person-sensor

On a network-connected MicroPython board:

import mip
mip.install("github:mattytrentini/micropython-person-sensor")

The driver uses MicroPython's I²C API and has no external dependencies.

Usage

Use an I²C bus configured for your board's SDA and SCL pins. The sensor's default address is 0x62.

from machine import I2C, Pin
from person_sensor import PersonSensor

i2c = I2C(0, sda=Pin(4), scl=Pin(5), freq=100_000)  # Example pins; adapt to your board.
sensor = PersonSensor(i2c)
for face in sensor.get_faces():
    print(face)