Over the last week or so I've been attempting to photograph my local badgers using conventional means (DSLR + telephoto lens) - the main problem being: 1) badgers are active at dusk / night, so light levels are low, 2) they are very timid so don't let you get close.
This is the closest I managed to get 'in person':
Badger - can you spot her?
Wanting to get better pictures, I cobbled together an improvised ground level webcam to see if I could get a more 'up-close and personal' perspective:
Cobbled together 'Garden-cam'
This is an unused robin nesting box, with a TP-link POE adapter and a Raspberry Pi model B with Microsoft Lifecam Studio webcam. All sourced cheaply from ebay. Connected via oudoor cat5 ethernet cable to a PC running iCatcher Console. The video stream is setup as described in this post.
I part set this up one evening last week, and left wires and components scattered about having popped in to eat - I left it on in the hope that something would wander past, and got this footage of one of my local badgers:
You can see her being a bit wary of the attached gear, but not to the point that she wont come and investigate. Later that night I stuffed all the components into the robin box to tidy things up. Since then, we have got nice views of the local wildlife as the following screen grabs show:
Passing fox: 4:30 am
Red deer fawn
Squirrel
Jay with mohican
In most of my bird boxes I've used the Microsoft LifeCam. I only recently acquired a LifeCam Studio ebay bargain - its much better in low light levels due to a bigger sensor size. It cant see in the dark, but is good for low light levels
In part 1 of this series, I outlined how a Trail Camera is made, and what might be used to make a home-brew version.
I've put together a basic functional trail camera, a very early prototype if you like.
I'm testing with a standard Raspberry Pi camera, not the IR version. I do have an IR version, but haven't got around to using it yet. For now, I'm limited to daylight triggering since I've not yet incorporated my IR illuminators since the box (tupperware - no expense spared) was too small to incorporate all the required bits.
This shows the prototype build so far (lack of hot glue gun skills notwithstanding). This will be hardwired into my home network, and uses power-over ethernet (PoE) hence the wire going to into it.
Simple front view showing PIR and RasPi camera with LDR detailed in insert
PiTrailCam ver1 - Inside
This is a cut-down version of the version I had planned out on my desk, which included a relay that triggered a separately powered IR LED array, which unfortunately does not fit in the box. Version 2 will probably be in a wooden box that is a bit more roomy and durable, and can accommodate a relay switch for the IR LED arrays.
I'm planning on directly splicing a hacked microUSB cable to the TP-Link power-out but bought the wrong cables...so have to make do with more bulky cables following this guide
Micro USB (male) to USB cable (female)
USB (male) to barrel power connector
Small prototyping breadboard
Female to male breadboard wires (various)
PIR motion sensor: Components, wiring and code described here
Mechanism to measure light level: code + components from here
Not strictly necessary in this build, but will be used to measure ilght level to activate IR led array in version 2:
1x 2.2 kOhm resistor
1x 1uF capacitor
1x Light Dependent resistor
Prototype board layout as follows. Note, I significantly slimmed this down to a small prototype board, but tend to use a larger breadboard with GPIO breakout at the 'drawing board ' stage. this also shows a possible layout that will incorporate a relay to operate a pair of IR LED arrays:
For now, I'm just using the PIR (motion sensor) and LDR (measure light level) aspects .
First image: Some things I'm very happy with, others not I'm less so..
The observant among you will spot something wrong with this image...
Whats really cool is that I've got the time and date stamp included at the top (erm, bottom?) of this image.
Timstamp - just to prove it....
How the image capture works
I've coded the scripting side of things in Python. I'm relatively new to this, so its a fun way of learning a new programming language, and to be fair most of this is mercilessly cribbed from other websites/blogs.
The Raspberry Pi camera is a described here, and can be used to capture video or stills, or both at the same time (may come back to this). You'll mostly see the two programs Raspistill and Raspivid referred to which are used to capture still images and video respectively. There are also several third party libraries built for it. For this application I've used the PiCamera library.
My limited Python skills will likely show here, but as I understand it this offers a way for python to directly access the camera hardware, versus using calls to external software (such as to Raspistill and Raspivid).
In your python code, you have the option of either calling Raspistill as follows:
By calling recordImage2() on a PIR activation event causes 3 images (image1, image2, image3) to be saved to a network location that I've mounted to a folder in /mnt, and am currently saving files there. Not sure how that will pan out if I switch to video though.
How to get text overlay working with picamera python library
I'm quite pleased that I have been able to get the text overlay working. The next thing to do is see if I can get a dark background behind the time & datestamp, as date and time in white over a white sky isn't much use to anyone.
At first I could not image overlay to work, and could not see why the instructions here did not work. Turns out I was running an version 1.5 of PiCamera, and need at least the current version (1.8 at this time). You can tell which version you're running by following these instructions here. You can update that by doing sudo update then sudo upgrade, you may need to update the Raspberry Pi's firmware : sudo rpi-update.
How to mount network drive to Raspberry Pi
For info, to setup network mounting you need to edit /etc/fstab as follows:
Ctrl & O, then Ctrl & X exits the nano text editor.
At a reboot, (or sudo mount -all) the network folder will be mounted at /mnt/SHARE
/XXX.XXX.XX.XX/SHARE/TrailCamPi = IP address of target PC with save file destination folder. Although its not strictly necessary, and you could setup a network share with no user password protection, I've set mine up with a dedicated user RasPi user + password on the destination machine, and pass those credentials with the mount command.
I'll sign off with another badger video from my commercial Trail cam, captured a couple of days ago:
Next step is to swop out the standard RasPi camera to the PiNoir, and add some LED arrays.