Onophrio
Posts: 3
Joined: Tue May 14, 2013 8:04 am

Bee hive control and observation

Tue May 14, 2013 8:14 am

Hi all,

I am an enthusiastic beekeeper (you know, the small ladies that pollinate 80% of this world's food) and I think of a way to stay informed about what is going on in my hives when I am not there (6 days a week).

I am very interested in setting up a Raspberry Pi to log the following data:

> Hive activity
• Weight of the hive (how much food is in there during spring, how much honey do they collect per day?)
• maybe sound with a given alarm-threshold, to be aware when they want to swarm

> Weather
• Humidity
• Temperature
• Pressure
• Precipitation

The most important one would definitely be the weight of the beehives. There are such things like hivescales with cellular network, but they would cost me € 1200.- PER UNIT!

Can anyone come up with a concept on how to realise this with the Raspberry Pi? The most problematic thing is how to get pressure / weight sensors that can be interpreted by the RasPi. Does anyone know a solution?

User avatar
[email protected]
Posts: 2020
Joined: Tue Feb 07, 2012 2:14 pm
Location: Devon, UK
Contact: Website

Re: Bee hive control and observation

Tue May 14, 2013 9:05 am

Onophrio wrote:Hi all,

I am an enthusiastic beekeeper (you know, the small ladies that pollinate 80% of this world's food) and I think of a way to stay informed about what is going on in my hives when I am not there (6 days a week).

I am very interested in setting up a Raspberry Pi to log the following data:

> Hive activity
• Weight of the hive (how much food is in there during spring, how much honey do they collect per day?)
• maybe sound with a given alarm-threshold, to be aware when they want to swarm

> Weather
• Humidity
• Temperature
• Pressure
• Precipitation

The most important one would definitely be the weight of the beehives. There are such things like hivescales with cellular network, but they would cost me € 1200.- PER UNIT!

Can anyone come up with a concept on how to realise this with the Raspberry Pi? The most problematic thing is how to get pressure / weight sensors that can be interpreted by the RasPi. Does anyone know a solution?
I'm actually looking into this for a local beekeeper to me as a small project. I decided not to use a Pi, but to use an Arduino for it - mostly due to wanting to run it off batteries for weeks at a time rather than hours... Unless you can get power to the hives though.

Hive Weight is the biggest issue - I'm looking at some force sensitive resistors as a cheapish solution, but putting 4 of them on a hive is a problem - the other way might be to hinge 2 legs and put the 3rd on-top of the sensor. (These are top-bar hives, so we could put 2 legs on one end, and a single one on the other).

The other issue is that anything you put inside will get covered on propolys pretty quickly! Not really an issue for a temperature sensor - it'll just slow it down a little, but an issue for a pressure and humidity sensor, so locating these out of the colony area might be prudent.

It's a fascinating area though!

-Gordon
--
Gordons projects: https://projects.drogon.net/

Onophrio
Posts: 3
Joined: Tue May 14, 2013 8:04 am

Re: Bee hive control and observation

Tue May 14, 2013 9:40 am

Hi,

thanks so far. I was aiming at the Pi, as a friend of mine has realised some projects with it and he might want to help me out in case I encounter problems. However, he has no clue on how to deal with the weight issue.

The sensors for temperature, humidity etc. are no problem at all, because I am not so much interested in the data inside the hive but rather on weather data. Precipitation and cool temperatures might be an explanation if there's no honey coming in => no reason to freak out being some 100 km away.

For the force-sensitive sensors: I am using a type of hive being quite common here in germany (Zander), which I can put on basically everything I want. So I can imagine a construction with the hive "sitting" on one single sensor.

Would your results from the Arduino be transferable to a Raspberry Pi? I don't have electricity either, but I think of using a car's battery and a solar cell, which would be ok I guess for the whole summer.

User avatar
penguintutor
Posts: 376
Joined: Tue May 08, 2012 9:11 am
Location: UK
Contact: Website

Re: Bee hive control and observation

Tue May 14, 2013 9:47 am

A few ideas.

Starting from basics you'd create a platform that could flex slightly and put 4 strain gauges on in the form of a wheatstone bridge (4 identical sensors are required to provide a measurable signal and also to counteract the fact that the sensor readings would also change when the temperature changed). You'd then amplify the signal, put it through a Analog-to-Digital converter (ADC) and connect it to the GPIO.

You can buy strain gauges as below:
http://uk.rs-online.com/web/c/automatio ... in-gauges/

Rather than build this from scratch you can buy these as a weight sensor
http://proto-pic.co.uk/load-sensor-50kg/ . These have two strain gauges inside so you would need two of these - one as a dummy to complete the bridge and one to take the weight (there is a guide on that site). You would still need the amplifier and ADC. There's also an example here using a standard bathroom scale http://www.nerdkits.com/videos/weighscale/ instead of using a micro-controller that they use you can connect to the GPIO through a DAC as above.

Another idea which may work would be to use a Wii Balance board. I haven't tried these, but others have connect the Wii remote to the Raspberry Pi. The Wii controllers (including the balance board) use Bluetooth to talk to the Wii - so you can put a bluetooth donge in the usb port and communicate that way. More expensive than the bathroom scales, but much cheaper than the commercial bee hive scales.

There is a guide here http://www.mattcutts.com/blog/internet- ... and+SEO%29, which is for Linux, not specific to the Raspberry Pi. There are other guides on using the Wii Remote with the Raspberry Pi - which you should be able to find on this forum / Google.

You'd obviously need some way of keeping the balance board waterproof, but that could be just a thick polythene bag or similar.

timr
Posts: 22
Joined: Wed May 30, 2012 10:11 am

Re: Bee hive control and observation

Tue May 14, 2013 10:43 am

There are a few articles around about hacking digital bathroom scales: There seem to be several approaches, taking the analogue signal, or even decoding the signals driving the lcd. It might make some of the mechanical aspects easier... or not. There might be issues with being outdoors, for example, or zeroing. But it might be worth considering.

turtletraction
Posts: 1
Joined: Tue May 14, 2013 11:44 am

Re: Bee hive control and observation

Tue May 14, 2013 12:47 pm

Hello,

Just thought I would share www.tinkerforge.com, an open source hardware platform.

They have a weather station and other buts that can be connected to practically anything that has a digital io.

All the bits can be hooked up to a RPi, I am planning to build a "garden" control systems with their parts.

As a starting point I might use their weather station starter kit as based together with a RPi.

http://www.tinkerforge.com/en/blog/2013 ... er-station

Cheers,

Kristoffer

Onophrio
Posts: 3
Joined: Tue May 14, 2013 8:04 am

Re: Bee hive control and observation

Wed May 15, 2013 12:03 pm

Understood so far. Considering a beehive weighing approx 60 kg at some points during summer, this 50 kg load cell seems suitable. I would have to hook it up to a Analog-Digital-Converter anyways, right?

Would these tinkerforge things be suitable as an ADC or did you mean to use this as standalone, Kristoffer?

In any case, I would have to calibrate the weighing unit, right? As mentioned before, I have absolutely NO idea on how to do this, as I am more a beekeeper than a programmer. I friend of mine could help me out, but I would like to understand what I need in order to ask him "properly", if you know what I mean.

raspbear58
Posts: 2
Joined: Thu Oct 11, 2012 9:28 am

Re: Bee hive control and observation

Sun Sep 15, 2013 1:14 pm

could this amplifier help?
http://www.leobodnar.com/products/LC-amp/

or even better:
http://cerulean.dk/words/?page_id=42
with the help of an amplifier type INA 125 (Texas Instruments)?
I think an easy and inexpensive method to know weight ups and downs of a beehive could interest a lot of beekeepers.

andyseubert
Posts: 3
Joined: Mon Jun 10, 2013 10:21 pm

Re: Bee hive control and observation

Thu Sep 19, 2013 12:43 am

here is some python code for reading a USB scale
(sorry about the indenting)

Code: Select all

VENDOR_ID = 0x0922
PRODUCT_ID = 0x8004
DATA_MODE_GRAMS = 2
DATA_MODE_OUNCES = 11

# find the USB Dymo scale devices
devices = usb.core.find(find_all=True, idVendor=VENDOR_ID)
for device in devices:	
 if device.is_kernel_driver_active(0) is True:
  device.detach_kernel_driver(0)
 devbus = str(device.bus)
 devaddr = str(device.address)
 productid=str(device.idProduct)
 try:
## set USB device endpoint here
					endpoint = device[0][(0,0)][0]
					# read a data packet
					attempts = 10
					data = None						
					while data is None:# and attempts > 0:
						try:
							data = device.read(endpoint.bEndpointAddress, endpoint.wMaxPacketSize)
							if debug: print "data: "+str(data)
						except usb.core.USBError as e:
							data = None
							if e.args == ('Operation timed out',):
								attempts -= 1
								print e
								continue
					
					# The raw scale array data
					#print data
					raw_weight = data[4] + (256 * data[5])

					if data[2] == DATA_MODE_OUNCES:
						ounces = raw_weight * 0.1
						weight = "%s oz" % ounces
					elif data[2] == DATA_MODE_GRAMS:
						grams = raw_weight
						weight = "%s g" % grams
						
					reading = weight
					if debug: print "raw reading '" + reading +"'"
					readval = float(reading.split(" ")[0])
					readunit = reading.split(" ")[1]
					## if the units are ounces ("oz") then convert to "g"
					if readunit == "oz" and readval !=0:
						readval = readval*28.3495
						if debug: print "converted oz to g"
					if debug: print "current weight : '" + str(readval) +"' "+readunit
					if debug: print "current time   : "+strftime("%Y-%m-%d %H:%M:%S", localtime())
					

gtoal
Posts: 111
Joined: Sun Nov 18, 2012 12:02 am

Re: Bee hive control and observation

Sat Mar 18, 2017 5:47 pm

Wii Fit boards are now around $25 (or $15 occasionally if you can find a good sale on) and they'll work great for this project. We're in the process of adding one to our "Electric Hive" project. They do have a problem with requiring a bluetooth sync every time you power it up but that can be easily worked around using a relay and there is a rumoured software solution I haven't been able to replicate yet. Right now we're in the process of deciding whether it's practical to make the wii board double as our electronics enclosure rather than our current design which uses a telephony-style external waterproof box. The wii board isn't IP66 but there are skins available for it which look like they would be fairly good for keeping out water from above, as long as the water level below never rises as far as the board. So a little woodwork needed for a robust implementation but nothing expensive.

btw for power we are using Power over Ether for now. Not sure what we'll do when when we have to go entirely off-grid.

Return to “Automation, sensing and robotics”