Now it's time to level up with real-time monitoring and remote reporting. A while back I got the WeMos ESP8266 and DHT22 shields..
After a lot of dinking around, I switched to the adafruit Huzzah ESP8266 breakout board. It was a bit easier to work with, especially getting it to sleep and wake up. Power is from a 650mAH 3.7V LiPo charged by a 5V solar panel and charging circuit. Power draw is in the nano Amp range when sleeping. I wake it every 30 minutes, collect data and read battery voltage from the ADC. Data gets sent to a local MQTT broker.
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.
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.
GPIO16 is jumpered to RESET to allow for sleeping
The voltage divider limits the input to the ADC to a bit less than one volt
The DTH22s are connected to battery power and ground. Next time I'll connecting them to 3.3V out on the breakout board
DHT22 signal pins are connected to GPIO2, GPIO4, and GPIO5,
The code is the more interesting part of this but that's for a different log entry.
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.
VCC to the battery
GND to the battery
ADC though a voltage divider 1MR | 3kR
Pin 16 jumpered to RST for sleep mode
D2 D4 and D5 connected to signal from the three DHT22s
DHT22 Power connected to battery (they only draw 50 nano Amps when sleeping).
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.
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.