Skip to content

Building a temperature humidity sensor

Mitra Ardron edited this page Oct 2, 2025 · 10 revisions

Frugal IoT - building a temperature / humidity sensor

These instructions are fresh - if they are not clear, feel free to open an issue and ask questions, this will help me refine the instructions.

Contents

This is a, hopefully, simple guide to building, configuring, and using, a simple sensor.

Its primary limitations is that it requires WiFi and USB power, there will be other solutions without those constraints.

With practice it takes me around 5 or 10 minutes to make AND flash each sensor.

  • Parts needed
  • Tools needed
  • Construction (antenna hole, notch for USB & sensor
  • Programming
  • Setting up

Parts needed (details below)

Part Typical cost
Dev board €1.76-4.07
SHT30 sensor €0.90-2.67
Enclosure €0.31
USB cable €0.80
USB Power supply €0.50
================ ==========
Total. €4.27-8.34

Tools needed

  • Soldering iron - to solder the sensor cables to the dev board
  • Drill if want a hole for an antenna
  • Sharp knife to cut notch in enclosure

Dev board

I’ve built these with a variety of boards.

My current favourite is the D1 mini Pro v4, there are a number of boards calling themselves D1 mini Pro other than the one from Lolin, and I like this clone for €4.07 because of the external antenna (note the newer Lolin D1 mini Pro V4 €3.35 does not have external antenna).

See the full list in Supported Hardware, which also has suggestions on which board to choose for which use. I have built almost identical sensors using the D1 mini V0 and V4 boards; and the C3 pico and S2 mini and the D1 pro V2 (which needs a larger box).

SHT30 Sensor

The SHT30 is ubiquitous and comes in a lot of different forms.

Most sensors come with a default address, and a way to change that to something different. 0x44 and 0x45 are both common.

So far I've tested and like - for different reasons - 3 SHT30 sensors.

Sensor Purchase Connection I2C Addr Protected Notes
Lolin shield €3.38 Shield or Socket 0x45 No Standard shield, good for developing
SZHJW SHT30-D for €0.90 holes 0x44 No Cheapest I have found
Deeley ~€2.67 at 10x 1 metre cable 0x44 Yes Really nice for remote probe or through wall

I’m also going to try out some other ones in protective housing, and will report back.

Enclosure

Any box should work - depending on the physical situation of the sensor. I’ve been using Vange Moulding’s ABS boxes because ABS has some (though not perfect) UV resistance. For this project I use either 61x36x22mm at €0.31 which has a mounting hole; or the same size box without the mounting.

USB cable

I leave a USB cable plugged into the device. You’ll want one that is data+power for programming, but a simpler power-only one is sufficient once it has been flashed.

USB power supply

For the simplest project plug into a wall-mounted USB charger, any you have handy should work fine

Construction

Enclosure preparation

The box needs three cutouts.

  • A notch for the USB cable to exit through, I cut a small notch in the box, and then cut back the lip of the lid. I use a box-cutter heated over a gas burner, but it can also be done cold.
  • A tiny notch in the opposite end for the SHT30 cable, again cut back the lip of the lid.
  • A hole for the antenna - select a drill just slightly larger than the screw shaft.

IMG_1910 IMG_1913

Wiring

The SHT has to be connected by 4 wires to the dev board as in the following table. The actual pins on the SHT30 varies depending on which you use, but are always labeled.

SHT30 D1 Mini Pro
3V3. 3.3V
GND GND
SCL D1
SDA D2

It may not be necessary but notice how I use adjacent holes for strain relief.

The USB cord is just plugged in, it’s half in place by the walls of the box. Use blob from hot glue gun to seal the hole if you like, but I haven’t found it necessary.

IMG_1912

Mount parts

The parts fit together as in the photo.

  • If you use the Deeley SHT30 then its cord runs through the enclosure and extends to the sensing point.

<< Picture needed >>

  • With the board mounted sensors, they need to be mounted externally. This can be affixed however convenient, I find that tying a knot in the wiring just inside the enclosure can be sufficient, but I haven’t done this in a location exposed to moisture..

IMG_1914

Programming.

Follow the instructions at Programming and Configuring a Device on PlatformIO or Arduino IDE to set it up.

Getting help

If you get stuck - please open an issue on Github. you will need an account, but its free.

Clone this wiki locally