Raspberry Pi Camera Trap (Part 1)
Meet my latest purchase - a Raspberry Pi! A recent trip to the Edinburgh mini Maker Faire inspired me and I've decided to build a night-time trap camera to use at my parents' and in-laws' gardens to see if we can get any night-time nature photos.
The shopping list:
- Raspberry Pi 2 Model B (£26.60) from RS
- Raspberry Pi B+ Case, Clear (£9.16) from RS
- 8GB SD Card with Raspberry Pi NOOBS 1.4 (£8.25) from RS
- PIR motion sensor (£12.88 inc postage) from Proto Pic
- Wire Jumpers Male to Female 10 pcs (£1.99) from RS
- Raspberry Pi NoIR Camera Module (£18.70) from Amazon
- Dpower 48 LED Illuminator Infrared Night Vision Light Lamp (£6.58) from Amazon
- 12V DC 500mA UK Power Supply (£4.99) from Amazon
- And I already had:
- USB wifi card
- Micro USB power cable
Steps to cover what I've been up to so far:
- Set up and turn on the Pi. I was stunned as to how fragile the little thing looked! I was also puzzled as I hadn't realised I'd need a micoSD... and then pleasantly surprised to see the SD I'd bought was microSD inside an SD converter - phew! (Maybe Past Jono was paying more attention!) I dropped it into the case, added SD, added power, added HDMI to TV, added wifi dongle, keyboard and mouse and it worked like a dream.
- Typed
startx
to load the GUI. Went into wifi settings to add my wifi network. Restarted - Typed
hostname -I
(note this is capital i) to find out the Pi's IP address - Connect with Putty - loading IP address above and logging in as "pi" with the password "raspberry". If you aren't using Putty
ssh pi@XX.XX.XX.XX
(where XX.XX.XX.XX is the IP address of your Raspberry Pi). Alternative is to use the Adafruit Pi Finder to find the IP address. - Update the OS
sudo apt-get update
sudo apt-get upgrade -y
- Attach the camera - "The dedicated camera bus is the ribbon connector closest to the Ethernet port. It's a zero insertion force (ZIF) design; pull up the two side clips to release the retaining bracket. You need to place the ribbon with the conducting edge-connection pointing away from the Ethernet port and towards the power-connector end of the Pi. Hold the ribbon square in place and push the clips down to fix the ribbon in position."
sudo raspi-config
and select 'Advanced > Memory_split' and set to 128. 'Enable/Disable Camera support' and select Enable. Select Finish and choose to Reboot.- Take a test photo
raspistill -o image.jpg
sudo apt-get install gpac
then pressy
sudo apt-get install omxplayer
then pressy
raspivid -t 20000 -o video.h264
MP4Box -add video.h264 video.mp4
(this now means you can watch as MP4 or useomxplayer filename.h264
to watch as h264)
- Plug in separate infrared illuminator and take another test photo
- Bed time!
sudo shutdown -h now
My next step will be to set up the sensor and start to code up the automated image capture.