Skip to main content

MicroPython + Raspberry Pi driver for the ProtoCentral tinyGSR galvanic-skin-response breakout (TLA2022-based)

Project description

ProtoCentral tinyGSR — MicroPython + Raspberry Pi

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.

Install

mpremote mip install github:Protocentral/protocentral-micropython-tinygsr

This 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 0x49

Quick start

from 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 signal

Raspberry 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())

API

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

A note on units

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.

Tests

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

protocentral_tinygsr-1.0.0.tar.gz (5.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

protocentral_tinygsr-1.0.0-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file protocentral_tinygsr-1.0.0.tar.gz.

File metadata

  • Download URL: protocentral_tinygsr-1.0.0.tar.gz
  • Upload date:
  • Size: 5.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for protocentral_tinygsr-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d910825823d078750b2d5a19f5d01101dc47aeb0915f7325bbe0a63676910b4c
MD5 cbd62cd4a1a071e365ca43503011b554
BLAKE2b-256 67382687622dc29c484dd342b3ecb7fe77dbc83fa908aa8d74a2f48d4c72b50f

See more details on using hashes here.

Provenance

The following attestation bundles were made for protocentral_tinygsr-1.0.0.tar.gz:

Publisher: publish.yml on Protocentral/protocentral-micropython-tinygsr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file protocentral_tinygsr-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for protocentral_tinygsr-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 229bb7be209ac2017636d4704696784e3413cce43b251fcaf0c1ff4740ce19c3
MD5 5725326597890ddfeee6b5b93be79576
BLAKE2b-256 73575912eb990b1ca1c2a385526180939886e7a00742acc49c94315843bf75b9

See more details on using hashes here.

Provenance

The following attestation bundles were made for protocentral_tinygsr-1.0.0-py3-none-any.whl:

Publisher: publish.yml on Protocentral/protocentral-micropython-tinygsr

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page