Hello everyone,
I wanted to share an exciting project I’ve been working on—a NodeMCU-based MQTT multi-sensor system with an OLED display. This project has been a great way to integrate various sensors into my smart home setup, and I thought I’d walk through my journey in case it inspires others or provides some tips!
Project Overview
Earlier this year, I designed a NodeMCU breakout board to serve as a versatile platform for my sensors. The board securely houses a NodeMCU, a 4-channel level shifter, a DHT22 sensor, and breakout headers for every pin. Since then, I’ve been using these boards throughout my house for temperature/humidity sensing and even as LED controllers for under-cabinet lighting.
However, the raw PCBs weren’t exactly aesthetically pleasing, and I wanted a way to display local temperature and humidity readings. After some time spent refining the design, I created an enclosure using Fusion360 and printed it on my Prusa i3. The enclosure features an OLED screen that shows real-time temperature and humidity data, while the NodeMCU and sensor are neatly enclosed behind it.
MQTT Integration
For MQTT integration, I set up my topics in openHAB like this:
Number Temperature_Ensuite “Ensuite Temp [%.1f F]” (SF_Ensuite,Temp_Chart_2) {mqtt=“<[broker:home/Ensuite/temperature:state:default]”}
Number Humidity_Ensuite “Ensuite Hum [%.1f %%]” (SF_Ensuite,Hum_Chart) {mqtt=“<[broker:home/Ensuite/humidity:state:default]”}
This setup allows me to view the data in my sitemap or track it over time using charts. I’ve also published the design on Thingiverse and shared my NodeMCU ESP8266 code on GitHub for anyone interested in replicating the project.
Challenges and Solutions
One of the biggest challenges was ensuring reliable communication between the sensors and the OLED display. I experimented with different enclosure designs to optimize airflow and reduce heat buildup, which was crucial for accurate temperature readings. Additionally, transitioning the software to ESPEasy has simplified adding new sensors, as it leverages existing supported sensors without redundant effort.
Future Plans
I’m currently exploring additional iterations of the enclosure, such as a smaller version for WS2812 LED controllers and a PIR motion sensor. I’m also looking into adding sound and air quality sensors to expand the project’s capabilities.
Why I Love This Project
This project has been incredibly rewarding. It’s not just about the functionality—it’s about the satisfaction of creating something that seamlessly integrates into my smart home ecosystem. The ability to monitor and control these sensors remotely has truly enhanced my home automation experience.
I hope this project inspires others to dive into DIY sensor solutions and explore the endless possibilities of MQTT integration. If anyone has questions or suggestions, I’d love to hear from you!
Best regards,
[Your Name]