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.
Materials required:
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.
Step 2
The second PlanetX Segment is connected to the J2 port of the Nezha expansion board.
Step 3
PlanetX DHT11 sensor connected to J4
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.