Source: https://mokxi.com/parts/sht4x
Updated: 2026-11-18

Part

# Temperature and humidity, SHT40

Temperature and humidity over I2C at 0x44, one-byte commands, 8.3 ms a precise reading.

See every part

- 4 pins
- 3 settings
- In 1 project

Drawn live by the editor's own code, at the size you see it.

At a glance

## The Temperature and humidity, SHT40 in brief

What it is, and every setting the properties panel gives it.

The Sensirion SHT40 is a small, fast temperature and humidity sensor on an I2C breakout. It is the SHT31's smaller and faster successor, reading in about 8 ms where the SHT31 takes 15. It runs from a coin cell and carries a small heater to burn off condensation. Every reading comes with a checksum. Mokxi models its I2C behavior: one-byte commands from the datasheet, measure times of up to 8.3 ms, six-byte reads with CRC bytes, and the conversion formulas for temperature and humidity. The address can be 0x44, 0x45 or 0x46. Two sliders in the editor set the temperature and humidity while the circuit runs. The model does not cover the heater's warming, the general-call reset, or the accuracy figures. Common traps are reading too soon after a command and expecting the SHT31's two-byte commands, because the SHT4x takes one.

Family

Sensors

Pins

4

address

68

temperature

22

humidity

45

Pins

## 4 pins

Named as the editor names them, so a wire lands where you expect it.

Pin

What it does

VIN

Supply, 3 to 5 V on the board (the chip itself runs from 1.08 to 3.6 V).

GND

Ground.

SCL

I2C clock. The board carries the pull-ups.

SDA

I2C data.

How to use it

## How to use the SHT40 temperature sensor with an Arduino

The example project is the built-in "CO2 monitor". It wires an SHT40 to an Arduino Uno. An SCD41 counts the CO2 in the room every five seconds and the SHT40 reads the temperature and humidity. Both share one I2C bus: SDA goes to A4, SCL to A5, VIN to 5V, and GND to GND.

Change the settings to temperature 30 and humidity 70 and it prints: "CO2 monitor: the first reading comes in five seconds" then "CO2 650 ppm 30.0 C 70 %RH". Only the weather numbers moved. The CO2 value stayed the same.

Try dragging the CO2 slider on the SCD41 past 1000 ppm. The sketch will ask for a window.

Part pin

Goes to

VIN

Arduino Uno R3 pin 5V

GND

Arduino Uno R3 pin GND

SDA

Arduino Uno R3 pin A4

SCL

Arduino Uno R3 pin A5

Click to open it in the editor

This is the simulator itself, running here. Click anything to open it in the editor.

Open this project in the editor Read the full tutorial

sketch.ino · Arduino Uno R3 · the first 45 lines

Common errors

## Common Temperature and humidity, SHT40 errors and fixes

What goes wrong

The fix

Reading the result straight after the measure command.

Wait. The result is not there for up to 8.3 ms, and the sensor refuses the read until it is.

Sending two-byte commands like on the SHT31.

The SHT4x takes one-byte commands. Check the datasheet command list.

The sketch prints "No SHT40".

Check the wiring and the address. SDA goes to A4 and SCL to A5 on an Uno, and the address starts at 68.

Talking to the chip right after power on or a soft reset.

Wait up to 1 ms. Until then the address is not acknowledged.

Questions

## Questions and answers

### what is the sht40 address

It starts at 68, which is 0x44 on most boards. It can also be 0x45 or 0x46.

### how do I connect the sht40 to an arduino uno

Wire VIN to 5V, GND to GND, SDA to A4, and SCL to A5. The board carries the I2C pull-ups.

### sht40 vs sht31

The SHT40 is smaller and faster. It reads in 8 ms where the SHT31 takes 15. It also runs from a coin cell and has a small heater to burn off condensation.

### which library works with the sht40

Adafruit's library, included as Adafruit_SHT4x.h. Sensirion's own SensirionI2cSht4x.h also works and has measureHighPrecision.

How it is modeled

## What is true about the Temperature and humidity, SHT40, here

In its help article’s own words: what the simulation gets right, and where it stops.

### Not modeled

The heater's warming (the reading after a pulse is the slider's temperature), the
general-call reset, and the accuracy figures.

From SHT40 temperature and humidity sensor, in full.

Projects

## See the Temperature and humidity, SHT40 in a project

One built-in project uses it. It opens in the editor, already wired.

Boards

## The boards it is shown on

This board has a built-in project with the Temperature and humidity, SHT40 in it.

- Arduino Uno R3

Libraries

## Arduino libraries for the Temperature and humidity, SHT40

Built in, so the sketch compiles with nothing to install. Each page has the calls, the wiring and an example to run.

- Adafruit SHT4x

Keep going

## Keep going

- I2C Scanner for Arduino and ESP32, and Fixes
- Temperature and humidity, DHT22
- Temperature and humidity, SHT31
- Humidity sensor, AHT20

More parts

## The rest of the bench

Every one of these is drawn and simulated the same way.

Full-size breadboard

A real 0.1 inch grid with the rails and the center channel, 63 columns wide.

Jumper wires

Drag from any pin or hole to any other. Corners snap, and you can drag them.

Power

A supply rail at the voltage you choose.

Ground

The other end of every circuit.

LED

Lights when current flows. Five colors, and the brightness is what your eye would see.

Filament lamp

A tungsten bulb in a holder: an inrush when it is switched on cold, tens of milliseconds to warm up, and dim on half its voltage.

Resistor

Any value you like, with the color bands drawn to match.

ESP32-C3-DevKitM-1

A RISC-V board that runs your firmware at 160 MHz on the real memory map.

Pushbutton

A 12 mm tactile switch. Hold it while the simulation runs.

Raspberry Pi Pico

The RP2040 board on our own Cortex-M0+ core. Pick a program and press Run.

Raspberry Pi Pico W

Raspberry Pi Pico W (RP2040). The same board and the same pinout as a Pico, with the CYW43439 on it. The WiFi is simulated (no radio; real internet through the Cloud panel’s switch), and the on-board LED, which hangs off that chip rather than off GP25, is driven through the same path. Everything else is the Pico.

Raspberry Pi 4 Model B

Raspberry Pi 4 Model B: the 40-pin header, driven by main.py with RPi.GPIO or gpiozero.

See every part

## Wire up the Temperature and humidity, SHT40

Open the editor and push it into the breadboard. It is free, and it runs on your own machine.

Start building free Open the editor
