MicroPython driver for the ProtoCentral tinyGSR breakout — a galvanic-skin-response (electrodermal activity) sensor. The tinyGSR's analog front-end turns skin conductance into a voltage that is digitised by an on-board TI TLA2022 ADC, so this library builds on the TLA20xx driver and adds only the tinyGSR configuration and smoothing.
Ported from, and faithful to, the ProtoCentral tinyGSR Arduino firmware (firmware/tinygsr/tinygsr.ino). MIT licensed.
mpremote mip install github:Protocentral/protocentral-micropython-tinygsrThis also installs the protocentral-tla20xx dependency. Raspberry Pi:
sudo raspi-config # enable I2C
pip install protocentral-tinygsr # pulls protocentral-tla20xx + smbus2
i2cdetect -y 1 # should show 0x49from machine import Pin, I2C
from protocentral_tinygsr import TinyGSR
i2c = I2C(0, scl=Pin(6), sda=Pin(5), freq=400000) # QT Py ESP32-C3: SCL=6, SDA=5
gsr = TinyGSR(i2c, address=0x49) # TLA2022 address is selectable on the breakout
gsr.begin() # TLA2022: continuous, 128 SPS, ±0.512 V (as the firmware)
print(gsr.read_filtered()) # 8-tap FIR-smoothed GSR signalRaspberry Pi — reuses the TLA20xx shim (no separate shim):
from protocentral_tla20xx_linux import I2C
from protocentral_tinygsr import TinyGSR
gsr = TinyGSR(I2C(bus=1), address=0x49); gsr.begin()
print(gsr.read_filtered())| Method | Purpose |
|---|---|
TinyGSR(i2c, address=0x49) |
construct (creates an internal TLA20XX) |
begin() |
configure the TLA2022 like the firmware (continuous / 128 SPS / ±0.512 V) |
read() |
instantaneous GSR signal, mV |
read_filtered() |
8-tap FIR-smoothed signal (matches the firmware's streamed value) |
.adc |
the underlying TLA20XX for advanced use |
The ProtoCentral firmware streams the filtered ADC value (a proxy for skin conductance via the front-end) to OpenView — it does not compute absolute microsiemens, and neither does this library. Converting to absolute µS would require the front-end transfer function from the tinyGSR schematic; that's left as a documented TODO rather than guessed, to keep the library faithful to the source.
python3 tests/test_tinygsr.py — mocked-bus tests (firmware-matching config, mV scaling, 8-tap FIR). Needs the sibling protocentral-tla20xx repo on the path.
Reconciled against the tinyGSR firmware: TLA2022 @
0x49,OP_CONTINUOUS/DR_128SPS/FSR_0_512V, default mux, 8-tap unity-coefficient FIR.