Dual SHT41 Temperature & Humidity Monitor With Raspberry Pi Pico | Temp-Hume Display | SHT41 | Sensirion | Raspberry Pi Pico | Industrial Grade Sensor

by akashwave rf in Circuits > Raspberry Pi

40 Views, 0 Favorites, 0 Comments

Dual SHT41 Temperature & Humidity Monitor With Raspberry Pi Pico | Temp-Hume Display | SHT41 | Sensirion | Raspberry Pi Pico | Industrial Grade Sensor

20260820_151436.jpg
20260819_150811.jpg
DHT22 Is Just a kids' Toy🤣 I Tested It Against the SHT41 | Get started with Industrial-Grade Sensors

In this tutorial, I’ll show you how to build a dual-sensor temperature, humidity, and heat index monitoring system using two industrial-grade SHT41 temperature and humidity sensors, a Raspberry Pi Pico, and a generic 128×64 I²C OLED display.

I’ll also provide the Arduino code and circuit diagram used in this project.

I also made a detailed YouTube video documenting the entire experiment, including a practical comparison between the SHT41 and DHT22. I shared my real-world experience and demonstrated the difference between a basic “toy” sensor and an industrial-grade sensor.

If you're interested, you can watch the full video here- https://youtu.be/gvT-3zCykAo

Supplies

20260818_155633.jpg
20260818_164950.jpg
  1. SHT41 one or two
  2. Raspberry Pi Pico
  3. Male to Male Jumper Cable
  4. 128*64 OLED Display
  5. Breadboard
  6. USB Cable

SHT41 Vs. DHT22

20260819_132359 dht22.jpg
20260819_180915.jpg

I have also made a detailed video comparing the SHT41 with the very popular and inexpensive DHT22 sensor.

In that test, I used two DHT22 sensors and two SHT41 sensors at the same time. The data from the two DHT22 sensors showed noticeable differences, while the factory-calibrated SHT41 sensors produced very similar readings — and sometimes exactly the same readings.

If you’re interested, I’ve included the YouTube video link here- https://youtu.be/gvT-3zCykAo

I hope you enjoy the comparison!

Circuit Diagram

Screenshot 2026-08-22 012753.png

As you can see in the schematic, I have used two SHT41 sensors.

However, you can also use this project with only one SHT41 sensor. If one sensor is not connected, the display will simply show "Sensor Not Found" for that sensor, while the connected sensor will continue to display its readings normally.

Why Raspberry Pi Pico?

The SHT41 does not have a pin for changing its I²C address. Since both sensors use the same I²C address, connecting them to the same I²C bus would cause an address conflict.

The Raspberry Pi Pico solves this problem because it has two separate I²C interfaces: I²C0 and I²C1. Therefore, we can connect one SHT41 sensor to each I²C bus and use both sensors independently.


I had also explained this circuit diagram completely in details on my YouTube video on this topic, if you are interest, click here to watch it- https://youtu.be/gvT-3zCykAo

Arduino Code

20260819_132359.jpg

You can simply copy and paste the provided Arduino code and upload it to your Raspberry Pi Pico.

#include <Wire.h>
#include <Adafruit_SHT4x.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

// ---------- I2C Pins ----------
#define I2C0_SDA 4
#define I2C0_SCL 5

#define I2C1_SDA 10
#define I2C1_SCL 11

// ---------- OLED ----------
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_ADDRESS 0x3C

Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1);

// ---------- Sensor Objects ----------
Adafruit_SHT4x sht1;
Adafruit_SHT4x sht2;

bool sensor1_ok = false;
bool sensor2_ok = false;

// ---------- Heat Index ----------
float computeHeatIndexC(float tempC, float humidity)
{
float tempF = tempC * 9.0 / 5.0 + 32.0;

float hiF =
-42.379 +
2.04901523 * tempF +
10.14333127 * humidity -
0.22475541 * tempF * humidity -
0.00683783 * tempF * tempF -
0.05481717 * humidity * humidity +
0.00122874 * tempF * tempF * humidity +
0.00085282 * tempF * humidity * humidity -
0.00000199 * tempF * tempF * humidity * humidity;

return (hiF - 32.0) * 5.0 / 9.0;
}

// ---------- Check Sensor Presence ----------
bool devicePresent(TwoWire &bus, uint8_t address)
{
bus.beginTransmission(address);

return (bus.endTransmission() == 0);
}

// ---------- OLED Display ----------
void updateOLED(
bool sensor1_present,
float temp1,
float hum1,
float HI1,
bool sensor2_present,
float temp2,
float hum2,
float HI2)
{
display.clearDisplay();

// ---------- SENSOR 1 ----------
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);

display.setCursor(0, 0);
display.println("SENSOR 1");

display.drawLine(0, 9, 63, 9, SSD1306_WHITE);

if (sensor1_present)
{
display.setCursor(0, 14);
display.print("T:");
display.print(temp1, 1);
display.println(" C");

display.setCursor(0, 29);
display.print("H:");
display.print(hum1, 1);
display.println(" %");

display.setCursor(0, 44);
display.print("HI:");
display.print(HI1, 1);
display.println(" C");
}
else
{
display.setCursor(5, 27);
display.println("SENSOR");

display.setCursor(4, 39);
display.println("ERROR");
}

// ---------- SENSOR 2 ----------
display.setCursor(68, 0);
display.println("SENSOR 2");

display.drawLine(64, 9, 127, 9, SSD1306_WHITE);

if (sensor2_present)
{
display.setCursor(68, 14);
display.print("T:");
display.print(temp2, 1);
display.println(" C");

display.setCursor(68, 29);
display.print("H:");
display.print(hum2, 1);
display.println(" %");

display.setCursor(68, 44);
display.print("HI:");
display.print(HI2, 1);
display.println(" C");
}
else
{
display.setCursor(73, 27);
display.println("SENSOR");

display.setCursor(72, 39);
display.println("ERROR");
}

// ---------- Divider ----------
display.drawLine(64, 0, 64, 63, SSD1306_WHITE);

display.display();
}

void setup()
{

pinMode(6, OUTPUT);
Serial.begin(115200);
delay(2000);

Serial.println();
Serial.println("========================================");
Serial.println(" Dual SHT41 Monitor - Raspberry Pi Pico ");
Serial.println("========================================");

// -------- I2C0 --------
Wire.setSDA(I2C0_SDA);
Wire.setSCL(I2C0_SCL);
Wire.begin();

// -------- I2C1 --------
Wire1.setSDA(I2C1_SDA);
Wire1.setSCL(I2C1_SCL);
Wire1.begin();

// -------- OLED --------
if (!display.begin(SSD1306_SWITCHCAPVCC, OLED_ADDRESS))
{
Serial.println("OLED NOT detected");
}
else
{
display.setRotation(0);
display.clearDisplay();
display.setTextColor(SSD1306_WHITE);
display.setTextSize(1);

display.setCursor(22, 20);
display.println("DUAL SHT41");

display.setCursor(28, 35);
display.println("MONITOR");

display.display();

delay(1000);
}

delay(200);

// -------- Sensor 1 --------
if (devicePresent(Wire, 0x44))
{
if (sht1.begin(&Wire))
{
sht1.setPrecision(SHT4X_HIGH_PRECISION);
sht1.setHeater(SHT4X_NO_HEATER);

sensor1_ok = true;
Serial.println("Sensor #1 Found on I2C0");
}
}

if (!sensor1_ok)
{
Serial.println("Sensor #1 NOT detected");
}

// -------- Sensor 2 --------
if (devicePresent(Wire1, 0x44))
{
if (sht2.begin(&Wire1))
{
sht2.setPrecision(SHT4X_HIGH_PRECISION);
sht2.setHeater(SHT4X_NO_HEATER);

sensor2_ok = true;
Serial.println("Sensor #2 Found on I2C1");
}
}

if (!sensor2_ok)
{
Serial.println("Sensor #2 NOT detected");
}
}

void loop()
{
digitalWrite(6, HIGH);
Serial.println();
Serial.println("================================");

// ---------- OLED DATA VARIABLES ----------
float temp1_display = 0;
float hum1_display = 0;
float HI1_display = 0;

float temp2_display = 0;
float hum2_display = 0;
float HI2_display = 0;

bool sensor1_present = false;
bool sensor2_present = false;

// ---------- SENSOR 1 ----------
if (devicePresent(Wire, 0x44))
{
if (!sensor1_ok)
{
if (sht1.begin(&Wire))
{
sht1.setPrecision(SHT4X_HIGH_PRECISION);
sht1.setHeater(SHT4X_NO_HEATER);
sensor1_ok = true;

Serial.println("Sensor #1 Reconnected");
}
}

sensors_event_t hum1, temp1;

sht1.getEvent(&hum1, &temp1);

float HI1 = computeHeatIndexC(
temp1.temperature,
hum1.relative_humidity);

sensor1_present = true;

temp1_display = temp1.temperature;
hum1_display = hum1.relative_humidity;
HI1_display = HI1;

Serial.println("SENSOR #1 (I2C0)");
Serial.print("Temperature : ");
Serial.print(temp1.temperature, 2);
Serial.println(" C");

Serial.print("Humidity : ");
Serial.print(hum1.relative_humidity, 2);
Serial.println(" %");

Serial.print("Heat Index : ");
Serial.print(HI1, 2);
Serial.println(" C");
}
else
{
sensor1_ok = false;

Serial.println("SENSOR #1 (I2C0)");
Serial.println(">>> DISCONNECTED <<<");
}

Serial.println();

// ---------- SENSOR 2 ----------
if (devicePresent(Wire1, 0x44))
{
if (!sensor2_ok)
{
if (sht2.begin(&Wire1))
{
sht2.setPrecision(SHT4X_HIGH_PRECISION);
sht2.setHeater(SHT4X_NO_HEATER);
sensor2_ok = true;

Serial.println("Sensor #2 Reconnected");
}
}

sensors_event_t hum2, temp2;

sht2.getEvent(&hum2, &temp2);

float HI2 = computeHeatIndexC(
temp2.temperature,
hum2.relative_humidity);

sensor2_present = true;

temp2_display = temp2.temperature;
hum2_display = hum2.relative_humidity;
HI2_display = HI2;

Serial.println("SENSOR #2 (I2C1)");
Serial.print("Temperature : ");
Serial.print(temp2.temperature, 2);
Serial.println(" C");

Serial.print("Humidity : ");
Serial.print(hum2.relative_humidity, 2);
Serial.println(" %");

Serial.print("Heat Index : ");
Serial.print(HI2, 2);
Serial.println(" C");
}
else
{
sensor2_ok = false;

Serial.println("SENSOR #2 (I2C1)");
Serial.println(">>> DISCONNECTED <<<");
}

Serial.println("================================");

// ---------- UPDATE OLED ----------
updateOLED(
sensor1_present,
temp1_display,
hum1_display,
HI1_display,
sensor2_present,
temp2_display,
hum2_display,
HI2_display
);

delay(1000);
}

One small thing to note: in my project, I mounted the OLED display upside down on the breadboard. Therefore, I used the following function to rotate the display:

display.setRotation(2);

If your OLED is mounted in the standard orientation, simply remove or comment out this line. This code also has been explained in the YouTube Video, CLICK here to checkout it.

Thank You

I hope you find this project useful! If you do, please consider liking the project and sharing it. Also don't forget to checkout my full length YouTube video on this topic on my YouTube channel AkashWave RF, and subscribe the channel to stay tuned with me. you can click here to watch the video https://youtu.be/gvT-3zCykAo . Stay tuned with me, and after my exam, a lots of interesting videos on RC HOBBY, RF and LoRa based videos are on the way. Thank you!