Sitemap
Leslie Foster

Leslie Foster

Programmer / Developer / Software Engineer since late 1980s

Member-only story

Displaying Sensor Data

A 32 Bit Microcontroller Shows Atmospheric Pressure

20 min readMar 23, 2026

--

In this article, we see how data can be collected from a sensor using an ESP32, and displayed directly on an OLED screen. In the earlier article https://medium.com/@lfoster.se.be/pic16lf18324-with-bmp180-sensor-bfdb96bdf1ae the use of the BMP180 sensor was explored. The sensor requires the use of the I2C communication standard, a configuration read step to get tuning parameters from the sensor itself, strict attention to timing in first requesting reads then collecting readings, and finally, carrying out a multi-step calculation to get an accurate reading output. The earlier article was based on the 8-bit PIC16LF18324 microcontroller. Much of the code for the I2C communications had to be created by hand. This may be true for a variety of MCUs (microcontollers) if you are not lucky enough to find a “driver” or library. The sensor output was viewed over a UART connection back to the PC.

Press enter or click to view image in full size
The ESP-32 development board at the top, sensor at the left bottom and OLED display at right bottom

Here, we will use a more powerful MCU called the ESP32-c6, connected not only to the sensor but to an OLED screen called a 12864 which is built with a standard controller chip called SSD1306 and (as its designation indicates) has 128 x 64 pixels. Dealing with the OLED display has its own complexities, as we shall see. However, interfacing it with the MCU utilizes the same I2C interface as is used with the sensor.

--

--

Leslie Foster
Leslie Foster

Written by Leslie Foster

Programmer / Developer / Software Engineer since late 1980s