Displaying Temperature and Humidity on OLED Using Maker Pi Pico

Displaying Temperature and Humidity on OLED Using Maker Pi Pico

Learn how to display temperature and humidity on an OLED screen using Maker Pi Pico! In this tutorial, we'll guide you step-by-step through the setup and coding process. But that's not all! By the end of this tutorial, you'll have the knowledge and skills to tackle other cool projects using OLED display. Let’s get started!

 

Video Tutorial

 

Components Required

Hardware Components

 

Connection


 

  • Connect the DHT11 sensor to GP27 and leave the white wire unconnected
     
  • For the OLED connect SDA to GP0 and SCL to GP1
     

Get Familiar with Thonny and CircuitPython

In this tutorial, we'll use Thonny editor & CircuitPython to build the code for this project. If you're not familiar with Thonny, check out the video below to learn how to get started with it.


 

Required Libraries to Build the Code

Before we dive into the tutorial, we need to make sure we have the necessary libraries installed to use the OLED and DHT sensor. 
 

Visit the official CircuitPython website and download the latest library bundle. Make sure to select the correct bundle for your version of CircuitPython.
 

Unzip the file, and locate these three libraries:

- adafruit_dht.mpy
- adafruit_framebuf.mpy
- adafruit_ssd1306.mpy

Copy and paste them into "lib" folder on your CIRCUITPY drive.


Also, you will need (font5x8.bin) file to be added to your CIRCUITPY drive, so you can use the OLED. 

 

Code

Project complete


 

By completing this project, you will have a functional system that can measure temperature and humidity using a DHT11 sensor and display the readings on an OLED screen. This can be useful in various applications such as weather monitoring, environmental sensing, or home automation projects where temperature and humidity data are important.