SENSIRION SHT4x is a 4th generation, high-accuracy, ultra-low-power, Relative Humidity and Temperature digital sensor platform for measuring relative humidity and temperature at different accuracy classes. Its utilized using I2C interface that provides several pre-configured I2C addresses and maintains an ultra-low power budget. The power-trimmed internal heater can be used at three heating levels thus enabling sensor operation in demanding environments. The SHT4X is suitable for automation, wearable devices, indoor monitoring, and lab equipment devices. for more reading please refer to the datasheet located below.
Requirements and Alternatives
- Arduino IDE | PlatformIO
- Test Boards :
- Note: The Diagram below is using ATMEGA328TQFP / ATMEGA4809. (please refer to each MCU’s respective pin-outs & bus configuration)
- Resistors (See below diagram for required values)
- Capacitor(See below diagram for required values)
Wiring Guide
The below diagram is the typical application configuration for SHT4X, after reaching the minimal voltage supply and allowing for the maximal power-up time of 1 millisecond the sensor is initialized and ready to read the data out from the i2C communication protocol.
Test Source Code
The test code below will initialize the digital signal and translate into relative humidity and temperature readings.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
#include <Wire.h> #include "SHTSensor.h" //Library library can be downloaded below SHTSensor sht; // use a specific sensor instead of probing the bus use this command > SHTSensor sht(SHTSensor::SHT3X); void setup() { // put your setup code here, to run once: Wire.begin(); Serial.begin(9600); delay(1000); // let serial console settle if (sht.init()) { Serial.print("14CORE - TEST CODE FOR SHT4X") delay(2000); Serial.print("Reading - init() : success\n"); } else { Serial.print("Reading - init(): failed\n"); } sht.setAccuracy(SHTSensor::SHT_ACCURACY_MEDIUM); // only supported by SHT3x } void loop() { // put your main code here, to run repeatedly: if (sht.readSample()) { Serial.print("SHT:\n"); Serial.print(" RH: "); Serial.print(sht.getHumidity(), 2); Serial.print("\n"); Serial.print(" T: "); Serial.print(sht.getTemperature(), 2); Serial.print("\n"); } else { Serial.print("Error in read sample()\n"); } delay(1000); } |