Warning: file_put_contents(/home/clients/81b51a55b78a35c5c4c50dd82cac1015/diyprojects/wp-content/uploads/wpo/images/wpo_logo_small.png.webp): failed to open stream: Disk quota exceeded in /home/clients/81b51a55b78a35c5c4c50dd82cac1015/diyprojects/wp-content/plugins/wp-optimize/vendor/rosell-dk/webp-convert/src/Convert/Converters/Gd.php on line 428
Test of the SHT30 shield for LoLin d1 mini, temperature and humidity in I2C (ESP8266) • DIY Projects
DIY Projects

Test of the SHT30 shield for LoLin d1 mini, temperature and humidity in I2C (ESP8266)

shield sht30 wemos d1 mini shield batterie oled

The DHT22 temperature and humidity sensor (and its small brother the DHT11) are ubiquitous in the Arduino / ESP8266 / Raspberry Pi tutorials. You are also probably familiar with Dallas DS18b20 which uses the 1-Wire protocol. Wemos offers a new expansion board, the Shield SHT30.


The Sensirion SHT30 is a miniature sensor. In addition to its very small size which makes it possible to obtain an ultra-flat shield, the SHT30 communicates with the Wemos d1 mini on the I2C bus. This is a very big advantage for the ESP8266 which has far fewer pins than the Arduino.

Unpacking shield SHT30 for LoLin d1 mini

Sold less than 3 € in direct from Asia, the shield SHT30 is delivered in an anti-static pouch. Unlike other Shields in the family, it is delivered with only one connector type at 2.54mm pitch.

Technical characteristics of the sensor

The technical documentation of the manufacturer Sensirion is available here. The SHT30 (and its larger brother, SHT31) is capable of measuring the temperature in a range of -40°C to + 125°C. The humidity can be measured from 0 to 100%. Measurement accuracy varies with temperature. Around the ambient (-10°C to + 55°C), the accuracy of temperature measurement is ± 0.3°C.

Mounting the Shield SHT30 seamless

When I had the shield in my hands, I found it a shame to weld the connectors. So I tried to tin the edges of pins GND, 3V3, D1 and D2 (used by the I2C bus). I then stacked the board on a Shield OLED. This results in an extremely compact assembly. From bottom to top :

Warning. Seamless mounting may prevent the Shield SHT30 from working properly. If there is a problem, go back to a classic editing

SHT30 library for IDE Arduino

Wemos has provided a library that can be retrieved on GitHub here. First download the repository before unpacking it into the Library folder of the Arduino IDE. Re-run the IDE so that the IDE takes into account the library.

Basic Program

A basic example (SHT30_Shield.ino) is included with the library. It shows how to recover the temperature and humidity measurement. The WEMOS_SHT3X library is called at the beginning of the program

#include <WEMOS_SHT3X.h>

By default, the SHT30 is accessible at address 0x45. To use the address 0x44, it will be necessary to make a point of welding on the jumper ADDR

SHT3X sht30(0x45);

Then, call the sht30.get () function to retrieve the measurements. Finally, there are three public classes that allow the recovery of measures:

#include <WEMOS_SHT3X.h>
SHT3X sht30(0x45);

void setup() {

void loop() {
  Serial.print("Temperature in Celsius : ");
  Serial.print("Temperature in Fahrenheit : ");
  Serial.print("Relative Humidity : ");

Temperature sensor with OLED display 64×48 pixels

The Shield is installed below a Shield OLED (presented previously), I propose a small program to display the temperature and the humidity on the latter. To work, it is necessary to manually include the Adadruit_SSD1306 library modified by Mike Causer available on Github here.

 * SHT30 Shield for Wemos d1 mini
 * - Read temperature and humidity
 * - Display value on OLED Shield (64x48 pixels) 
 * - Lit la température et l'humidité sur le capteur 
 * - Affiche les mesures sur l'écran OLED (64x48 pixels)
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 * Licence : MIT
 * Copyright (C) 2017 : www.projetsdiy.fr and www.diyprojects.io
#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include "Adafruit_SSD1306.h"
#include <WEMOS_SHT3X.h>

#define OLED_RESET 0  // GPIO0
Adafruit_SSD1306 display(OLED_RESET);
SHT3X sht30(0x45);

void setup() {
  display.begin(SSD1306_SWITCHCAPVCC, 0x3C);  // initialize with the I2C addr 0x3C (for the 64x48)

void loop() {

  display.println("- SHT30 -");
  display.print("T ");
  display.println(" *C");

  display.print("H ");
  display.println(" %");

The Shield SHT30 has many advantages. Its price is equivalent to Shield DHT22 (about €2,90 instead of €2,77). It uses the I2C bus to communicate with the Wemos which saves a pin. Finally, the Shield is extremely compact. It can be inserted between 2 other shields. Small flat for beginners, this sensor being less answered, you will find fewer examples and no plugin ESP Easy has yet been developed.

Click to rate this post!
[Total: 0 Average: 0]
Exit mobile version