Close
0%
0%

Bee hive health monitor

This project will monitor the weight changes in the hive along with some environmental items to provide real time indicators of hive health

Similar projects worth following
This is yet another bee hive monitor. We are doing it because many past projects monitor activity, but do not provide data that we can interpret as measures of hive health and stress. Our goal is to engineer an IoT hardware and software framework that is very simple to replicate and gives us information about our hives that we can, hopefully, begin to correlate with external factors. By doing this we should be able to more quickly spot problems and diagnose what is going on to provide remedies (if any).
This is targeted to the amateur bee keeper who likes to make things and also stay in touch with nature. It will, hopefully, be scalable to use on many hives, but our initial goal is for six or fewer hives per location. The parts will be chosen for their cost, broad availability, and simple substitution.
Our end goal is to have a system to help us find correlations between hive behavior and the environmental factors.

Why would you do this?

We have been keeping bees for a few years in two different Texas locations -- Gulf Coast and Central. Like many beekeepers, especially beginners as we are, we have had a high amount of hive losses. Some of these losses have been very easy to identify. For example in the Gulf Coast the invasion by tropical fire ants (Solenopsis geminata) has been devastating to many desirable species  -- and they definitely do kill new bee hives. Other causes of colony collapse in our hives have been hard for us to diagnose. And even harder to catch early enough to help the hive recover.

We looked at other bee hive monitoring projects and they all provided interesting data, like the number of bees entering and leaving. But we do not know how to translate this to the ongoing health of the colony. Forager bee count data can be strongly influenced by things like climate, temperature, rain, cloud cover, amount of pollen providers, etc. What we hope is that we can initially use hive weight changes to provide a more direct indication of what is going on with the overall colony.

All of this leads to a number of questions that we hope to answer with the data from this project. Some of these questions will be explained in the project log.

____________

How will we do it?

Our hope is that we can create a consistent method of data collection so that it can be shared with other bee enthusiasts and compiled for analysis across many environmental conditions and locations.

On the hardware side our prototype monitors are progressing. We are using as much Consumer Off The Shelf (COTS) items as we can. For the scales we have selected some that have seamless stainless steel tops that roll over the edges to prevent water drip lines. They also have closed bottoms. The key feature is they have a detachable head that contains all their electronics and batteries. Having the power external to the scale platform is vital. You do not want to have to move an active hive to replace batteries.

The original scale head is cut off and replaced with our hardware system. This system consists of input conditioning for the scales and other sensors, the Microcontroller Unit (MCU), the power system, and an external WiFi antenna.

These monitors then send MQTT data packets as clients over their WiFi connection to the local network. In a remote location we have a Raspberry Pi that acts as an MQTT broker and general server. This server also contains an Ifluxdb database instance for data logging. Grafana also runs on the server to display the data.

We have also set up a free test account with Adafruit.io (Many thanks Adafruit for doing this for the community!). This will allow us to mirror the data to Adafruit and  have remote access to it without having to configure routers, write firewall rules, etc. Once complete we can share the data in the public cloud(s).

Future enhancements may be to use a LoRa gateway to enable the hives to be monitored further than WiFi can conveniently reach. We are also considering a mesh WiFi approach using an ESP8266 intermediate repeater, but this is less desirable due to the "bowtie" effect and requirement for additional solar/battery power system.

____________

What is your approach?

To date we have been making progress on the prototype systems. We have a simple mechanical arrangement to keep the hives on the scale platforms, protect the scale, and keep the whole arrangement solid and level. We have tested a number of sensors, displays, modules, and ESP8266 development boards. This has led us to our current configuration. We are now integrating everything and beginning work on the mechanics of enclosures, weather resistance, etc. We are building and testing the implementation as we go. There are many items left to program, build, test, and correct before a robust, reliable system is working. That process is what we expect to detail in the project log.

  • 1 × Weather resistant, load cell based scale Any scale can be used as long as it has suitable weather resistance, good structural strength, and strain gauge internal measuring devices
  • 1 × HX711 A/D amplifier-digitizer IC (or breakout module)
  • 1 × ESP8266 based development board and case
  • 1 × Raspberry Pi (or equiv) Single Board Computer
  • 1 × SHT21 Temperature/Relative Humidity sensor [optional]

View all 8 components

  • Software and Remote Data Logging

    sparks.ron04/16/2021 at 22:10 0 comments

    Completely rewrote the software to make it more modular based on the process flow. This took a major effort, but will allow for future modifications and customizations. It will also increase reusability for my other projects, like the weather station. There is still a long to-do list of things the software needs like OTA updating, moving of data and credentials to the data section of the ESP8266, etc. But it is currently useable and has been working without a problem for the last few months with a temperature sensor only. Work still needs to be done to better understand the non-linearities of the scale and what is causing them.

    Last month the data logging software I am using, InfluxDB, had a breaking version upgrade from 1.x to 2.0. Unfortunately I had the automatic update feature working on Docker and it messed up the system. I am now creating two instances, one 1.x and one 2.0, in order to try to recover the data fully as it seems that is what is recommended for a manual upgrade as well.

    The bees survived the winter and the arctic blast without a problem. It dropped to -12F (-24C) here for at least a day and was below freezing for a week. That may be normal for some places, but the animals and plants in Southeast Texas are not in any way prepared for that. Never mind that the power went out for days. Here at our place it was out for 2 1/2 days. However, here in the Houston area we get a LOT of unexpected weather surprises (hurricanes, tornados, ice storms, hail, high heat and humidity, etc.) so you learn to be prepared and resourceful. I put sugar water feeders on the hives the first day I could so that they would have the extra food to keep moving and heat the hive enough. I guess Texas bees are as hardy as most Texans.

    This project will continue to be down the priority list for a while to ensure I have time to prepare for hurricane season before the summer heat starts up in mid to late May.

  • Slowly moving forward

    sparks.ron10/30/2020 at 02:21 0 comments

    Well, we have the HX711 and scales figured out but each set seems to require its own calibration. For the scales we were converting the actual performance is a curve (exponential) and not a straight line. The two github HX711 libraries we tried are linear approximations only and do not work over the full range of the scale. The solution is to approximate the response on our own, which we have done. First you access the raw ADC reading from the HX711 and then plug it into our exponential curve equation. The ESP8266 has the needed exponential and logarithmic functions to handle this easily. For you math lovers the best fit equation is in the traditional exponential form Rdg = A*exp((wt-mu)^2/(2*sigma^2) where wt is the actual weight on the scale and Rdg is the corresponding ADC raw value. For our first scale the constants were A = 69,470 mu = 301.48 sigma = 88.42 Our next test is to install the clone controllers on the other modified scales and see how much these constants vary from scale to scale. Once that is done we can deploy them under the hives and start real world testing. After all this complication with the sensors and ADC, we have decided we will hold back one unit and put it on a mounting frame with a constant fixed weight on it. That will give us a control to use to back out any noticeable variations due to temperature, etc. The whole focus for these scales is on the relative changes day-to-day and not the absolute accurate weight. If we can just reliably tell the change in weight, that can be plotted over time and give the answer we need about hive size and honey production/use. Another thing that was accomplished this summer was extensive continuous real time data collection for temperature and humidity. Both the Sensirion and Honeywell sensors did well in our hot and humid environment. Neither one showed any signs of saturation even though they often experienced 97-100% RH. An old queen cage has been modified to hold this sensor for placement inside the hive. We are still looking for a suitable wiring option and will be testing 4 conductor ribbon cable, Cat5 Ethernet cable, and 2 shielded 2 pair audio cable. The winner will be the approach that has the easiest mechanical installation combined with no signal degradation. The software was completely rewritten this summer to allow easy changing of sensors, MQTT broker data, WiFi data, etc. Now that the program is modularized, the next step will be to convert the various functions and move them out to a library where that makes sense. The long term goal is to have the main program hold all the needed data that will change from unit to unit and the library(ies) hold all the computation, communications, and control functions.

  • High Humidity Sensors

    sparks.ron07/27/2020 at 17:04 0 comments

    I do not want to double post so the link below will point you to the relevant text for this topic. The TL;DR is that the DHT21 type sensors will not reliably work outside in any place that regularly sees relative humidity above 60%. That makes it a poor choice for the inside of a warm bee hive.

    The SHT21 from Sensirion and the HDC1080 from TI seem to be good value sensors that have successfully passed our testing at humidities in the 95-99% range.

    See the full description at:

    Environment Monitor Station Log - Humidity Sensors


  • Wrestling with the HX711

    sparks.ron06/30/2020 at 03:18 0 comments

    Finally, we got the HX711 reading correctly. Still don't know whether the problem was with the HX711 or the scale/load cells we were using, but they refused to operate correctly at 3.3.v. We confirmed, from the Expressif official, that the ESP8266 is 5v input tolerant. The solution to our woes was to simply move the supply for the H X711 to +5v instead of 3.3v. Then everything worked fine, irrespective of whether we had modified the module for 3.3.v or not! At this time, in a controlled temperature, the scale is showing a 0.03% standard error (95.7 percentile). It was necessary to go to the raw Analog read function to ensure we were getting the correct data without any intervening HX711 adjustments.

    When we did a least squares fit to various calibration weights, the equation was beautifully linear . Going forward, we will likely use these "raw A/D" numbers and do our own calibration adjustments just to avoid the unknown and ambiguity that the chip adjustments add to the calculations.

    Based on these results it is now time to "polish" the software and begin final deployment. In the interim we may create a new calibration program though. It will be based on the raw A/D data.

  • Software Rewrite & HX711 woes

    sparks.ron06/24/2020 at 18:00 0 comments

    We have now completed a major software rewrite from the prototype software. As with most prototypes it had been written in a "good 'nuff" method to quickly test the various hardware and internet protocols, but had little (or no) error checking, fall back options, etc.

    The new software is structured to allow it to be modular and when each piece is fully operational it is extracted from the main loop and put in an appropriate function with the main loop calling that function.  This paves the way for the functions to be put into library module format for better management, reusability, and isolation.

    In the process we added support for either of two types of temperature-relative humidity sensors. As noted earlier, testing of the DHT11/21 sensor showed it is useless for outdoors in coastal climates. Most of the summer, our night time humidity is well above 70%. That is the point where the DHT sensor saturates and reads 100%. It then requires the humidity to drop to about 60% for it to begin working again. In the summers here, that may not happen for many days. We have not yet completed testing on the SHT21 and HDC1080 sensors, but the early results are promising.

    Most of the time with hardware has revolved around the HX711 A/D module. First as noted by Ken Meyer in his excellent project log Modifying the HX711 for 3.3v operation, the module fails to regulate voltages properly when run on 3.3v instead of 5.0v. The result is wildly varying scale readings. While his log was clear (thanks to pointing out a datasheet error), how it all worked was not obvious for us. It took a bit of measuring and soldering/desoldering to be able to understand it all. We then created a spreadsheet to properly calculate things. In our case piggybacking the 20k resistor with something between 20k-22k worked perfectly. However smaller values did not. This means there is a lower bound as well as the upper one. The upshot is that for our modules the larger divider resistor value (singly or in combination) must not be lower than 10K or higher than 11.5K in order to maintain proper regulation.

    Now we have excellent calibrated performance at a single point and zero. However, other issues will remain. Temperature stability, load cell "creep", power use, software OTA updating, etc. are all upcoming issues.

  • Slow progress, but progress

    sparks.ron01/01/2020 at 22:25 0 comments

    Fall and winter are always busy times here in the "third coast". The weather finally cools off enough to allow outside activities to happen without all the humid, hot misery. It is a bit reversed to the northern US. We have times in the summer months that are just brutal and make it advantageous to do inside projects, like software coding.

    The hive monitor prototype was finished and the first software implementation is working. But the cooler weather has moved priorities to the outside portions. We moved one hive in late August to bring it out of a remote field and put it with the other hives in a new site closer to the house. That will hopefully, allow the little Robotdyn ESP8266 boards to communicate with the WiFi network without a lot of extra RF engineering. We also built a new hive support frame setup that includes several fire ant and beetle exclusion systems. That seems to have helped enormously and kept the hives we still have alive through the worst of the pest season.

    I am still working on the issue of strain gauge creep that occurs when the scales are kept under load continuously. Thus far it seems that once they have time to "settle in" the curve goes asymptotic and the resulting measurements are remaining stable with the 10 lb (4.5 Kg) calibration weight. After 12 months outside and 4 months in the lab with the weight applied continuously, the variance is in the ±0.5 lb (0.2 Kg) range.

    One other item that had to be resolved was the conversion of the HX711 module from 5v to 3.3v. This was causing random glitches and was a pain to find the root cause. But once identified we had a "forehead slapping" moment and felt a bit dumb. The thing that obscured the problem was that the interface pins on the HX711 worked fine at the lower voltages, but the internal amplifier didn't. The fix was a simple bridging of one divider resistor with a second one of identical value. I will show this mod in the next update.

    In the meantime I wish all of you the best and most prosperous New Year and New Decade (from all of us who use a Gregorian mode 0 calendar).   :-)


  • The key to the Project

    sparks.ron08/15/2019 at 23:20 0 comments

    The first step of this project is the selection of a suitable scale or load cell platform. You can certainly make your own for less money than buying one and modifying it. If you have a 3d printer and wood, plastic, or metalworking ability, then if you have the time and interest by all means make one. You can get inexpensive load cells from the usual vendors and mechanically all you need to do is create a platform that is fully supported by one side of the load cell and a base that is the support underneath it. We decided that our time was more useful in building the rest of the system than reinventing a platform system that someone else had engineered and manufactured.

    Either way, here are the key items we felt were important  to have in the mechanical system:

    • Corrosion proof (or at least resistant). This will be in the open elements and underneath the hive where dirt and debris can collect. Constant temperature changes and humidity will destroy accuracy in a system that is weather sensitive.
    • No edges that can catch water or moisture runoff.
    • UV resistant. For the same reasons as corrosion, the sun will be impinging on the setup and will quickly degrade many (most?) plastics unless they are coated.
    • Non-toxic. It goes without saying that in a place where sensitive bees are making food you will eat, you do not want unknown plastics out gassing or such.
    • A large enough platform to hold the hive without it rocking, moving, or being unsteady. We found that 14 in by 16 in (35 cm by 41 cm) was a minimum for our hives.
    • Direct access to the load cell circuit. In commercial scales we have found this is the case all those with a controller/display separate from the scale with a cable connecting it to the platform.

    Here is a picture from an Amazon listing for a scale like the ones we are using:

    Notice that it has no edges or seams in the stainless steel platform. It is a press fit to the plastic base and covers it well enough to protect it from most UV. It also separates any plastic away from the hive bottom and leaves a fully ventilated area underneath. On this unit, the bottom was very nearly sealed with the load cell feet in protected recesses. After one year outside we have seen no degradation in our to test units.

    You can see from the pictures that we use a couple of different methods of supporting the scale and then fitting the hive to the top of it. One important facet of the hive mount is that it does not sit tightly down on the scale. This is to allow air to move freely below the hive and above the scale. One of us uses screen bottom hives and this arrangement also allows a very quick check for Varroa Mites. This invasive pest is wreaking havoc on hives all over the US.

    Once you have your mechanical arrangement (scale) and hive mounting system, you can then proceed with the electronic part. More on that in the next log.

View all 7 project logs

Enjoy this project?

Share

Discussions

VASILIS VORRIAS wrote 02/07/2022 at 10:03 point

Hi, Excellent project. Bees needs attention otherwise there will be no bees and that will affect our food supply too. I started designing a similar project 5 years ago (with a similar concept) but then other obligations took me of the project and merely abandon it

What is the status of the this project today? I am also interesting on the environmental matter of the project . Sensing environment in hush conditions is not an easy thing and we have problems too on that field in our environmental M10CUBE project.

https://hackaday.io/project/171770-m10cube/log/185946-m10sensor-build-and-working

Now redesigning with Raspberry silicon R2040. Our new design will measure pollutant gases as well.

I believe LoRa is a candidate for the communications since it is low power and that is needed to save batteries and power it from a small PV.

Our thinking back then was to have only one LoRa  transmitter for long range communications and a local mess network (Zigbee, Matter, etc) to send to the local LoRa station

Anyway I would like to join and help as my free time permits so both our projects can benefit

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates