Environment & Temperature

Sensirion SGP40 in the datasheet corpus

Indoor air quality MOx VOC gas sensor with humidity-compensated raw signal and CRC-8.

standing: provisionalI2C0x59 (fixed, 16-bit commands + 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 referenceSensirion embedded-i2c-sgp40
Evidence standingprovisional (register and bus behavior derived from vendor datasheet or driver oracle; not yet hardware-unit verified on two physical samples).
Published recordGenerate or inspect locally via ct twin generate (see /docs/twin-generation).

Key registers & reset values

Address / FieldRegisterReset / ExpectedPurpose
0x260Fmeasure_raw_signal3-byte replyAccepts 6-byte RH/T compensation args, returns raw VOC + CRC-8
0x280Eexecute_self_test0xD400 + CRCBuilt-in hotplate self-test (0xD400 pass)
0x3682get_serial_number9-byte frame48-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.yaml

Fault-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

Compatible board twins

More in Environment & Temperature