ESP8266-ESP-01, DHT22, and ThingsBoard

We have a cabin in Red Feather Lakes, Colorado that was purchased in January (winter time). We didn’t turn on the water (supplied by electric well pump) until things thawed out in the spring. Over the summer I repaired some copper pipes and installed electric heat tape to keep the pipes warm (hoping to keep the water on year round). To remotely monitor the temperature and humidity of the cabin in several places, I’m using sensors that send data via wifi to a remote server. The sensor logic and wifi are provided by ESP8266-ESP-01 units with custom code, and the remote server uses ThingsBoard. The dashboard is a work in progress as I add more sensors, but looks like this at the time of this writing:

The ThingsBoard software is hosted on a private server on my house in Fort Collins (ThingsBoard uses a java based web server that’s a bit of a beast and kept eating up resources on a AWS/EC2 server I originally set things up on). Since I can tolerate some downtime and the traffic is low, using a server at my house is fine for now.

Background info/links:

Here’s what the sensors look like (as I assembled one that will eventually go in the main cabin):

I used a small breakout board (rather than solder the ESP01 directly) so I can swap out the ESP01 easily for reprogramming. The breakout boards are cheap and make things easier to work with. I originally used a LD1117V33 Voltage Regulator (I’m not an electronics engineer); which gets pretty hot so I made a heat sync, then thought about using capacitors to help stabilize the power (event though the LD1117V33 by itself has been stable; no rebooting of ESP01 that I’m aware of). All of that started to get complicated and the buck converters you see in the pic cost a couple dollars at most (as opposed to the other electronics which cost pennies, but take more time to deal with). MakerFocus (maybe others too) make a board that a ESP01 plugs into that has a regulator and DHT11 integrated with. I ordered a couple of these and smoked the first one with a 9 volt power supply (it was supposed to handle up to 12 volt). I might try the one I didn’t smoke eventually (I forgot it up at the cabin). I don’t think it save anything in cost, but it “should” be easier to use.

The wiring is pretty straightforward. There’s a small resistor connected to the DHT22 that’s a little hard to see that’s a pain to sold on.

Here’s what it looks like with the ESP01 plugged into the breakout board…

Here’s what it looks like buckled up, next to a solderless breadboard used to test the ESP01 before soldering things up…

The arduino sketch I used is pretty much the same one I copied from a tutorial here: https://thingsboard.io/docs/samples/esp8266/temperature/. I used some DHT11 units in place of DHT22 units in some places; which requires one minor change in the sketch. Other than that, you just have to change the wifi info, thingsboard server address, and device token ID.

Leave a Comment