A major limitation to the PC board I created for my ESP-WROOM-02 module described in the previous post was that it could only support one digital input (even though the ESP module itself supports many). This was done intentionally to keep things simple. In a real-world application, however, this would not be very useful. Therefore, I decided to go with a different approach for round two.
I chose a Raspberry Pi 3B+ with battery backup (and charger) to monitor, control and display everything. This small but powerful platform would allow me to gather data from multiple sensors with plenty of capacity for future expansion. The actual task of gathering sensor information and then processing it involved installing three pieces of software onto the RPi:
1) Data manipulation -
Node Red was my choice for handling all sensor data. It is essentially a visual programming tool consisting of nodes (units of pre-developed code) that perform a specific task such as reading sensor data, writing to a database, converting raw data into a visual gauge or bar chart, filtering data, and so on. Nodes are connected via virtual wires to create a flow. The following image is part of a flow I created specifically for this project:
 |
Node Red flow
|
In this example, the reddish-brown node in the center retrieves the hard wired sensor data (temperature and humidity) for the outside and basement sensors, the light orange nodes perform some post retrieval processing and the light brown nodes on the far right forward all processed data to the database software for storage.
2) Database storage and 3) Visualization - I decided upon
InfluxDB for storing all my sensor data and
Grafana for the user display. InfluxDB is a time series database that allows for easy data logging and when coupled with additional software like Grafana provides a user friendly way to visualize data in real time. The screenshot below shows my basement temperature and humidity over a 24hr period along with maximum, minimum and average values:
 |
| Grafana dashboard |
A final touch was to create a simple web page that could display this information in real time using the browser on my smartphone, home computer, etc. Node Red made adding this feature a snap. Below is a screenshot of the display (I chose to show temperature only to keep things simple):
To access the page I just type in the IP Address of the Raspberry Pi (assigned by my Wi-Fi router on initial startup). Code for the gauge templates came from "
canvas-gauges.com" but everything else was written by me. This setup works fine when I'm around the house in range of our Wi-Fi network but what about when I'm not at home? The solution was to create a VPN (virtual private network) so that I could access this info anywhere in the world that has internet access. I simply setup the RPi as a VPN server using a YouTube tutorial I found and it was ready to go.
Update (Spring 2022)
I decided to completely overhaul my webpage by adding a few more bells and whistles as seen in the screenshot below. The current temperature and rainfall values still come from my onsite sensors, but the 12-hour forecast readings come from an AccuWeather API. I also added two temperature charts: one to show the hourly values throughout the day and one to show the daily low and high values for the week. Finally, I added a background image to provide an interesting backdrop. This came from a picture taken on one of our hikes near the Asheville area.
Update 2 (Spring 2025)
Over the last few years my Raspberry Pi 3B+ has suffered a number of SD card failures that required reformatting and then reloading all my embedded software. Also, making occasional changes and/or improvements to the web server code was a rather unpleasant endeavor. Therefore, for my "final" enhancement I decided to switch to a different hardware platform: an Adafruit Feather Huzzah ESP8266. As with the Raspberry Pi, this unit also has Wi-Fi capability but uses a much smaller footprint (see photo below) making it the perfect choice to power my web page. I removed the 12-hour forecast section and added additional elements including a National Weather Service radar map, moon phase and solar information, as well as a slide show carousel of NASA astronomy images (just because I thought they were cool looking).
 |
| ESP8266 hardware platform |
 |
| Home page |
 |
| Moon and solar information |
 |
| Temperature and rainfall charts |
 |
| One of many NASA images... |