Search the Knowledge Base
Display BME680 Sensor Data on an OLED Display using RP2040 Core Board
Introduction
The goal of this project is to interface a BME680 sensor with an OLED display using a Raspberry Pi compatible (RP2040 Core Board) so that data read in from the BME680 sensor can be displayed on the OLED display.
By the end of this tutorial, you will have a clear understanding of how to wire the components to the RP2040 board, write the necessary code to read data from the sensor and display the data onto the OLED display.
This tutorial will walk you through how a BME680 sensor can be interfaced with an OLED display. The OLED display being used is a SSD1306 0.91 inch OLED display, which has dimensions of 128×64 pixels. We will be using an RP2040 Core Board based on the Raspberry Pi Pico. The Arduino IDE will be used to flash the RP2040 Core Board with the code.
Materials:
Given below is the pinout diagram for the RP2040 core that is being used for this project.
- PC with Arduino IDE installed
- RP2040 core board OR Raspberry Pi Pico
- BME680 sensor
- 1.3 inch (128×64 pixels) monochrome OLED display module
- USB-A to USB-C cable
- Breadboard
About the BME680 Sensor
The BME680 sensor is an environmental sensor that is capable of taking readings of temperature, humidity, barometric pressure, and air quality. It has a low power consumption, making it suitable for mobile applications. It is a highly versatile sensor and it uses the I2C communication protocol. This sensor is commonly used in air quality measurement devices, weather stations and altitude measurement devices.
Pin Layout for the BME680 sensor

Power Connections:
Wire the VCC pin to the 3V3 pin of the RP2040. Then connect the GND pin to one of the available GND pins on the RP2040 .
Communication:
Wire the I2C SCL pin to GP5 and the I2C SDA pin to GP4 of the Raspberry Pi Pico. The default SDA and SCL pins of the Raspberry Pi Pico are GP4 and GP5 respectively.
About the 1.3 inch monochrome OLED display module
The 1.3-inch I2C OLED display module is a compact and versatile display that can be used for various projects. This OLED module features a high-quality 1.3 inch screen with an I2C interface, making it easy to connect to your microcontroller.
The 128×64 pixel resolution allows for detailed graphics and text, making it excellent for displaying data, images, and even simple animations.
Pin Layout for the 1.3 inch OLED display
Power Connections:
Wire the VCC pins of the OLED display and BME80 to the 3V3 pin of the RP2040, and the GND pins to one of the available GND pins on the microcontroller.
Communication:
Wire the SDA and SCL pins of both the OLED and BME680 to GP4 and GP5 respectively. Since they have 2 different I2C addresses. they can be connected to the same pin. The built in I2C driver is able to read both addresses.
Wiring and Setup
After wiring up the sensor and the display, connect the RP2040 to power using the USB cable. This will cause an LED to light up, indicating that there is a power supply to the board.
Required Libraries:
Navigate to the Library Manager and search for and install the following libraries:
Important Note:
The I2C address of the BME680 sensor is 0x77, and the I2C address of the OLED display is 0x3c.
Code
The following code displays readings taken from the BME680 sensor onto the OLED screen.
Initialisation:
Define the screen width and height, OLED reset and the OLED display and BME objects.
Main loop:
Start the BME680 sensor and continuously take readings and display them on the OLED screen. The sensor readings and the OLED screen are refreshed every time.
Downloadable Content
Please find the code for this tutorial on our GitHub page.
Credits
- Maker Community
- The RP2040 Community
- The STEM Community
