Display temperature and humidity measured by DHT11 connected to Micro:bit on SSD1306 display

Micro:bit 24-01-24
168 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 the SSD1306 display by Micro:bit board

3- Mounting the Micro:bit board with the DHT11 sensor and the SSD1306 display

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

 

 

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.

To display data measured by a DHT11 sensor on an SSD1306 display with a Micro:bit, you need to follow a few steps:

Connect the Hardware:

Connect the DHT11 sensor to the Micro:bit using appropriate GPIO pins (VCC, GND, and the data pin).

Connect the SSD1306 display to the Micro:bit. The SSD1306 typically communicates over I2C, so connect its SDA and SCL pins to the Micro:bit's corresponding pins.

Write Makecode Code:

Use the Makecode language to write code that reads data from the DHT11 sensor and displays it on the SSD1306 display.

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

To display the temperature and humidity readings from the DHT11 sensor on SSD1306 display using an Arduino, 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.

The GPIO expansion card for the Micro:bit card

The GPIO expansion card for the Micro:bit card

The GPIO expansion board for the Micro:bit board expands the capabilities of the Micro:bit board by adding more input/output (GPIO) pins and additional functionality.

DHT11 Temperature and Humidity Sensor

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

SSD1306 Display

The SSD1306 is a popular display controller used in OLED (Organic Light-Emitting Diode) screens. It's commonly employed in various electronics projects to showcase information on small screens. The SSD1306 controller is compatible with different screen sizes and is often integrated with microcontrollers like Micro:bit board to display text, graphics, and images.

This display is used for displaying the temperature and humidity from the DHT11 sensor .

Jumper Wires:

Jumper wires

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 and the SSD1306 display

Mounting the Micro:bit board with the DHT11 sensor and the SSD1306 displayMounting the Micro:bit board with the DHT11 sensor and the SSD1306 display

Mounting the Micro:bit board along with the DHT11 sensor and SSD1306 display can be done in various ways based on the preferences for the project's permanence, aesthetics, and convenience. Here's a suggestion on how to mount them:

Attaching the SSD1306 Display :

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

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

- connect the SDA pin of the display to P20 pin of the Micro:bit board

- connect the SCL pin of the display to P19 pin of the Micro:bit board

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 on the SSD1306 display

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.

Search for and add the "muselab-oled-v2" to find the SSD1306 extension.

2- Initialize the DHT11 Sensor and SSD1306 Display:

Use the "DHT11 initialize" block to set up the DHT11 sensor on a specific pin.

Use the "SSD1306 initialize" block to set up the SSD1306 display.

3- Read Data from DHT11 and Display on SSD1306:

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

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

Use the "SSD1306 show number" block to display the values on the SSD1306 display.

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