I wasn't sure how best to setup the internal lighting, so I, well threw a selection of LEDs at it in three separate circuits/loops, These are on 12v circuits, and are isolated from & switched by the (5v) raspberry pi via a ULN2003AN transistor ic. I used all 7 base input channels, with the collector outputs switching the 12v LED loops through a selection of resistors as follows:
Loop 1) 4x 'Warm' LEDs: LOW (10k ohm) and HIGH (330 ohm)
Loop 2) 3x 'White' LEDs: LOW (10k ohm) and HIGH (330 ohm)
Loop 3) 36 IR LED array: LOW (10k ohm), 'MED' (5k ohm potentiometer) and ('HIGH' 330 ohm)
+ An opaque perspex 'windows' at either end for the natural light options..
Once the birdbox was in-situ, I wanted a simple way to fiddle about with the lighting, and came across Matt Richardson's excellent Flask tutorial, specifically his weblamp.py script example. This creates a webserver within python that allows me (and the kids...) to turn LEDs on, off up or down via a simple webpage:
The tutorial is an excerpt from his Getting Started with Raspberry Pi: An Introduction to the Fastest-Selling Computer in the Worldbook
|Just for fun - someone's at home....|
Make it executable as follows:
Add the following toward the end of /etc/rc.local to make it run at boot:
The IR sensitive camera is a v2 Raspberry pi Pi Noir (Camera 1). Unsurprisingly, the IR HIGH setting to just too bright, with the MED setting being the sweet spot. IR_Low (10k ohm) barely registers... At the moment I've got it set to IR_Medium.
I haven't made much use of the non IR LEDs yet, but the LifeCam Cinema webcam (Camera 2) does not see very well without them being on, which is bit of a shame. Maybe a ver 2018 box could have bigger natural light windows (Or I'll take a hacksaw to this one...).
We've seen a fair number of wasps taking an early interest and this Hornet (I think) taking a look... This is using the IR LED array and Pi Noir v2 camera
The LifeCam version looks like this.. the lesson is that I need a motion trigger on the non IR LEDs as there is only natural daylight illuminating this:
36 IR leds is excessive.
The raspberry v2 Pi Noir daylight light sensitivity is not good (with IR cut, so conceivably this is reducing the 'useful' daylight sensitivity).
I dont use the 'LOW' setting on the WARM or WHITE leds
LifeCame Cinema needs more natural light for unassisted daylight video (bigger windows)
Need an 'on-motion' event to turn on non-IR leds.