Introduction: How to Build a Micro:bit Temperature and Humidity Meter

About: ElecFreaks is an open design house founded in March 2011. Our goal is to create rapid prototypes and give small-batch manufacture solution for makers and startups. With over 50% staff as engineers and expanded…

 

Temperature and humidity sensor is a module based on DHT11 digital temperature and humidity sensing element. It is sensitive to the ambient temperature and humidity changes and can be used for temperature alarm, humidity testing and other works.Now let's use it to measure the temperature and humidity of the surrounding environment.

Supplies




BBC micro:bit V2 x 1

Nezha Breakout board x 1

PlanetX DHT11 x 1

PlanetX Segment x 2

RJ11(4P4C) 200mm Cable x 3

Building Blocks x N

Connection steps pictures

We connect to the nezha expansion board through the color corresponding to the sticker of the sensor.











Step 1: The First PlanetX Segment Is Connected to the J1 Port of the Nezha Expansion Board.

The First PlanetX Segment Is Connected To The J1 Port Of The Nezha Expansion Board.

Step 2: The Second PlanetX Segment Is Connected to the J2 Port of the Nezha Expansion Board.

The Second PlanetX Segment Is Connected To The J2 Port Of The Nezha Expansion Board.

Step 3: PlanetX DHT11 Sensor Connected to J4

PlanetX DHT11 Sensor Connected To J4

Step 4: Let's Connect the Micro:bit and Start Graphical Programming


Program:https://makecode.microbit.org/#editor

We first set the variables (temperature and humidity), corresponding to the corresponding interfaces.

Adjust the decimal point, count from the right as the first one, we just fill in "1". The temperature variable reads the temperature value of the DH11 sensor, and the humidity variable reads the humidity value of the DH11 sensor.


After we download the programming code, we can display the temperature and humidity of the surrounding environment.

From building connections to graphic programming, children's logical ability was exercised, and children also understood the role of different sensors, entered the world of electronic science, and realized what they wanted.