My parents own some property with a cabin in the middle of the Colorado wilderness, and its isolation makes upkeep difficult. There have been winters where avalanches have been so intense and frequent that power lines have snapped and weren’t repaired for up to a month. This leaves the cabin in a precarious situation – it does have solar panels, but if there isn’t enough sun due to constant storms, then it remains without power and the pipes could freeze.

alt text

My dad has created a crazy system with an old security camera set up in the maintenance room pointed precisely at an old temperature monitor, as well as a lamp overhead to ensure all of the readings come through in good light. He streams that image to his email. It’s a finicky system that is difficult to use, and I knew there would be a simple replacement in creating an IoT network of temperature sensors throughout the cabin. This would enable him to track the temperature in a multitude of locations – in the maintenance room, in the basement, in the garage space, etc. This would also be a good way to know if the WiFi is down, as the boards won’t be able to connect to the app.

The Build

It’s a pretty simple build. I picked up about five ESP32 WROOM Things since they’re compatible with the Blynk interface and it’s so easy to set up an IoT network.

SparkFun Thing Plus - ESP32 WROOM

SparkFun Thing Plus – ESP32 WROOM




On top of that, I picked up the TMP117 Qwiic high temperature sensor. Since I don’t have access to a laser cutter right now and I wanted these to be contained, I just used some old SparkFun boxes and adhesive to contain the boards within the box, as well as connect to a wall adapter power supply.

SparkFun High Precision Temperature Sensor - TMP117 (Qwiic)

SparkFun High Precision Temperature Sensor – TMP117 (Qwiic)




The Code

When integrating into the Blynk interface, there are two ways to display sensor data. The first is to PULL, which requests data from the sensor only when the app is open. The second is PUSH, in which the sensor constantly sends data to the Blynk cloud.

alt text

Since I want to track the history of temperature change, I will PUSH all of the data to the cloud and then display it through the app. This means I’ll write data to the interface every millisecond or so. Once I can read in sensor data, I can simply write it to the app on a virtual pin.

float tempF = sensor.readTempF();
Blynk.virtualWrite(V5, tempF);

On top of that, I’ll call this function every few seconds or so using a timer, so that it continuously pushes data to the cloud.

I created a new project for each Thing, and then built an app out of all of those projects. Each project basically correlates with a room – the garage, the basement, etc. – and the app displays all of the information from each project.

Next Steps

Okay, so I’ve now created a modern, light solution to my dad’s problem with monitoring temperature. But there are a dozen other environmental factors that plague the cabin, like tracking general snow depth accumulation over the winter.

I was thinking about tracking snow depth with an ultrasonic sensor…basically by measuring the time required for an ultrasonic pulse to travel to and from the surface of the snow. The issue is that the range on the ultrasonic sensor is a little limited, so as the snow depth accumulates, the sensor might have to be moved and recalibrated. What are your thoughts on the best methods to monitor change in snow depth? Maybe I’ll continue to build on this IoT network and incorporate that into the app. Let me know your thoughts, and in the meantime I’ll sit back, relax, and watch these stats roll in.

comments | comment feed

Source: SparkFun: Commerce Blog