A Digital Beehive: A scientific study proposal. - Page 1
Forum section: electronics / projects

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 05:21:42 am
content: I'm an undergraduate biology student at Fairmont State University in Fairmont, WV. I'm planning on doing a undergraduate research project over the summer that will involve digitizing a honey bee hive. My adviser has been doing research with bees for years now and has just presented his data of weight measurements of a hive (collected weight every 5-10 minutes for two years) and it has raised some questions that we think additional data can answer or is needed.My proposal is to build and implement a comprehensive sensor package as we can for our meager budget. Because specialized equipment for this runs into hundreds to thousands of dollars we're looking at building most of the equipment ourselves.I'm looking to build a complete weather station with an arduino base. Wind speed/direction, rainfall, air temp, soil temp, humidity, barometric pressure, soil moisture, leaf wetness sensor, visible light reading, UV index. Each of these sensors presents different challenges but so far none have very complex circuits.I'm also looking to build a bee counter based off this instructable:http://www.instructables.com/id/Honey-Bee-Counter/?ALLSTEPSI'm also interested in collecting 3D temp profile of the hive for estimating brood size (Bees keep their brood at specific temp, but rest of hive isn't tightly temp controlled), idea based off this project:http://mietz.imkerforum.de/the_idea.htmlThe basic plan is thus: 3 arduinos at the hive location. The hive has a roof shelter to protect the digital scale it sits on, along with mains power ran to it for the scale. A conduit was burried in the ground from the house that contains a RS-232 cable for the scale along with power. We plan on cutting the RS-232 wire off at the end, tying a rope to it and pulling it back through the conduit then feeding at least 2 cat5/cat6 cables back through, reconnecting the scale with a RS-232 to RJ45 adapter and getting it back working that way, then using the other cat5/6 cable to communicate with the arduinos with a master arduino back at the house. I'm thinking RS-485 as the protocol for that communication.The master arduino will have a SD card and/or be connected to the computer that is logging the weight to save out a CSV file of all the sensor data at 5 or 10 minute intervals. It will also contain monitoring circuits, display (oled or whatever) to display information about the system, or alerts about anything wrong.The arduinos at the hive site should be on a UPS battery backup so that they continue functioning for power failures. The mains supply is on a generator backup but it can take up to a minute to kick in, and worse case the battery should run the arduinos for at least a day. Small battery backup also is necessary for the arduino back at the house controlling the hive arduinos.I'm a biology major not a EE major and my school doesn't have a EE degree so there isn't a plethora of people familiar with electronics here to help. SOO... I'm reaching out to people on the internet to help aid in the circuit design for this project.I thought I'd stop in here to see if theres any willing people who want to help guide a noob through these circuits, check my designs, create circuits, whatever. ;-)I plan on releasing all the code and circuits as open source and public domain, since I'm wanting others to help learn from this project and further the research on bees. Plus some of these circuits have wide applications beyond just my narrow research goals. ;-)

author: mikeselectricstuff
author_rank: Super Contributor
timestamp: April 27, 2013, 09:00:43 am
content: You may have issues with drift and temperature stability measuring small changes in weight over a long period. You should probably include some means of periodically checking calibration, maybe periodically adding a known additional weight.At the very least you should check the calibration of the system over the expected temperature range, and if necessary add local temperature sensing so any Tc can be compensated for.

author: Joules
author_rank: Contributor
timestamp: April 27, 2013, 09:34:59 am
content: You might also want to check out the Raspberry Pi and how it is being used.http://openenergymonitor.org/emon/beehive/v2Available modules to expand the Pi's use.http://www.abelectronics.co.uk/products/3/raspberry-pi/p.sI have no links with the above, just a happy Pi hacker.

author: ddavidebor
author_rank: Super Contributor
timestamp: April 27, 2013, 09:39:10 am
content: You just should buy alredy used and documented sensor.So, you just copy and paste various library, and you only need to send all the various data on a pc or sd card.And, i suggest you to add a calculation of the drew point (when air humidity became water), should be very interesting data.

author: daedalus
author_rank: Regular Contributor
timestamp: April 27, 2013, 10:58:34 am
content: pull as much cat5/6 cable as you can fit in the conduit, its always useful to have more rather than less. With a single cable and a PoE Ethernet switch, you can get 25w of power, and a data link. As long as you plug the switch into a UPS at the lab end, you will have mains redundancy (solves having to build your own weatherproof ups). Some arduinos even have PoE electronics built in.A good first project might be to hook the scales rs232 to an arduino, then send the readings back over Ethernet to whatever computer was logging the readings previously over TCP. As you are only reading sensors and logging, an arduino should be more than capable of what you are proposing.EDIT: one thing to check is what power the scale actually uses, although you have mains to the hive right now, im guessing its just feeding a transformer to give the scales low current dc. If you post the voltage and current ratings, it might be possible to run the scales from a PoE link, that would allow you to fit more cat5 in the conduit, and provide the scale with backup power the same way as the arduino.

author: smashedProton
author_rank: Frequent Contributor
timestamp: April 27, 2013, 03:44:26 pm
content: I love the project!You should use the raspberry pi. Using multiple arduinos isn't an elegant solution for what you are trying to do. surely you can get the gpio on the pi to do everything that you need.

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 04:02:46 pm
content: mikeselectricstuff, that's a very good point, the scale has been sitting there with a hive on it for two years. We should probably take everything off and check if it's still accurate. The scale we're using is theAdams GFK 660a. It connects over RS-232 totheir custom softwareto log the weight measurements.Joules, Raspberry Pi's are nice, but they also scare me in that since they're actual computers programming sensor reading data is probably more difficult and less libraries exist and shields and breakouts exist for them... With arduino virtually every sensor I'm using, has existing libraries and code examples, shields, breakouts, long community use, so it's A LOT easier for me to figure out how to implement them.ddavidebor, I plan on it, here's the sensors I plan on using:Wind speed/direction, rainfall:Argent Data System’s Wind/Rain Sensor Assembly #80422, pretty simple sensors, sparkfun uses them withtheir weather boardwhich has code that can be used. Barometric pressure:BMP085Breakout Board (bothsparkfunandadafruitsells one)Visible light (360-970nm sensor):TEMT6000Breakout Board (sparkfun breakout, with good code examples)UV Index sensor (200-370nm):GUVA-S12SDsensor, breakout board with code fromDFrobotVisible light2, maybe replace the TEMT6000 with:Adafruit'sTSL2561breakout.Humidity sensor:HIH-4030easy to code for with lots of code examples.Temp sensors:DS18B201-wire sensors about $0.85 p/u if ordered from china on ebay. Waterproof probes with this sensor too for soil temp.Soil moisture:Vegetronix VH400 Soil Moisture Sensor Probe, seems easy to code for (put +5V in and it ouputs 0-3V depending on moisture.Decagon sells onethat does I think the same thing for $110.Leaf wetness sensor:Hobby-Boardshas a cheap solution ($2) that I'll need to figure out a circuit and code for but I don't think that would be hard. This is better than$114 for one designed for scientific research, which is basically from what I can tell the same thing with fancier packaging.daedalus, The hive sits under a roof shelter to protect the scale from rain, so whatever I design doesn't need to be tooo water proof it's protected from that. Just anything like the light sensors need a water proof enclosure, and with UV I'll need probably some fancy fused quartz glass which I haven't sourced yet. I agree we'll attempt to pull more, better to have extra if necessary. The mains power is the same as in the garage of the house, where the logging laptop is. So if power goes out it goes out there too... It's only 150-200 feet away from the house. It's not unreasonable to put the UPS power supply in the garage then send the power to the arduinos at the hive over one of the cat5 cables... but it's also not much of a problem to put it out at the hive and put an existing lipo shield on the garage arduino for it's battery backup... ;-)The main battery backup I'm thinking 12V sealed lead acid battery, they're quite reasonable in cost, I just need to get a good solid charging and ups backup circuit designed. I'm looking at the following chip:http://www.ti.com/product/bq24450I have some circuits prelimiarly drawn, I've been teaching myself Diptrace.smashedProton, I can't rule out the idea of a Pi, but I'd really need to know more about it and how you code for it, code examples for much of these sensors probably doesn't exist, how do you hook up all the lines? The bee counter will eat up 40-44 digital inputs alone just for it's sensors. The temp 3d profiling is probably another 20 pairs of pins for 20 1-wire buses... (it would take FAR to long to cycle though 180 of those sensors on 1 bus, so it's probably easier to put each frame on a bus (10 frames a box, two boxes).I'll have to do some searching on Pis... ;-\

author: Joules
author_rank: Contributor
timestamp: April 27, 2013, 04:13:09 pm
content: Check out Adafruit's site for sensors and examples of code. Most stuff can be done in python, almost all the ready made boards come with example code to guide you in it's use.... There is a MASSIVE library of code for the Pi's and its growing at a staggering rate day by day. Check out Raspberry Pi's site for more links.I'll shut up now as I seem to be biasedp.smy Arduino's are gathering a heavy layer of dust.

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 04:15:22 pm
content: Lol, can you have this many IO pins on a single pi? I honestly just ruled it out because I didn't think it could do what I need it to do. I also don't know python at all. ;-)

author: Joules
author_rank: Contributor
timestamp: April 27, 2013, 04:20:07 pm
content: Check out the link to ABElectronics I posted, they do a 32 port I/O and you can stack 4 of them on a single Pi, or mix boards. I2C is your friend, you can cook up your own boards too if you want to go that route.

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 04:32:43 pm
content: It scares me...With arduino I have the code pretty much done, minus debugging to get everything to work togehter on the weather board, codes done for the bee counter, coding for the 3d temp profile will be making new code but it shouldnt be too bad. I'll need to figure out RS_485 communication and code for that...but looks like with Pi I'd have to start from ground up, which scares me. Unless you want to do it all, lol.

author: ddavidebor
author_rank: Super Contributor
timestamp: April 27, 2013, 08:48:43 pm
content: Yeah, rasberry pi is definetly too much complex for a thing like this.

author: JackOfVA
author_rank: Unknown
timestamp: April 27, 2013, 09:19:13 pm
content: Nearly all the weather related data can be collected with one of the Davis Instruments packages.http://www.davisnet.com/weather/and they are available with data collection software and computer interface.While the price of the Davis station may eat into your budget, I would think long and hard about the time required to build the sensor array, interface with a micro computer, etc. and assess the skills and time available to make your own versus a Davis (or similar) station. I've built my own weather station running on a Microchip PIC 18F microcontroller, interfaced amongst the sensors with a combination of analog and I2C interface and it took a few weeks to get it playing the way I wanted it to. That was a basic time of day, temperature indoors, outdoors, humidity and barometric pressure station. I should add that I had adequate test equipment to debug the various interfaces and a reasonably decent electronics education (vendor documents are almost always incomplete) etc.Not saying you can't do it, nor that it would be a great educational experience for you, because it would be. But, to quote the line from the Dirty Harry movies, "A man's got to know his limitations." If you have X resources in terms of time and money, you need to decide the best allocation of those between buy and build.

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 09:20:33 pm
content: I think to simplify things I'm going to go with ethernet shields on the data collecting arduinos, then link the laptop in the garage to the lan, then just poll the sensor arduinos and pull the data over HTTP to get it all in one place to output a CSV. Should be a pretty simple program to write for the computer, the libraries for the arduino to talk over the network and respond to HTTP requests seems robust and easy to code for...Probably crap tons easier than doing RS-485. ;-)

author: ddavidebor
author_rank: Super Contributor
timestamp: April 27, 2013, 09:28:04 pm
content: Rs485 is more simple than http... A lot more.

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 09:33:02 pm
content: JackOfVA, I donno, that's a very expensive option, like the leaf wetness sensor (http://www.davisnet.com/weather/products/weather_product.asp?pnum=06420) that appears to use the exact same $2 board that I linked to above, and I kinda doubt there's much electronics in it, if there is its only a couple dollars of them.$50 for a $5 temp probe?http://www.davisnet.com/weather/products/weather_product.asp?pnum=06470$55 for a soil moisture probe that isn't even a really good one, it's basic EC probe that will degrade over time...http://www.davisnet.com/weather/products/weather_product.asp?pnum=06440$160 for the solar radation probe...http://www.davisnet.com/weather/products/weather_product.asp?pnum=06450$350 to detect UV?http://www.davisnet.com/weather/products/weather_product.asp?pnum=06490Pretty sure all this is way way out of our price range.. thats why I said we'd need to probably do all this ourselves.. ;-\I donno...Base weather station for them is like $800 looks like. Our budget is like $500 in materials is what the grant will provide, anything above that starts coming out of our pockets for the stipend... ;-\

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 09:34:27 pm
content: Quote from: ddavidebor on April 27, 2013, 09:28:04 pmIs getting a PC program to interact over RS485 easier than pulling HTTP pages? I'm alot more faimilar with http protocol then RS485.. ;-\

author: kasslloyd
author_rank: Contributor
timestamp: April 27, 2013, 09:39:38 pm
content: Although some searching turned up this weather station:http://proweatherstation.com/At $120 with free logging software... battery operated but says it has 2 years on 2 AA batteries, lol.Logs alot of what I'd want to log, an arduino could suplement .. I suppose. ;-)

author: ddavidebor
author_rank: Super Contributor
timestamp: April 27, 2013, 09:40:55 pm
content: Is more simple on the arduino side, in the computer side depends by how you program it.

author: JackOfVA
author_rank: Unknown
timestamp: April 27, 2013, 11:51:18 pm
content: All depends on budget and time, and a critical assessment of abilities and equipment -- in effect what do you value your time at.As a student, it's probably a few dollars an hour, so $800 = say 200 hours of work. Assuming you have 200 hours for it (and how long it would take to toss all the stuff together and make it play, calibrate sensors that need calibration, etc. I have no idea. Programmers vary in productivity by a factor of 10:1. A super star ace programmer can write code in a day that would take a guy at the other end of the equation - inexperienced or just good enough not to be fired or both - two weeks to do. If you are in the super star ace programmer category, you will be in great shape. If you are at the opposite end of the continuum then things will get a bit more interesting.)From a business point of view, $800 in a one-time capital expense is not too much different from what the daily fully loaded cost for a super star ace programmer and it wouldn't be a difficult question to answer. But you are not in it with that concern.