LabVIEW Student Design Competition

cancel
Showing results for 
Search instead for 
Did you mean: 

Weight my Bees: Measuring Beehive Weight to Monitor Colony Health

Contact Information:

Country: United Kingdom
Year Submitted: 2018
University: The University of Manchester
List of Team Members (with year of graduation): Viktor Pankov (2018)
Faculty Advisers: Prof Bruce Grieve
Main Contact Email Address: viktor.pankov@student.manchester.ac.uk

Project Information:

Title: Weight my Bees: Measuring Beehive Weight to Monitor Colony Health
Description: Remote beehive weight measuring systems that helps scientists and beekeepers study the devastating effects of Colony Collapse Disorder.
Products: 

NI Products:

NI myRIO 1900

myRIO LabVIEW 2017 Software Bundle 

 

Non-NI:

2 x 50kg 3-wire Load cell

Protective pressed metal casing for load cells

HX711 programmable gain amplifier (PGA)

EPCOS B57164K103J thermistor 

10k Ohm 2% tolerance resistor 

Wiring 

Power tools 

System Deployment Test.jpgSystem Deployment TestThe Challenge:

Honey bees are the world’s most numerous and important pollinator. They pollinate 1/3 of all food consumed and contribute over £200 million to the UK economy each year.

However, in recent years their populations in North America and Europe have been steadily declining. This phenomenon is now known as Colony Collapse Disorder (CCD) and scientists still do not have a clear understanding of it. This project aims to create a commercially viable beehive weight measuring system to help scientists and beekeepers remotely monitor colony health and further understand CCD. 

graph.jpgFigure 1: Bee colony decrease in the past 50 years
Wait what? He wants to weigh beehives? This guy's definitely lost it. 

My sanity after 4 years of engineering school is debatable, but the reasoning behind beehive weight monitoring is sound, because bees, just like human, follow daily patterns. Your commute to work/ school in the morning is equivalent to worker bees leaving the hive in droves in the early hours of the day to look for nectar and pollen (figure 2). Then as the day draws to a close they return home for some well deserved rest, just like you do (figure 2). That means that throughout the day the weight of the hive will vary according to a specific pattern - that's really what figure 2 is all about. Now think about what happens to your nice timetable when you get sick. I know mine goes out the window because all I can and want to do is eat soup and watch Peaky Blinders on Netflix.  When the bees are sick with a nasty varroa infestation, one of the major suspects for CCD, they also drop off schedule. Less of them go out collecting honey and their rate of reproduction plummets. Both of these changes are tightly coupled with weight and if you have a handy device that measures that weight you can spot the pattern and help out your infested colony. So as I said before, continuous beehive weight measurements are a sound idea.

 

2times.jpgFigure 2: Beehive circadian rhythm 

Trouble is that contentious weight measurements are a bit tricky. Weighing blue berries for your cheesecake or yourself on the electronic bathroom scales after you've had that cheesecake is quite easy. You step on, look down, promise yourself that you'll go to the gym next week and then step off. It's all said and done in the matter of seconds and that's how electronic scales manufacturers want it to be. They've specifically design these devices for high precision, but with little to none continuous measurement capabilities. Put a bag of potatoes on your bathroom scales and come back in hour. I guarantee you that it won't weight the 4.56 kg it did in the beginning and that's not because one of your flatmates has taken one of the potatoes just to mess with you. It's actually caused by this unfortunate property of materials called creep. Basically, materials tend to deform under constant stress and that's a problem for electronic weight measurements because they are based on registering tiny deformations in materials using strain gauges.

 

"So if the weight of that bag of potatoes won't stay still for an hour how I am supposed to reliably measure the weight of a whole beehive for days on end?" lifted from Viktor's journal one week into this project

 

Actually it's not that bad. Keep on reading to find out how you can do your part in saving the bees!

 

The Solution:

The plan is as follows:

1. Figure out a way to electronically measure weight using your myRIO

2. Try your best to make the readings as stable and precise as possible

3. Simulate hive like behaviour in your living room 

4. Find a hive and try out your system. 

 

1. Figure out a way to electronically measure weight using your myRIO

You're going to have to do some reading. I suggest you start with the NI whitepaper on strain gauges, as these tiny devices are the main method of weighing anything in our day and age. Now that you're all read up go and buy some load cells and fashion something that looks like a bathroom scale. Sounds a bit difficult doesn't it? I thought so as well. That' why I bought some high end off the shelf scales and retrofitted the load cells inside. I bought this lovely set and made quick work of the insides. It came with 4 load cells, but I only need 2 to form the half-bridge Wheatstone circuit - figure 3. 

Full bridge from above 1 with Comments.jpgFigure 3: Load cell half bridge

That's the analogue part sorted, but you still have to feed those readings into the myRIO. Using the on board ADC isn't your best bet. The signal from the bridge is in the mili-volt range, so you're going to need to amplify it firsst. This is where that programmable gain amplifier (PGA) comes in handy. The HX711 PGA is a lovely cheap & cheerful choice for this endeavour. It uses a custom serial communication protocol that vaguely resembles SPI. It's quite easy to interface to it using the myRIO FPGA for precise clocking. The chip reads the tiny output from the bridge, amplifies it and then sends that reading over as a 24-bit word to the myRIO. Don't worry too much about how exactly that happens. Just make sure you wire everything as show in figure 4 and the attached code will take care of the rest. The load cells have an active gauge positioned along the direction of strain and a dummy gauge that lies in a perpendicular plain. You'll know that you've wired everything up correctly if readings from the bridge increase when you depress either load cell. 

 

myRIO Connections.jpgFigure 4: Connection Diagram

At this point you should be getting digitised bridge readings on the myRIO. Now convert them into weight by dividing the ADC reading by a conversion coefficient and multiplying by a scaling factor that gives you the resolution of the system. 

𝑊𝑒𝑖𝑔ℎ𝑡= 𝐴𝐷𝐶 𝑅𝑒𝑎𝑑𝑖𝑛𝑔 / 𝐶𝑜𝑛𝑣𝑒𝑟𝑠𝑖𝑜𝑛 𝐶𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 ×𝑅𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝐹𝑎𝑐𝑡𝑜𝑟

For example, with an 𝐴𝐷𝐶 𝑟𝑒𝑎𝑑𝑖𝑛𝑔 of 16,000, a 𝑐𝑜𝑛𝑣𝑒𝑟𝑠𝑖𝑜𝑛 𝑐𝑜𝑒𝑓𝑓𝑖𝑐𝑖𝑒𝑛𝑡 of 80 and a 𝑟𝑒𝑠𝑜𝑙𝑢𝑡𝑖𝑜𝑛 𝑓𝑎𝑐𝑡𝑜𝑟 of 0.005 then according to the equation above the registered weight would be 1 kg.

Now on to step 2.

 

2. Try your best to make the readings as stable and precise as possible

This is the part where you notice that your scales aren't all that good at continuously recording weight. I put a 1 kg bag of rice on mine and was shocked by the result in figure 5. The blue line is weight and it uses the left hand axis, while the orange is temperature and that's on the right hand axis. There's a clear relationship between registered weight and temperature. As the temperature goes up, so does the perceived weight of the 1 kg bag of rice. With a mean reading of 1.20 kg and a standard deviation of 0.35 kg this performance is undesirable, but expected. Remember creep? This is what its temperature dependent variation looks like, but this manageable. To alleviate the situation we need to actively compensate for changes in temperature.  

 

1kg no compensation.jpgFigure 5: 1 kg load with no temperature compensation

Now you need to add some form of temperature recording. I opted for a thermistor. Read through section 8 of the NI myRIO Embedded Systems Kit guide book. It covers all you need to know about thermistor temperature measurements. I highly recommend watching the NI Youtube series on thermistors. After you've set up the measurements you're going to want to map changes in temperature to changes in that conversion coefficient that I mentioned in the previous section. The easiest way to do this is by putting a load on the scales and having the system adjust the conversion coefficient, so that the weight stays the same. Then you need to analyse what conversion coefficient corresponds to what temperature. If things work out well you should see a significant improvement in performance - figure 6. The weight and temperature readings are decoupled. The mean reading is 1.05 kg and the standard deviation has dropped down to 0.15 kg - a sizeable improvement over figure 5. Next up - testing. 

 

1 kg with compensation.jpgFigure 6: 1 kg load with temperature compensation

 3. Simulate hive like behaviour in your living room 

We can measure weight and compensate for temperature changes. Now it's time to see how well our system performs. In the beginning of the season when there is little honey in the hives from over winter, a British Standard hive weights around 25 kg and the bees inside weight only about 1 kg. Throughout the summer as the bees collect pollen and manufacture honey, the weight of the hive slowly increases to a peak value of about 50 kg. In the same time the bee population has also increased to about 10 kg. Through the year bees represent no more than 20% of the entire hive weight. Keeping that in mind I put together a simulated beehives using: 2 fire extinguishers,  2 plywood boards and a glass drinks jar - figure 7. The water in the jar represents the bees and by dripping it out I simulated how the bees leave the hive. I let the water drip out as slow as possible for hours on end and made sure that the system can detect the change. Then a measuring cup was used to cross reference the numbers from the system. That's the design and testing done. Now it's time to find a hive!20180413_124844.jpgFigure 7: Beehive simulation

4. Find a hive and try out your system. 

Manchester is the city of bees, just look at the city coat of arms, so hives are abundant. I collaborated with Dr. Simon Harper from the School of Computer Science at the University of Manchester. He was more then happy to let me test my system on one of his hives - figure 8. The bees are still shy, as it's been quite cold in the North this spring, but I am hopping to collect real hive data in the coming months.  

20180419_142052 - Copy.jpgFigure 8: Pretty in Pink

 
Benefits of NI tools

LabVIEW allows for rapid code prototyping, which greatly reduced my development time. The only community is full of helpful examples and guides, which helped me out when I stuck. The Wi-Fi capabilities of the myRIO and it's abundance of I/O ports allowed allowed for remote access and a plethora of peripheral devices. Below you'll find screenshots of the main vi that runs on the Real Time process on the myRIO. The software reads weight and temperature, performes active compensation and then records data onto non-volitile memory.

 

RT Standalone Front Panel.JPGFigure 9: Main Front Panel

 RT Standalone Block Diagram True Case.JPGFigure 10: Main Block Diagram

Level of completion: Fully functional

 

Time to build: 12 weeks


Additional revisions that could be made:
Recorded changes in hive weight provide limited information about the overall behavioural pattern of the bees. Therefore, in the future the developed measurement system should be improved by the addition of temperature, humidity and sound recordings inside of the hive. These data sets will help paint a much more holistic representation of life inside the hive. Sound recordings inside the hive are the most promising research path to pursue, as beekeepers consistently report that the hives sound different when in distress. Creating sound profiles of hives suffering from investigations such as varroa mites can help early detection and allow for more successful treatment.

Resolution demonstration video:

The video showcases the 10 gram resolution of the device. That's 10 grams over a 50kg range - it's quite precise. 

 

Comments
Active Participant RER
Active Participant

Fantastic! You can't fix what you can't measure... and fixing the declining bee population is a critical global issue. Congratulations Viktor on this remarkably accurate monitoring system. Keep bee-ing awesome!

 

save the bees.JPG

 

 

 

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
Contributors