Use of the DHT11 sensor by the Micro:bit card

Micro:bit 28-01-24
367 0

Tutorial plan

1- How does the Micro:bit card receive the data measured by the DHT11 sensor ?

2- The components required to use  the DHT11 sensor by Micro:bit board

3- Mounting the Micro:bit board with the DHT11 sensor

4- Program the Micro:bit board with Makecode to display the temperature and humidity measured by the DHT11 sensor

 

 

How does the Micro:bit card receive the data measured by the DHT11 sensor ?

The Micro:bit is a small, programmable computer that includes a variety of sensors and features, including a built-in accelerometer and magnetometer. However, it does not have a native input for the DHT11 sensor, which is a sensor commonly used for measuring temperature and humidity.

If you want to connect a DHT11 sensor to a Micro:bit, you would typically use one of the Micro:bit's general-purpose input/output (GPIO) pins. The DHT11 sensor has three pins: VCC (power), GND (ground), and a data pin. You would connect the VCC and GND pins of the DHT11 to the appropriate power and ground pins on the Micro:bit, and the data pin to one of the Micro:bit's GPIO pins.

Once connected, you can use the Micro:bit's programming environment, such as the Microsoft MakeCode editor or MicroPython, to read data from the DHT11 sensor. The DHT11 sensor communicates using a simple one-wire protocol, and you would need to implement the necessary code to read data from the sensor through the connected GPIO pin.

The components required to use  the DHT11 sensor by Micro:bit board

To display the temperature and humidity readings from the DHT11 sensor using the Micro:bit, you'll need the following components:

Micro:bit board:

Micro:bit board

The Micro:bit board is a small, programmable microcontroller board designed for education and beginner-friendly coding projects. It was developed by the BBC, in collaboration with various partners, as a tool to introduce young people to programming and electronics.

DHT11 Temperature and Humidity Sensor

The DHT11 is a basic, low-cost digital temperature and humidity sensor.

Cables with crocodile clip:

For making temporary connections and wiring between components.

Breadboard:

Test plate

A breadboard is a useful tool for creating temporary electronic circuits. It allows you to connect components without soldering.

Mounting the Micro:bit board with the DHT11 sensor

Mounting the Micro:bit board with the DHT11 sensorMounting the Micro:bit board with the DHT11 sensor

Mounting the DHT11 Sensor:

- connect the VCC pin of the DHT11 Sensor to 3.3V pin of the Micro:bit board

- connect the GND pin of the DHT11 to GND pin of the Micro:bit board

- connect the DATA pin of the DHT11 to P1 pin of the Micro:bit board

Program the Micro:bit board with Makecode to display the temperature and humidity measured by the DHT11 sensor

Here are the general steps:

1- Add the Necessary Extensions:

Open the MakeCode editor (https://makecode.microbit.org/).

Click on the "Extensions" category in the toolbox.

Search for and add the "DHT11" extension to your project.

2- Read Data from DHT11 :

Use a loop to continuously read data from the DHT11 sensor.

Use the "DHT11 read data" block to obtain temperature and humidity values.

Here's a simple example using MakeCode blocks:

Download program

0 comment

Leave a comment

Veuillez noter s'il vous plaît*

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *

Purpose of this website

Educational robotics refers to the use of robots and robotics technology to promote learning in educational settings. It involves the integration of technology, engineering, and computer science into the classroom, allowing students to engage in hands-on, project-based learning experiences.
In this context, our website represents an excellent resource for parents, teachers and children who wish to discover robotics.

Contact details

Zaouiet Kontech-Jemmel-Monastir-Tunisia

+216 92 886 231

medaliprof@gmail.com

Pictures of the articles

Robotic site created by MedAli-Teacher info