Environment & Temperature
Sensirion SCD40 in the datasheet corpus
Photoacoustic NDIR true CO2 (400-2000 ppm), temperature and humidity sensor over I2C.
VendorSensirionEnvironment & Temperature
InterfaceI2C0x62 (fixed, 16-bit commands + CRC-8)
Record StatusCatalog profileDatasheet / behavioral twin
Driver oracle & capability record
Indexed in the CircuitTwin datasheet corpus (SCD40/SCD41); enforces 5-second measurement cadence and CRC-8 word checks.
| Driver reference | Sensirion embedded-i2c-scd4x |
|---|---|
| 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 |
|---|---|---|---|
0x21B1 | start_periodic_measurement | Command | Starts 5-second CO2, temp and RH sampling |
0xEC05 | read_measurement | 9-byte frame | CO2 ppm + CRC, Temp + CRC, RH + CRC |
0xE4B8 | get_data_ready_status | 3-byte frame | Lower 11 bits non-zero when fresh sample is ready |
0x3682 | get_serial_number | 9-byte frame | 48-bit factory serial number with CRC-8 |
Attach with ct CLI
Shell - run firmware with SCD40
# Run compiled firmware with SCD40 attached on esp32s3-devkitc
ct run --json --board esp32s3-devkitc --device scd40 build/app.elf
# Run fault-injection suite and emit JUnit XML
ct test run --json --junit results/scd40.xml tests/scd40-fault.suite.yamlFault-injection test snippet (suite.yaml)
tests/scd40-fault.suite.yaml
version: 1
board: esp32s3-devkitc
firmware: build/app.elf
tests:
- name: scd40-i2c-nack-recovery
faults:
- at_ms: 30
bus: I2C1
kind: nack
address: 0x62
count: 2
- at_ms: 140
part: scd40
kind: frozen_reading
expect:
console_contains: "DRIVER_FAULT_HANDLED"
exit_code: 0