Ever wanted to spy on the secret life of bees? Catch 'em in the act of stashing pollen and nectar? Well, now you can with BeeCam! Maybe. I guess it depends on how my network is behaving. Or if I use up all my bandwidth. Or if there's a power outage. What I'm trying to say is I set up a webcam in one of the hives!
BeeCam is a Raspberry Pi 3, with an IR camera attached to it, and some IR LEDs to illuminate the interior of the hive. It was supposed to solar powered, but it's not currently. More on that in a moment. Below I'll go through all the steps I took to get this going.
Step 1 - Parts
Ok, this is the easy part (and the fun part! New stuff!) Here's what I used to make this:
- Raspberry Pi 3 with wifi
- Raspberry Pi case (any case will do, really)
- Raspberry Pi IR camera
- 2 Lithium Polymer batteries (3.7v)
- 6 volt solar panel
- DC Power barrel adapter
- 5 volt power booster
- 5 Infrared LEDs
- 5 resistors so we don't blow out our LEDs (I went with 330 ohms so still got plenty of light)
- Solar/Lithium batter recharger
- USB Power supply (in theory for testing, but in reality... uhm, for actual power)
Step 2 - Set Up Pi
I won't go over actually getting a Pi set up with an operating system, there's boatloads of sites out there for that. In fact, there are even a bazillion pages on getting the camera set up. There's really not much to those.
Probably the hardest part is getting the video feed online. And this is actually the last step. For that, I'll just point you to this awesome set of instructions that worked great!
Here's what I will say about setting the Pi and camera up: those ribbon cable connectors are freaking fragile. When I first started this project I was using an original Pi. Broke the connector. Upgraded to a Pi 2. Broke the connector. With this Pi 3, I was so paranoid that I was exceedingly careful. I hate those things. Hate HATE HATE!
To drive the LEDs, I use the 5v supply off of pin 2 of the GPIO and the ground connector on pin 6. My original idea was just to take a snapshot every minute or so, and only light the LEDs when needed. For that I would need a programmable pin. But who wants to wait a minute between images? Instead I opted for video, and that requires constant illumination. Bees don't see in infrared, so, in theory, this light should not bother them. We'll see.
Step 3 - Put it all Together
So, here's the first iteration of the BeeCam with everything all together:
You can see that power is coming from the solar panel into the charging circuit. This charges the batteries (which are connected in parallel) that then supply power to the power booster which takes the 3.7 volts and ups it to the 5 volts required by the Pi. The Pi, then is attached to the camera, which you can see at the end of the ribbon cable. All that's missing here is the IR light source.
It should be noted that the connector that comes on the solar panel does not fit the charging circuit, thus the need for the adapter.
Of course, it can't stay like that. Things need to be more contained, and the camera with light source needed to be together. I found some good project boxes at... well, I can't remember the name of the place. Once upon a time it was a Radio Shack, but it's not anymore. Everything seems to fit in this quick fit check.
Unfortunately, while this looked pretty awesome at first, with the Pi running off of solar power, it quickly became apparent that it was draining the batteries faster than the solar panel could recharge them. The Pi would die after a few hours.
For now, BeeCam is running from a USB power supply. But I haven't given up on solar power. We get a lot of sun here in Fairbanks during the summer, and I'm sure this can be done. But with the camera and wireless network, the Pi just draws too much current for this set up.
Step 4 - Insert BeeCam
So below is a picture of all the items for the final product. I only had a chunky USB hub for the USB power supply, so for now, this goes into the hive. I'm sure I can find a cheap ass USB power supply, but since my goal is solar power, it's a low priority.
Sorry for the blurry image, my phone camera sucks. Anyway, the BeeCam is velcroed to the top of the Pi case. Any opening big enough for a bee on that case has been covered with tape.
I then installed the camera in one of our top-bar hives. This type of camera wouldn't work in a Langstroth hive as there simply wouldn't be enough room. The top-bar hive is only about 15 yards from our house and gets a good wireless connection.
The camera is placed as far back in the hive as it can go. This is because these cameras are notoriously hard to focus and the farther away from the subject the better. In theory you can turn the little lens, which is on a threaded mount, to focus, but my attempts only managed to scratch up the plastic around the lens. Here's the camera in the hive.
It is now as far back as it can go, and honestly, if you look at the video, it is still pretty badly out of focus. Maybe if I move the velcro to the back of the Pi, I can gain another inch or two, but I doubt that will make much of a difference. Improving the brightness of the LEDs might help, as well.
Obviously, making this thing properly solar power is a priority. While I doubt this thing is gonna kill my electric bill, it's just the principle of the thing. My goal was to create a Raspberry Pi solar powered webcam and I didn't make it. I didn't properly plan for the total current draw with both the camera and wireless enabled.
Next is to improve the focus. Two things to work on here; lighting and the lens. If I can figure out a way to adjust that tiny lens that would be perfect. Improving the lighting may be as simple as using different resisters in series with the LEDs. I went with a safe value, but perhaps I was too cautious. LEDs are cheap, so I shouldn't be afraid to burn out a few.
I also need to make the page the video feed is on nicer. I can add information, improve the layout (wouldn't be hard since it's just plain ass HTML with only one header and a paragraph at the moment...) and useful links.
But hey, it's online and working! Yay! Again, that URL is: http://urbanraven.hopto.org.