How to Build a Micro:bit Temperature and Humidity Meter

by ElecFreaks in Teachers > 2

545 Views, 1 Favorites, 0 Comments

How to Build a Micro:bit Temperature and Humidity Meter

2022-1-20.jpg

 

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

1.png
2.jpg
3.jpg
4.jpg
5.jpg
6.jpg




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.











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

2022-1-20-2.jpg

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

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

2022-1-20-3.jpg

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

PlanetX DHT11 Sensor Connected to J4

2022-1-20-4.jpg

PlanetX DHT11 Sensor Connected To J4

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

2022-1-20-5.jpg
2022-1-20-6.jpg
2022-1-20-7.jpg
2022-1-20-8.jpg


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.