Ben Brooks' Espressif ESP32-Based Beehive Monitor Gets His Buzzy Friends Talking to Home Assistant
Inspired by the HiveTool project, this ESP32-powered beehive monitor delivers constant readings to Home Assistant via ESPHome.
Ben Brooks is returning to beekeeping, and with the buzzy beasts comes the desire to keep them safe — using a beehive monitor connected to Home Assistant to graph and record temperature, humidity, light, and weight readings.
"We (my wife and I) have had bees off and on for nearly a decade, and during that time I came across the open-source project HiveTool," Brooks explains. "It worked well enough, but unbeknownst to me it had very recently become a mostly abandoned project right as I discovered it. A string of several bad seasons for our bees, and we decided to call it quits. Fast-forward to now, with a renewed motivation to give beekeeping a go again I decided I definitely wanted to pull data about our hive into Home Assistant."
Rather than rely on HiveTool continuing to work even after its development had seemingly ceased, Brooks opted to recreate the functionality himself — using an Espressif ESP32 microcontroller running the ESPHome firmware and sending sensor readings to Home Assistant for both ease of access and the potential to automate alarms should conditions require intervention.
The ESP32 microcontroller, housed in a weatherproof box, is hosted on a custom-milled PCB that also includes interfaces to temperature, humidity, and light sensors. Load cell sensors, positioned at each corner of the hive, monitor its weight — though a hungry mouse testing a sensor with its teeth means that the initial test hive is running on three load cell sensors rather than the full four.
"Everything worked quite well and is much neater and cleaner looking than when I did this previously," Brooks says of the system's initial testing. "I also already have a weather station at my house (which is where the hive is located), so I have outdoor temperature (and rain, which I might play with too) that I can use as well. For the data-visualization piece, I settled on using the 'apexcharts-card' as the native graph card has a lot of limitations, especially when using multiple sensors with different values."
When it came time to deploy, though, Brooks ran into a spot of bother with the weight readings. "Suspecting the phone plugs (I’m using a phone line splitter to combine the strain gauges as well as then connecting the combined connection to the PCB), I gave them a good jiggle or two and got more reasonable readings again," he explains, "but shortly after ended up with the same issues.
"My suspicion is that weather conditions are enough to subtly change the connection properties of the phone plugs (since they’re basically just held connected with tension), and since I’m measuring very tiny changes in resistance this is throwing my readings off measurably."
Brooks plans to replace the load cell system with strain gauges, as used in bathroom scales, to deliver improved reliability, and promises to update his Hackaday.io project page with the results.
Freelance journalist, technical author, hacker, tinkerer, erstwhile sysadmin. For hire: freelance@halfacree.co.uk.