Building a mini temperature display
April 05, 2025
Last week I built a mini display for my desk to read out the current temperature, humidity and pressure. It’s amazing what you can do with a few hours of connecting wires and vibecoding.
It’s been a couple years since I’ve worked on a hardware project, and a recent hack week at work seemed like the perfect opportunity to build something new. I ordered a microcontroller and sensor that would ship to me in time for the project. The idea was to make a little display that reads out the current conditions in our house. Plus I’d have the opportunity to write (or make AI write) some C++ and Rust code.
Hardware
The M5 Atom Matrix has a 5x5 grid of LEDs that can be programmed, and some I/O pins for connecting to other devices. It’s a bit smaller than a quarter but shockingly easy to work with. I plugged it into my computer via USB-C and got started.
The arduino setup from the M5 docs worked well and I quickly had the Arduino IDE connected and was flashing some example programs to the controller. It took me a surprisingly long time to realize that the little button on the controller actually resets the program, and the ‘button’ they advertise is actually the entire LED grid that can be pushed down. Pretty neat idea.
Now on to wiring up my BME688 sensor. It came with a small cable harness, but I didn’t have the right adapters to connect to my controller. I grabbed some extra wire from another project and made 5 little connectors.
Next, which pins to connect? Searching through docs for both devices gave me a plausible pairing and ChatGPT seemed to agree that was correct. It knows a lot of detail about electronics and Arduino code, and good thing too because I don’t.
After a bit of mashing together example code from the Adafruit BME and M5 libraries, I had a working system. I could connect to the controller over a serial port and read out the temperature, humidity, pressure and gas resistance on my computer. Success!
Now to make this thing display on the 5x5 LED grid. I used the right column of LEDs to display different colors based on ranges of temp, humidity and pressure. This way I can glance over to see what the current conditions are. I’m not really sure what you use gas resistance for? Apparently with some (too involved for me at the time) calibration you can get an understanding of air quality or gas makeup in the air.
The indicator dots are cool, but this thing has a 5x5 grid - 5x4 now that I took one of the columns - surely I can do more. With a bit more prompting, I got ChatGPT to generate me a set of pixelated 5x4 digits that I can use to display numbers.
The LED grid is only large enough to fit one number at a time. At first I played with scrolling, but it’s difficult to read scrolling numbers when you only have a few pixels to look at. Eventually I settled on showing a sequence of numbers to display the current temp. So if you look at my desk right now you’ll see this lil guy printing out a sequence of ”_”, “6”, “8”, a blank screen, and then repeating.
Logging and Visualizing Data
At this point I have a functioning display, but the purpose of the hack week wasn’t just to mess with electronics. At work we build software for managing and visualizing robot data. We’re releasing a new SDK that simplifies streaming to Foxglove for visualization and logging to MCAP for storage or playback at a later date.
So how do I get data off my device? Well it’s a fairly tiny controller but the Atom Matrix has good support for WiFi and UDP, so I started sending messages to my computer over UDP. ChatGPT gave me a functioning UDP server in Rust using Tokio in one go, and soon I had readings printing out in my terminal.
--- BME688 Sensor Readings ---
Temperature: 22.87 °C
Humidity: 35.23 %
Pressure: 906.85 hPa
Altitude: 924.05 m
Gas Resistance: 137.49 kΩ
From here it was straightforward to wire up the Foxglove SDK, and just like that I had data from my project displaying in live plots via Foxglove. Whenever the device has power, it now logs automatically so I can keep a historical record of how frigid it gets next to my office window in the morning.
For photos of the build as well as code and more detailed instructions, head over to https://github.com/mguida22/environment-sensor.
Written by Mike Guida who enjoys prolonged outdoor adventures and building stuff with software.