Monday 11 April 2016

The HivePi Camera!


Autopsy saws are very difficult to come by in Cairo. To buy one you need to be a certified dive instructor with at least 150 years experience in extracting raw minerals from mushrooms.

Today I'll be talking about my Hive Camera. 

Mashroo3 hive
Beeso Hive 1
Some background... My brother started to keep bees a couple of years ago. It's something he's wanted to do since he was a child. So at long last he got his silent partners to cough up some money for some hives, and start an apiary.

Bees are fascinating insects, they act together as a community for protection, survival, resource management, and general buzzing around annoying the odd middle aged person into dropping their drink, spilling said drink onto neighboring middle aged people, freaking out a few others in a cascade effect panicking a whole group of people (who under normal circumstances would be enjoying a sunny Sunday afternoon) from under a canopy into a pond, or in the worst case scenario; sting an unsuspecting bystander and consequently dying shortly afterwards. We also (kind of) steal their food supply and call it honey.

A very large swarm of bees that has settled
Generally bees act as a group, unless they are outside a hive, or have some disease. The male bees (the drones-- Haploid genomes) fertilize the Queen bee (Diploid genome) which consequently lays fertilized eggs for female worker bees (Also Diploid genomes). Any unfertilized eggs develop into Haploid drones (if they are allowed to by the worker bees--- in the winter, when resources are low they are murdered by the womenfolk! -- As are diploid drones). Generally the Queen never leaves the hive except to have sex, which she does with multiple partners. A swarm of workers protects her guided by her scent, and sometimes a new colony is formed when he highness decides she's not going back to mum's place.

Newly occupied frame

Anyway, to cut a long story short, this year, we replenished our hives (bought new colonies). Sometimes they don't like where they live so they decide to go apartment hunting. One such colony decided to find an empty box (used for demonstration) to settle in. I was just mucking about in our garden and lo and behold there were bees in there.



Not being at all interested in bees, I thought it would be really cool to spy on them. And so, with a raspberry pi in hand, I set forth to disturb their nest of femininity and intrude the harem......


After testing the raspicam I bought, I decided it needed to be focused a little better. After all what good was checking on the ladies if the image was going to be fuzzy? There are apparently 2 ways to do this. One being to twist the lens on the raspicam to adjust the focus, and the other way is to stick a lens on top of the raspicam making it's effective focal point closer.

Raspicam with a 4+ diopter lens on a mount
Being the electronics destructor that I am, I opted for option 2. I had previously purchased a set of 52mm lenses for a cannon DSLR lens that allow you to come disturbingly close to your subject. It's great if you want to make people feel a little awkward. And it makes for good photography! People's grimaces are a spectacular way to capture human emotion... The images however aren't as appealing to everyone.

ANYHOW... I've tried 4+ diopter and the "macro" lens, and both work well for different distances. I found that the macro one, allows for a real closeup to the hive frame.

The Kit... with connectors

So here is a list of the essentials so far: 

- a Raspberry pi 2 ( an A+ would have sufficed, but can you believe I can't find one!)
- A 5mp Raspicam
- An extra long raspicam cable (the longer the better)
- Wi-fi dongle
- Long USB power cable
- 10000mAh power block.
- A suitable hive
- A suitable light source
------------------------------------------I also added
- An electronic Hygrometer/thermometer (grove) from FutureElectronics
- A laptop
- Protective gear (for the hive)
- A tripod

So I may have fumbled on the light source... I had to choose something that isn't too bright, or something that will get too hot... so I made a custom LED fixture. However... it's not very bright, to the point where I can't really see anything. I tried putting my phone inside the hive in the hope that the flash light would show something when I covered the lid, but it was pointed to the wrong direction. So the solution I guess is more LEDs with a reflector, which presents a size problem, but we'll cross that bridge when we come to it.

The LEDs on both sides

The Wiring




So the lighting issue is that there is a large dark circle around where the focus of the camera is... (you can see that in the video below) A reflector should fix it, but I'm wondering if a separate light source would be a better option. The Images I get are also very fluorescent, the white balance on the raspicam might need to be adjusted, or alternatively I should use a warmer light source, which will present heat into the hive (not that the raspberry doesn't do this already... (Hence the Hygrometer/Thermometer).

Mounted on a flexi mount

Placing the contraption into the hive isn't a real issue because I only have a couple of occupied frames. If it was a larger hive (it would probably be more interesting), there might be an issue with space, and bee disturbance. I also run the risk of the bees treating it as a foreign object if I leave it in there for any long period of time.
My macro/light was too heavy for the tripod



Ideally I would keep the raspberry, and it's power source, outside in an enclosure, while extending the camera cable into the hive. However I'd need a much longer cable (2m--ribbon cable--- Donations welcome of course!). I'm not sure they would deliver to Egypt, or what shape it would be in when it arrives. I'd also like to do some better power management with a real time clock. I've ordered the Wittypi from the UUgear... No idea when it'll arrive (or even if it will)! The idea being to wake up the raspberry at daily intervals to take stills with the camera over a period of days. Should make for interesting educational material (Including my order and the infamous Egyptian postal service).

So I've made a video. It's my first so please keep your laughter to a maximum... Specially the cheesy back ground music... There is some footage of the hive, and just a quick recap of todays blog. The way I recorded the footage was via a Wi-fi connection to the HivePi. I setup gstreamer on the pi and my laptop, ssh-ed into the pi, and started the stream... all very technical stuff I'd be happy to disclose upon request. Hope you enjoy:)

Mushrooms are awesome, unless they are growing in your brain.

No comments:

Post a Comment