Stemma
Adafruit STEMMA capacitive soil moisture sensor implementation.
Reads soil moisture via an Adafruit Seesaw-based STEMMA sensor connected through a TCA9548A I2C multiplexer. Multiple STEMMA sensors can share the same I2C bus by using different multiplexer ports.
MultiplexedStemma
¶
Bases: Sensor, I2CInterface
Capacitive soil moisture sensor accessed via I2C multiplexer.
Connects to an Adafruit STEMMA soil moisture sensor through a TCA9548A multiplexer, allowing multiple identical sensors on one bus.
Config kwargs
multiplexer_address: I2C address of the TCA9548A (e.g. 0x70). multiplexer_port: Port number on the multiplexer (0-7). address: I2C address of the STEMMA sensor (e.g. 0x36). tbr: Time between reads in seconds.
Attributes:
| Name | Type | Description |
|---|---|---|
wrapped_sensor |
The Seesaw driver instance. |
|
time_between_reads |
Interval between measurements (seconds). |
|
confidence |
Fixed confidence specification for readings. |
Source code in pt/controller_3/src/plant_controller/sensors/stemma.py
read()
async
¶
Read moisture level and save as a percentage Measurement.
Source code in pt/controller_3/src/plant_controller/sensors/stemma.py
process_raw_value(raw_value)
¶
Convert raw sensor ADC value to a percentage.
Currently uses a simple linear mapping. Should be replaced with a calibrated transform for accurate volumetric water content.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
raw_value
|
Raw 10-bit ADC value from the sensor (0-1023). |
required |
Returns:
| Type | Description |
|---|---|
|
Moisture as a percentage (0-100). |
Source code in pt/controller_3/src/plant_controller/sensors/stemma.py
get_capabilities()
¶
Return capabilities for the moisture parameter.
Returns:
| Type | Description |
|---|---|
|
Dict with a single entry keyed by |