Skip to content

Add SHT21 sensor support#9582

Open
Tomas-Kuchta-FPV wants to merge 4 commits intomeshtastic:developfrom
Tomas-Kuchta-FPV:feat/SHT21
Open

Add SHT21 sensor support#9582
Tomas-Kuchta-FPV wants to merge 4 commits intomeshtastic:developfrom
Tomas-Kuchta-FPV:feat/SHT21

Conversation

@Tomas-Kuchta-FPV
Copy link

Description

This PR adds support for the SHT21 humidity and temperature sensor to Meshtastic. The SHT21 is a low-cost, low-power environmental sensor that complements the existing SHT3x support.

Changes

  • Added SHT21 sensor driver implementation
  • Added telemetry configuration for SHT21 sensor readings
  • Integrated sensor with the telemetry module
  • Generated corresponding protobuf definitions

Sensor Details

  • I2C Address: 0x40 (same as INA_ADDR)
  • Control: Enabled via -D HAS_SHT21=1 compile flag
  • Use Case: Environmental monitoring (temperature/humidity)

Testing

  • ✅ Tested on DIY_V1 (ESP32)
  • ✅ Sensor reads temperature and humidity correctly
  • ✅ No regressions on test device

Notes

The SHT21 shares the I2C address (0x40) with the INA power monitoring chip. Current implementation uses a compile-time flag to select which sensor is used. Future improvements could include runtime detection/probing if both sensors need to be supported simultaneously.

Related: meshtastic/protobufs#855

@github-actions github-actions bot added the hardware-support Hardware related: new devices or modules, problems specific to hardware label Feb 9, 2026

break;

#if HAS_SHT21
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a register you can look up on the SHT21 that is unique to that model, or at least able to distinguish it from the other chips that share the address? That way we could detect it and use it without a firmware rebuild.

@NomDeTom
Copy link
Contributor

Looking at the datasheets, maybe the INA219 calibration register (05h) being all zero at reset would be enough?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

hardware-support Hardware related: new devices or modules, problems specific to hardware

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants