Environment & Temperature
Sensirion SGP40 in the datasheet corpus
Indoor air quality MOx VOC gas sensor with humidity-compensated raw signal and CRC-8.
VendorSensirionEnvironment & Temperature
InterfaceI2C0x59 (fixed, 16-bit commands + CRC-8)
Record StatusCatalog profileDatasheet / behavioral twin
Driver oracle & capability record
Indexed in the CircuitTwin datasheet corpus (environmental class) for VOC algorithm and CRC error-path testing.
| Driver reference | Sensirion embedded-i2c-sgp40 |
|---|---|
| Evidence standing | provisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples). |
| Published record | Generate or inspect locally via ct twin generate (see /docs/twin-generation). |
Key registers & reset values
| Address / Field | Register | Reset / Expected | Purpose |
|---|---|---|---|
0x260F | measure_raw_signal | 3-byte reply | Accepts 6-byte RH/T compensation args, returns raw VOC + CRC-8 |
0x280E | execute_self_test | 0xD400 + CRC | Built-in hotplate self-test (0xD400 pass) |
0x3682 | get_serial_number | 9-byte frame | 48-bit chip serial number with CRC-8 |
Attach with ct CLI
Shell - run firmware with SGP40
# Run compiled firmware with SGP40 attached on esp32c3-devkitm
ct run --json --board esp32c3-devkitm --device sgp40 build/app.elf
# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/sgp40.xml tests/sgp40-fault.suite.yamlFault-injection test snippet (suite.yaml)
tests/sgp40-fault.suite.yaml
version: 1
board: esp32c3-devkitm
firmware: build/app.elf
tests:
- name: sgp40-i2c-nack-recovery
faults:
- at_ms: 30
bus: I2C1
kind: nack
address: 0x59
count: 2
- at_ms: 140
part: sgp40
kind: frozen_reading
expect:
console_contains: "DRIVER_FAULT_HANDLED"
exit_code: 0