Temperature and Humidity Sensor (I2C)

../../../../_images/temp_humidity_h.png

Overview

Based on the SHT20 digital temperature and humidity sensor integrated IC. Used for detecting environmental temperature and humidity, with extremely high reliability and long-term stability.

Technical Specifications

Operating voltage: VCC 3.3V -5V

Module dimensions: 24*48mm

Mounting: 2 plastic building block compatible through-holes

Temperature: -10–50℃

Humidity: 0–100%

Example Code

Pin Definition

Pin

Definition

GND

Ground

VCC

Power

SCL

I2C clock

SDA

I2C data

Use the mPython Board OLED display to show the temperature and humidity values measured by the sensor.

from mpython import *

from bluebit import *

import time

sht20 = SHT20()
while True:
    oled.fill(0)
    oled.DispChar(str(str('Temp: ') + str(sht20.temperature())), 0, 0, 1)
    oled.DispChar(str(str('Humi: ') + str(sht20.humidity())), 0, 16, 1)
    oled.show()
    time.sleep(0.2)
../../../../_images/temperature_humidity.png