Remote MQTT Temperature Sensor Shows How It’s Done

First of all, there are definitely simpler ways to monitor remote temperatures, but [Mike]’s remote MQTT temperature sensor and display project is useful in a few ways. Not only does it lay out how to roll such a system from scratch, but it also showcases system features like solar power.

After all, if one simply wants to monitor temperature that’s easily done, but once one wishes to log those temperatures and use them to trigger other things, then rolling one’s own solution starts to get more attractive. That’s where using someone else’s project as a design reference can come in handy.

[Mike’s] solution uses two Wemos D1 boards: one with a DS18B20 temperature sensor for outdoors, and one with a small OLED screen for an interior display. The external sensor relies on a rechargeable 18650 cell and a solar panel for a hassle-free power supply, and the internal sensor (of which there can be many) has a cute enclosure and is powered by USB. On the back end, a Raspberry Pi running an MQTT gateway and Node Red takes care of the operational side of things. The whole system has been happily running for over two years.

What is MQTT? It is essentially a messaging protocol, and takes care of the whole business of reliably communicating data back and forth between IoT devices. It scales very well and doesn’t need to be hard or intimidating; our own [Elliot Williams] can tell you all about implementing it.

7 thoughts on “Remote MQTT Temperature Sensor Shows How It’s Done

      1. I have an outbuilding that is connected to my home network. If I wanted to use these Xiaomi sensors to monitor it would I use a raspi to listen to them via ble and then forward the info via MQTT or is there another way I should know about? Thanks.

  1. His temperature sensor solution looks very similar to something I rolled. I added WiFi state saving and restoring to further
    reduce power consumption.

    I’ve just been using the node-red dashboard on my phone to monitor the temperatures. I created my system with the main goal of making sure my infant daughter’s room was at a good temp since her room would differ from the rest of the house by enough that it needed watching.

    Once I have a little more time, I’ve got a little different idea for a display. An addition to my monitoring system was some particulate sensors since wildfires are now a fact of life in my state. I was going to add a central display with some color coding based on the AQI color scheme. I found a Node-Red plugin for calculating an indoor temperature ‘comfort index’ that I plan to use the output of for a similar color coded treatment. What I envision is a dashboard with both text but also color coded cells to help us determine things like if it’s OK to open windows to cool off the house, or if the AC would be a better option.

  2. Temperature reading program:
    Why do you need to declare pin2 as an output in setup (“pinMode(2, OUTPUT)”)?
    Pin2 serves as the wirebus ( “const int oneWireBus = 2”) for the temperature sensor und should not be necessary to be declared as an output lateron in setup.
    Maybe I’m wrong, then please tell me the reason!

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.