Using a WeMos ESP8266 D1 Mini and DHT22 Shield to monitor beehive temperature and humidity
I decided to add MQTT messaging to io.adafruit.com to create a couple publicly available dashboards.
When I changed the code to add the Adafruit dashboards, I updated some libraries which led to no end of fun. Long story short, one sensor was sending data to pin 2 on the Huzzah. The updated libraries broke this. When I tested, I assumed my terrible build quality had created the problem. Much testing later, I solved the problem by moving the sensor to pin 12.
There are now two public dashboards:
The updated code has been pushed to my the master branch of my github repository.
For those interested, here's a Fritzing approximating my build. It doesn't show all the back-of-the-board solder connections or the twin rows of headers for mounting the breakout board. It also shows 5x2pin screw terminal blocks for the DHT22s instead of the 3x3pin terminal blocks I really used.
The voltage divider upper right is wired in series on the underside of the board as is just about everything wired in parallel.
Here's a schematic showing how simple it really is. My Fritzing-fu is weak but I think it's readable.
The code is the more interesting part of this but that's for a different log entry.
This sort of approach is all over the interwebs so I won't belabor it.
I wanted the data collector and reporter to be solar powered so I grabbed a DC/DC converter and a charger from Aliexpress. Both had USB connectors so a stubby little USB cable made it a trivial task.
But trivial isn't fun and I didn't want to sacrifice a cable so i deconstructed the USB on the converter, desoldered the pins and soldered connecting wires to the charger.
A happy little fellow with a great big USB connector.
It's the top and bottom pins of that row of four I want to expose.
And so I did. Tearing stuff apart is my strongest hacker skill.
A little perf board, a little hot melt glue, a couple connectors and here's the charger circuit.
It's the top chunk of perf board in this picture, connected to the LiPo and ready to be stuffed into its weatherproof enclosure /sandwich box and connected to the solar panel.
Lots to update. Let's start with the change of ESP8266 boards. It's relatively inexpensive ($10 US) and draws almost no power in deep sleep mode. In the image below, you can see it plugged into a couple rows of headers that are soldered to the relevant pins.
Next iteration will connect them to 3.3V out on the ESP8266.
You may see an ugly mess of wires and stuff. I see a solar powered Adafruit HuzzahESP8266 reading data from two DHT22 temp and humidity sensors and sending the data to an MQTT broker in my secret lair.
The adafruit HuzzahESP2866 breakout board seems delightfully efficient. I fully charged a 3.7V 650mAH lipo and let it run for three days. I didn't measure power draw but after 72 hours without a fault, the battery showed 4.0V. I'm using deep sleep mode and waking every hour (approximately) to sense and communicate. The rig in the picture is 5V solar panel => 5V voltage regulator => battery charger => lipo + ESP2866. The DHT22s are powered from 3V out on the ESP2866.
On a sunny day, I never saw the battery drop below 4V and it showed as fully charged after a couple hours. It partly discharged/recharged several times during the day and ran without fault overnight.
Over the weekend I'll weather-proof it a bit and test to failure (or June 5, whichever comes first). On June 5 I'm doing a split so the target hive will be open. I'll install sensors and mount the panel and power circuits.
Stupid of me not to realize that initially. I slapped a 7805 voltage regulator and a 9 volt battery on it and threw it out in the backyard. It works, nuff said. 7805 is an inefficient power sucker so I need to get serious now about power management.
The WeMos D1 Mini only takes power from the USB port. I have an adafruit HUZZAH ESP8266 that has a couple Vin pins. I'll be switching over to that as soon as I solder some headers on.
Did a little hygienic work to clean up the code, prep for monitoring battery voltage, and get credentials out of github. The only remaining branch is the master.
I have software controlling the ESP8266 reading data from a DHT22 and sending it via MQTT to adafruit io. It's been working stably for over 24 hours. The code is on github at https://github.com/dgr-crenshaw/cyberHiveWiFi.git The powerManagement branch is the active code branch.