How do I load the SHT3X driver in OpenBeken?
StartDriver SHT3X in the console. The firmware initializes I²C, schedules a reading every 10 s, and exposes sensor channels [Elektroda, dheenhasty, post #20444655]Czy wolisz polską wersję strony elektroda?
Nie, dziękuję Przekieruj mnie tamQuote:StartDriver SHT3X
Quote:
echo "PowerSaving mode"
PowerSave
echo "activate startDriver sht3x"
startDriver SHT3X
echo "Clearing Status as after reboot alert trigger is passed to 1"
SHT_ClearStatus
echo "Setting Alert parameter"
SHT_SetAlert 22 16 20 90
delay_s 1
echo "activate periodical measurement"
SHT_LaunchPer 0x23 0x22
delay_s 1
SHT_MeasurePer
echo "keep up for 2 min"
delay_s 120
echo "DeepSleep with pin detection"
PinDeepSleep
TL;DR: SHT3X delivers ±0.3 °C temp accuracy and ±2 %RH humidity [Sensirion, 2022]; “PinDeepSleep works with buttons” [Elektroda, p.kaczmarek2, post #20445195] Use StartDriver SHT3X, choose single-shot or 4 mps periodical mode, set alerts, then PinDeepSleep. Failure to clear status may keep alert pin high.
Why it matters: Mastering these commands slashes standby draw and extends battery life.
• Default driver cycle: 10 s between measurements [Elektroda, dheenhasty, post #20444655] • Periodical command 0x23 0x22 = 4 measurements/s at medium repeatability [Elektroda, dheenhasty, post #20444655] • Alert hysteresis: +0.5 °C / +2 %RH between set and clear thresholds [Elektroda, dheenhasty, post #20444655] • Sensor accuracy: ±0.3 °C, ±2 %RH (typ.) [Sensirion, 2022] • Sleep current: ≤0.2 µA at 25 °C [Sensirion, 2022]
StartDriver SHT3X in the console. The firmware initializes I²C, schedules a reading every 10 s, and exposes sensor channels [Elektroda, dheenhasty, post #20444655]SHT_Measure triggers one high-accuracy reading and updates channels. SHT_LaunchPer <msb> <lsb> tells the sensor to self-measure up to 10 Hz; the host then reads with SHT_MeasurePer [Elektroda, dheenhasty, post #20444655]SHT_cycle <seconds>. Values under 2 s raise bus traffic and power use; 60 s cuts average current below 5 µA [Sensirion, 2022].SHT_Calibrate <tempOffset> <humOffset>, e.g., SHT_Calibrate -0.5 10. Offsets subtract or add before the reading posts to channels, compensating for board heat sources [Elektroda, dheenhasty, post #20444655]SHT_SetAlert <T_high> <T_low> <RH_high> <RH_low>. The chip auto-adds 0.5 °C and 2 %RH hysteresis so the clear point differs from the set point [Elektroda, dheenhasty, post #20444655]SHT_Heater 1 to energize the heater, which draws ~30 mA and can skew readings by +1 °C after 1 min [Sensirion, 2022]. Disable with SHT_Heater 0.StartDriver SHT3XSHT_LaunchPer 0x23 0x22PinDeepSleep
This script sleeps until an alert or button interrupt, cutting average consumption below 50 µA on two AA cells [Elektroda, dheenhasty, post #20444655]SHT_StopPer is omitted before deep sleep; power-cycling or toggling the driver clears the fault [Elektroda, dheenhasty, post #20444655]SHT_Measure on press. The CBU generic board example uses this method for on-demand readings [Elektroda, dheenhasty, post #20445204]
Comments
Very nice guide. It is also worth noting that "PinDeepSleep" will also work with simpler functional IOs, such as buttons. PinDeepSleep can be used without SHT sensor as well. [Read more]
Exactly, In case of the CBU generic temperature and humidity sensor you can use the same script to permit a manual measurement by pressing the button. [Read more]