How to Use OLED with micro:bit - Display Temperature and Humidity

How to Use OLED with micro:bit - Display Temperature and Humidity

Looking to add a little something extra to your micro:bit project? In this tutorial, we'll show you how to connect an OLED display to your micro:bit and display real-time temperature and humidity readings

 

Video Tutorial

 

Components Required

 

Connection

By following the diagram above:

  • Connect the DHT11 sensor to P0
  • For the OLED, connect GND to GND, 3V3 to VCC, SDA to SDA, SCL to SCK

 

Code

Connect your micro:bit to your computer and open MakeCode editor to start programming.

  • Add “OLED12864_I2C” extension
  • Add "DHT11_DHT22" extension
  • then follow the code block in the picture above
  • After completing the code, download it on microbit

You can also view and edit the code by clicking here!

 

Project Complete

Turn on your REKA:BIT, the temperature and humidity reading will appear on your OLED

Hardware Components