📒 Datasheet PDF
1.
🔽 Get Arduino
Install the Arduino IDE
2.
📦 Install the library
Start the Arduino IDE, press the Sketch menu, and then Include Library > Manage Libraries
- Search for
Microfire
and install the library calledMicrofire SHT3x
3.
🔌 Connections
- Make the I2C connections:
- SHT3x SDA to controller SDA
- SHT3x SCL to controller SCL
- SHT3x GND to controller ground
- SHT3x VCC to controller 3.3 or 5-volt
🔰 Write some code
Below is the Basic example. It can be found in File > Examples > Microfire_SHT3x > Basic
in the Arduino IDE.
// include the header file
#include <Microfire_SHT3x.h>
Microfire::SHT3x sht30;
void setup()
{
// start Serial and I2C
Serial.begin(9600);
Wire.begin();
// start the sensor
sht30.begin();
}
void loop()
{
// take a measurement
sht30.measure();
// display the results
switch (sht30.status)
{
case sht30.STATUS_NOT_CONNECTED:
Serial.println("Error: Sensor not connected");
break;
case sht30.STATUS_CRC_ERROR:
Serial.println("Error: CRC error");
break;
case sht30.STATUS_NO_ERROR:
Serial.println((String)sht30.tempC + " °C");
Serial.println((String)sht30.tempF + " °F");
Serial.println((String)sht30.RH + " %RH");
Serial.println((String)sht30.vpd_kPa + " VPD kPa");
Serial.println((String)sht30.dew_pointC + " dew point °C");
Serial.println((String)sht30.dew_pointF + " dew point °F");
break;
}
delay(1000);
}
5.
➡️ Upload the code
- Tell the Arduino IDE what board you are using. Press
Tools > Board
and find yours in the menu - Press the upload button
6.
🔎 View the output
- Open the Serial Monitor by pressing
Tools > Serial Monitor
- The measurements should be displayed in the monitor, with updates every second