# My digital hive weight logging project



## Deamiter (Jul 21, 2009)

I've always hoped to join the NASA HoneyBeeNet program that relies on volunteer submission of daily hive weight to track nectar flow at dozens of sites across the country. http://honeybeenet.gsfc.nasa.gov/ The understanding of nectar flow nicely complements satellite tracking of vegetation coverage for modeling of climate change, the effects of land use changes, or even how invasive plants and animals are likely to spread.

As a hobby beekeeper with two toddlers, I would also find it extremely helpful to know when nectar is flowing so I can add supers when needed without making unnecessary trips to check the hives' progress!

There are a few rough guides to digital hive scales on the internet, and http://hivetool.org/ demonstrates the type of high frequency (every minute or so?) data that can be collected. However they either rely on cheap digital scales that drift significantly with temperature, or they require outlet power and a PC to run. This is great work, but I don't have a wife that allows bee hives within feet of a power outlet.

I've designed the system around the following requirements:
- Record hive weight and temperature as well as ambient temperature every 1-5 minutes.
- Send data to thingspeak.com for backup and graphing of data.
- Log to micro SD card with a timestamp for reliable backup.
- Power with solar panels and lead-acid battery

*I'd be interested in feedback on what's important or interesting to monitor. I'm particularly interested in helping others get their own hive logging systems running to add to the NASA dataset. I'll be writing up a guide (probably on instructables.com) with a complete part list, and I could also put together kits or complete systems by next spring if there's interest.*

This isn't a sales pitch. I want to support anybody who's interested, but I'm more interested in feedback on what could be improved. Here's more details on the project. I welcome criticism or suggestions!

*The Core microSD datalogger:*

I've designed the system around the CPWPlus200 scale used at HiveTool.org, and while it's a bit pricey at $160, it's valuable to me to start with a scale I know will work. After some google research, I think I've found a cheaper shipping scale for $80 that might work just as well, but I won't know until I try it, and I'm focusing on finishing the first prototype before trying to reduce cost.

The logging microcontroller is an Arduino Uno that uses a real-time clock to log an accurate timestamp to the SD card. It talks to the scale via simple serial communication (an important feature that seems to add around $20 to the cost of the scale). I'm using 1-wire temperature sensors so I could add as many sensors as I'd like without complicating the wiring.

All the electronics (minus the temp sensors) fit inside the scale, so while I'll be building a cheap wooden frame to hold the scale, as long as it doesn't get submerged, it'll be relatively weather resistant. The scale is only rated down to 32F, so while I think it'll be possible to run through the winter with some extra care and risk, I'm planning to pack it in the honey house for the winter.

With the scale, this basic system that logs to a microSD card cost me around $290 including the $160 scale. That hurts, but I'm hoping future versions can be closer to $200 with a cheaper scale. It could be powered with an extension cord, and maybe even log to a PC like many others have done.

*Wireless logging to the internet*

To add wireless datalogging to a free internet service at thingspeak.com (there's others out there like cosm.com etc... that would work just as well) I've used XBee radio transmitters. The low power versions I'm using have a max range of 120m (390ft) but realistically, they're going to be limited to a third or a half of that if transmitting through trees or walls. It's relatively simple to add repeaters, and the remote radio (with a repeater) can be upgraded to 1+ mile range (with line of sight) fairly simply by using a more powerful chip.

I've used a ConnectPort X2 to transfer the signals from the hive directly to the internet via an ethernet cable (connected to your home network) for $108. WiFi versions exist, and you could even use another XBee radio with a computer to relay the data if reliability of the connection wasn't a major concern (the SD backup could always fill in gaps in the internet data).

With the ConnectPort, the wireless electronics cost me around $190.

*Solar Power*

Solar Power is a big question mark at this point. I plan to us a 12V trickle charger with a 12V lead-acid battery sized to the final measured power draw of the system. The voltage regulator built into the scale can easily take 12-18V (rated to 36V) so connecting straight to the battery and charger should be fine even when it's charging (12V lead-acid batteries run at 12.6V when fully charged down to under 12V when discharged, but they charge at up to 17.8V, so it's important to consider the charging voltage if you're going to hook up electronics to a charger and battery!).

The scale draws about 20ma, I'm guessing the microcontroller will draw under 50ma, and the radio will draw 45ma when transmitting (sleeping 95-99% of the time) so I'm hoping I can keep the entire system drawing well under 2ah per day. 

Using some conservative numbers in this calculator: http://www.batterystuff.com/kb/tools/solar-calculator.html it looks like I'll need a 20W panel and a 25ah battery to give me 10 days of backup.

I'm penciling in $200 for the solar system (panel with charge control, wiring, and battery) but I think it will be closer to $100 if I can really run it on a 20W panel. Of course power draw may increase if my scope creeps...

*Counting Bees* (aka: scope creep)

About a month ago, user Hydronics posted the following guide to counting bees going in and out of the hive using a couple of proximity sensors! http://www.instructables.com/id/Honey-Bee-Counter/

Knowing exactly when bees are moving in and out of the hive seems like the sort of thing that could be incredibly useful to a beekeeper (you could set up a text message alarm for when 30k bees suddenly leaves the hive to swarm in the middle of the day). That said, it'd roughly double the power draw of the system and it'd cost around $150.

I'm almost certain to add it to my hive eventually -- I've got plenty of time before the hives wake up next spring to try to reduce power and I can wait on purchasing the solar panels or battery until I have a solid measurement of total power draw.


----------



## mmmooretx (Jun 4, 2012)

I looked into the EU systems but at 1 K per hive way too much. On the solar take a look at the ones used for game feeders like Moultrie, batteries too. Here it is certainly driven by current utilization.

http://www.moultriefeeders.com/productdetail.aspx?id=9005

Are you looking at WIFI/Bluetooth for data transfer, or USB/ SD dtata transfer? I am interested in tracking your project if you are starting a list. Having data for flow start/stop, swarm, and straight weight gain/loss would be nice, if affordable. Time tagged/dated data would be nice. Does Goddard SFC have a data format requirement?

Update, one of my drivers will have to be a system that supports SBB so the misc. items can fall straight through the screened bottom.


----------



## Deamiter (Jul 21, 2009)

I saw some references to the EU logging system, but I figured it'd be much more expensive than "only" $1k. It looks like the parts for my prototype (minus bee counter) will come to around $600, so $1000 is actually not bad at all for something warranteed and engineered with a profit margin!

As for data transfer (before I run off into the weeds on power consumption), all the data runs through the Arduino microcontroller. I could provide a USB data transfer for permanent installation on a computer (it could even be powered that way) but remember that the max length for USB cables is 15 ft, so the hive would have to be pretty close to the computer.

I haven't seen any simple way to upload from SD to computer on demand, so my current prototype just uses the SD card as a backup that has to be physically accessed. The primary communication is wireless via XBee cards -- a hobbyist-oriented short-range RF protocol that is similar to WiFi but sacrifices data rate for much lower power consumption. You wouldn't want to use these for surfing the internet, but they're perfect for logging data.

The XBee could log directly to a computer -- saving $75 or so -- but rather than tie up a computer (that must be always on and always ready to accept data) I chose to use the commercially avaiable ConnectPort X2 that hooks to a wired (or wireless for ANOTHER $100) router and acts as a gateway between XBee radios and ethernet.

As for format, the honeybeenet project (Goddard SFC) asks for Excel, word or rtf. I'm just logging to a text file on the microSD, and you can pull a csv file from thingspeak, and they should have no problem at all reformatting. As I work on tidying up the code, I'll be getting in touch with them to make the format as friendly as possible.

A 1GB card should be able to log data forever (a year) and in the bee yard, it'll just be a matter of pulling the hive off the scale, unscrewing 4 nuts (you did remember to bring the ratchet right?) and replacing the cheap SD card with data with another cheap empty card.

I've looked at a lot of online solar panel sources, and while it doesn't say, I'd guess those moultrie panels are only 1-3 watts -- just enough to allow a few pictures a day or to allow a feeder to operate occasionally, but not much more.

Honestly, there's a lot that could be done to minimize power consumption. For example, I might be able to put a power disconnect on the scale and remove 20ma draw when it's not being used. It takes a few seconds to start up, and I'm not sure I can make it start up automatically without hacking into the "on" button (might have to do that anyway) but if we only recorded weight every 10 or 30 minutes or so (or even only once a day) you can save a whole lot. Similarly, the bee counter is going to draw at least 20ma, but it can probably be shut down at night. I know the Arduino can go into power savings modes, so if cost is a serious concern, I bet you could save $100 on the solar panels.

Along with the $80 savings by using a cheaper scale, my design would come in under $450. It'd take some engineering, and it'd only work with some volume, but there's room for cost improvements.

In the short term, you could "easily" wire up multiple hives with just microcontroller. It'd take some work, but I bet you could get 5-10 hives drawing less than my prototype (just weight and temp -- skipping the power-hungry bee counter) by cycling them on one at a time for measurements every 5-10 minutes each.


----------



## Deamiter (Jul 21, 2009)

Sorry for all the long posts. I know that makes it harder to follow quickly, but there's so many details that are so critical, I figure it's better to get it out there on the off chance that somebody cares than to skip all the details and shut down any potential collaboration.

Toward cutting costs, that will always be a major design consideration, and I'll be working on improvements. I'm not really equipped to produce industrial-quality electronics or code, and if I were, I'd be really surprised if commercial beekeepers were interested in adding even $200 per hive to add data logging so it'd be hard to reduce costs through volume (i.e. by designing a cheaper scale that meets our needs without the expense of meeting postal standards).

For now, the best way to minimize cost is to use outlet power and either rely solely on the SD card or permanently connect via USB to a computer (assuming we can neglect the cost of the computer). The parts for that simplified design (minus bee counter -- remember that's scope creep, I haven't really looked at it yet) are only $270, and I think I can cut that to under $200 by using a cheaper scale (again, which I haven't had money/time to buy and evaluate yet).


----------



## Deamiter (Jul 21, 2009)

mmmooretx said:


> I am interested in tracking your project if you are starting a list. Having data for flow start/stop, swarm, and straight weight gain/loss would be nice, if affordable.


mmmooretx,

I've made some significant, although not particularly noteworthy progress lately. I've got the electronics working inside the scale itself, and the system transmitting data every minute or so to thingspeak.com. I'll need to add the temperature sensors back in and spend more time characterizing the scale and components (not to mention improving the code!) but it's coming slowly together.

I started a proper blog so I could have a searchable database of my thoughts and progress. You can find it at hackerbee.com


----------



## TooFarGone (Aug 19, 2012)

Deamiter,
You might want to consider a charge controller for your battery charger. I built a few of these a few years ago, they went together easily and are still working. I used them in a couple of emergency power packs with 60 watts of solar panels feeding each. I don't claim to be a solar power expert but i believe your battery will last a lot longer if it is not routinely overcharged. I think Harbor Freight has a fairly cheap solar system that is powerful enough to do everything you are looking to power.

http://www.cirkits.com/scc3/

It is probably not the only or cheapest small charge controller out there, but it works for me. Rated for 20 amps BTW.


----------



## mmmooretx (Jun 4, 2012)

Deamiter said:


> mmmooretx,
> 
> I've made some significant, although not particularly noteworthy progress lately. I've got the electronics working inside the scale itself, and the system transmitting data every minute or so to thingspeak.com. I'll need to add the temperature sensors back in and spend more time characterizing the scale and components (not to mention improving the code!) but it's coming slowly together.
> 
> I started a proper blog so I could have a searchable database of my thoughts and progress. You can find it at hackerbee.com


I have saved your blog site and will start monitoring periodically. As I am limited to 5 hives, backyard in a development, I will have hives on two stands maybe 6-8' apart. One item for consideration would be to have a main hub/electronics unit (usually more$$) then have a port to plug in "slave/dumb" scales (less$$). You would need to look at distance limitations and maximum "slave/dumb" units to plug in (probably wired units would be cheapest), but that could take the sting out of the average cost per hive (possibly).
Anyway thanks for the update and I look forward to monitoring.

Update: I found the link for the EU unit, but it is in the neighborhood of $1600 USD for the main unit and $1041 for slave units. Way too pricy for my budget...
http://www.swienty.com/shop/default.asp?catid=1226&sprog=uk


----------



## Fishman43 (Sep 26, 2011)

Deamiter, this is a cool project and I have subscribed to see how it develops. Have to conencted with the Farm Hack folks ( http://www.youngfarmers.org/practical/farm-hack/ )? I was at a project this summer they were working on to make low level baloons and drones (the power kind, not bees) to do aerial sampling of crops. The kind of project you are working on is right up their alley and open sourced creativity is an awesome thing! Thanks for posting


----------



## Deamiter (Jul 21, 2009)

TooFarGone, that's great advice. The charge controller is on my radar since even with lower wattage panels the batteries can be stressed by overcharging. I'm still holding off on fully speccing the power system until I know how much my scope will creep (and how much energy I'll need daily) by the end of the winter, but I really appreciate the link so I can look into a known solution when I get to it!


----------



## Deamiter (Jul 21, 2009)

mmmooretx said:


> I have saved your blog site and will start monitoring periodically. As I am limited to 5 hives, backyard in a development, I will have hives on two stands maybe 6-8' apart. One item for consideration would be to have a main hub/electronics unit (usually more$$) then have a port to plug in "slave/dumb" scales (less$$). You would need to look at distance limitations and maximum "slave/dumb" units to plug in (probably wired units would be cheapest), but that could take the sting out of the average cost per hive (possibly).
> Anyway thanks for the update and I look forward to monitoring.
> 
> Update: I found the link for the EU unit, but it is in the neighborhood of $1600 USD for the main unit and $1041 for slave units. Way too pricy for my budget...
> http://www.swienty.com/shop/default.asp?catid=1226&sprog=uk


You'll certainly save quite a bit by making master and slave units, and I don't think distance should be too much a problem in typical apiaries. The scale I have can only communicate at up to 9600 Baud so it should easily be able to transmit over a 100 foot or even longer cable. It only needs to transmit a handful of bytes every half hour or so, so even 2400 Baud would be just fine.

For 10-20 feet, there should be no problem with data, and while it'll get complicated to try to run 9 temp probes per box for every hive, I'm really hoping to start with one temp probe per hive until I've proven that there's some significant benefit to the hassle of mapping brood location over time.

So far, I think a slave device would be as simple as a scale, a temp probe, and a single cable (with power, ground, temp wire and Rx/Tx data lines for the scale). It'd cost up to $100 -- mostly in the scale -- but that's far from the $1041 for pro models. Of course, that pro model transmits to cell towers and is engineered to be waterproof and (hopefully) bug-free, but I think a community of hobby-testers should be able to rival that capability with a year or so of testing.


----------



## mmmooretx (Jun 4, 2012)

Deamiter said:


> You'll certainly save quite a bit by making master and slave units, and I don't think distance should be too much a problem in typical apiaries. The scale I have can only communicate at up to 9600 Baud so it should easily be able to transmit over a 100 foot or even longer cable. It only needs to transmit a handful of bytes every half hour or so, so even 2400 Baud would be just fine.
> 
> For 10-20 feet, there should be no problem with data, and while it'll get complicated to try to run 9 temp probes per box for every hive, I'm really hoping to start with one temp probe per hive until I've proven that there's some significant benefit to the hassle of mapping brood location over time.
> 
> So far, I think a slave device would be as simple as a scale, a temp probe, and a single cable (with power, ground, temp wire and Rx/Tx data lines for the scale). It'd cost up to $100 -- mostly in the scale -- but that's far from the $1041 for pro models. Of course, that pro model transmits to cell towers and is engineered to be waterproof and (hopefully) bug-free, but I think a community of hobby-testers should be able to rival that capability with a year or so of testing.



Got it. I was not sure on your interface concept (NIC, USB, RS485, RS232,etc.) Wire count, current rating, cross talk, etc. are always fun.
Temperature probe count is a real head scratcher for me. I can see one in the master unit for ambient weather, and at most two for brood temperature (assuming one for each deep, maybe 4 for the person running an 8 frame med. super only hive). 9 probes per hive sounds more like a scientific profiling study set up.
I agree on the data rate/distance call. I think two readings an hour is plenty, so a master with 4 slaves is not a lot of data with a total of 5-10 recorders sending data to the master. Probably smart to use dip switches for addressing. WIFI or pay as you go phone, or just recording to flash ram (say enough for 3 months of data to be safe) would be my vote so user can option up as needed.
Anyway thanks for the patience an I wish you lots of luck on your ambitious project!

Update: Just as an afterthought on your overall system you might want to think about how you would do software updates to your operational code, and maybe OS (not sure what you are looking at). This might be best done as a USB plug in to re flash the non-volital area of your "system code". Swapping of "updated" SD memory chips is also an option.


----------



## Deamiter (Jul 21, 2009)

Yeah, high resolution mapping of temperature is primarily just over-collecting data for science. Temperature is relatively cheap and easy to collect (once you're getting weight) but I hesitate to just throw a probe under the cover before I see reliable data showing that that's the best place for a probe and that there's something useful to be learned from it. If I see absolutely nothing significant from high-resolution mapping, I can happily throw a single temp probe in there, but it's not THAT hard to map more data for a couple hives, and at worst, I'll get some cool maps of brood location over a year or more.

I originally included an SD card as backup, but for a first prototype, I'll be able to go out and fix the system within a day or two (or three) if it stops transmitting.

Regarding software updates, there's two options with the Arduino FIO. I've only ever used a USB adapter, but it should also be possible to program over the XBee radio. That's a very low priority for me as I troubleshoot on the bench, but as soon as I start getting serious about putting this system under a hive, programming via radio is suddenly going to become MUCH more valuable! If I struggle with programming over XBee, I'll just leave a USB cord where I can grab it without tearing down the entire hive.


----------



## Roland (Dec 14, 2008)

Deamitter - do you have experience with the Arduino products? I am more of a 4-20 ma current loop- a to d board man.

Crazy Roland


----------



## Deamiter (Jul 21, 2009)

Roland said:


> Deamitter - do you have experience with the Arduino products? I am more of a 4-20 ma current loop- a to d board man.


I have around 6 months of experience with the Arduino Uno and Fio. That's not a lot, but my background in optics and engineering means I do a significant amount of low-level mathematical programming (in various languages, many similar to C++) and I have some significant experience troubleshooting minor electronics problems. My coding is messy from a professional standpoint, and I've been doing more hacking together different code than writing code myself, and while I've worked on writing robust code in the past (in simpler languages), I haven't gotten around to preventing errors or bugs yet.

I'm hoping that when I'm "done" with a working prototype, somebody on the internet will rip apart my code and show me all the things I did wrong (improving it in the process) but I feel competent to program the relatively simple Arduino platforms such that the datalogger can run for the first year with only one or two significant interruptions due to bugs.

In short, I'm a beginner with a helpful background. I expect (and hope) everything I do will draw significant criticism that will drive me toward improvements, but I expect to be able to hack together functional electronics and code just by drawing on stuff other people have published.


----------



## Fishman43 (Sep 26, 2011)

Not to beat a dead horse, but I would again say try the Farm Hack folks. There were a few guys and a gal from MIT and UMass that came up for the NH projects that are code heros and work with the Arduino regularly. It is all FAR above my head, but I love seeing the end products.


----------



## Deamiter (Jul 21, 2009)

Fishman, you're absolutely right as I want to get as much exposure as possible so I can benefit from people who have great advice or have done similar projects that I can learn or copy from in some way.

It looks like a low-traffic forum, so I'll want to write up a decent summary with specific requests (for advice about any specific component mainly) to maximize the chance that an interested contributor will read long enough to get engaged. I also need to search through past threads and posts so I don't insult them all by proposing a project they went over in detail just last week.

In short, I'll definitely be bringing this over there, but it'll take me 2-4 hours of work to do it right. Maybe that's not really necessary, but I always get annoyed when someone with one or two posts jumps on a forum to ask people to give them free help and advice, so I try hard not to be that guy. At the same time, doing some research and re-writing my problems and needs always helps with MY project so it's not wasted time even if I don't stir up any significant interest.


----------



## Fishman43 (Sep 26, 2011)

It is a pretty low traffic forum as compared to others, and seems to be more regoinally active in my area. I know what you mean about posting as the new person when items have already been covered. Your project is very exciting to me, as is the whole Farm Hack concept, so I tend to get overly worked up/excited and have to remind myself slow and stead wins the race.... 'Takes a deep breath, sits back and watches this thread unfold...


----------



## Deamiter (Jul 21, 2009)

It's been half a year now during which I tried to avoid spamming you with technical updates (I figured you could subscribe to my blog if you wanted more details), but I've finally installed the system and I WAS getting live data for over a week until it suddenly stopped! I'm going to go see if I can get it back online later today, but at my blog you can see some pictures and some really cool graphs showing 5 days where the bees stayed inside (and simply consumed honey) along with 2 days where they brought in pollen and nectar during the day and continued consuming at night!

http://www.hackerbee.com

There are ALL sorts of things I'll be doing differently next time, both to reduce cost and to make the system more robust! I'm also hoping to design a simple hive scale that I can deploy more widely that will interface simply with hobbyist microcontrollers like Arduino. Do get in touch with me at [my username]@gmail.com if you're interested in more details. I'm working on more documentation of my system, but it's suddenly become gardening and construction season at my house so blogging time is very limited and it'll take me a number of weeks to get through some important projects!


----------



## Fishman43 (Sep 26, 2011)

Thanks for the update Deamiter, I am following with great interest!


----------



## domihue (Sep 10, 2013)

Hi: I need info on a related, or at least very technological subject: a system to record voice descriptions of checking an hive (as with headphones & mic) thar can be downloaded on a computer and shown on a table or spreadsheet. The idea is to keep track of a bee colony without the paperwork.
I´d appreaciate your help on the subject.
Domihue


----------



## Spinner (Jun 2, 2013)

domihue said:


> a system to record voice descriptions of checking an hive (as with headphones & mic) thar can be downloaded on a computer and shown on a table or spreadsheet


I use a simple voice recorder (a smartphone could work for the recorder portion) and then pump it into the computer to be converted by Dragon Naturally Speaking software. Dragon is a relatively cheap voice recognition software that does a remarkable job. If you remember to throw in some navigation commands, then it works even better on playback into the computer. It all works very well.


----------



## snl (Nov 20, 2009)

Might want to check this out...

http://www.scstatebeekeepers.org/Resources/Documents/intro doc for website.pdf


----------



## gmcharlie (May 9, 2009)

How is this project going? I have a theory I am working on based on hive density and honey storage, I would be interested in buying or funding a couple of units that could do weight and number of flights type checks Daily. Not my area of expertise. I have 4 scale hives now, but the old time units with weights, and they sure don't count bee flights. It would be really cool if you could do something on all the hives on a 4 way pallet.


----------

