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.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
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?
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)] # 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 + (256 * data) if data == DATA_MODE_OUNCES: ounces = raw_weight * 0.1 weight = "%s oz" % ounces elif data == DATA_MODE_GRAMS: grams = raw_weight weight = "%s g" % grams reading = weight if debug: print "raw reading '" + reading +"'" readval = float(reading.split(" ")) readunit = reading.split(" ") ## 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())