RASPBERRY PI TRAIL CAMERA

What You Need

 

To build this project, you will need the following items.  Suggested suppliers are shown, but others can easily be found.  

21

10,5

14

28

   Ø 2

(2 PLACES)

   Ø 13

   Ø 23

   Ø 20

   Ø 5,5

45

22

Camera Housing

 

The Project Box requires several holes to be drilled.  Dimensions for these holes is shown below.  Do not press too hard when making the holes to avoid breaking the box.

22

48

   Ø 3

(2 PLACES)

Assembly

 

Using Nylon bolts, washers and nuts (Item 9) assemble the Camera Module (Item 2) to the top set of holes, and the PIR Module (Item 4) to the lower set of holes. Observe static precautions when handling the camera module.

Mounting holes for camera module

Mounting holes for PIR module

Using Nylon spacers (Item 10) assemble the Raspberry Pi to the inside of the project box lid:

Filter (Item 12) glued on outside to protect camera module using hot melt glue

Protect the camera module from rain etc:

Connect the Camera and PIR Module to the Pi

 

Details on how to connect the camera module to the Pi can be found here:

http://www.youtube.com/watch?v=GImeVqHQzsE#t=138

Details on how to connect the PIR Module to the Pi can be found here, along with some sample code:

http://www.raspberrypi-spy.co.uk/2013/01/cheap-pir-sensors-and-the-raspberry-pi-part-1/

To attach a standard camera tripod, glue Nut (Item 11) here

Waterproofing

 

The Pi-Cam can be camouflaged using camouflage tape.  This will also help to make the project box waterproof.

 

In the photo below, a small tube has been added over the PIR Sensor to reduce its field of view to help prevent nuisance triggering from passing birds.

Python

 

To get the camera working and capturing video, the sample code provided in the link above can be modified to add a Raspivid command:

 

      if Current_State==1 and Previous_State==0:

         # PIR is triggered

         print "  Motion detected!"

         # Get a timestamp for the video filename

         timestamp = datetime.datetime.now().strftime('%Y%m%d%H%M%S')

         # Capture a 40 second video

         subprocess.call ("raspivid -o /home/pi/trailcam/trailcam" + "_" + timestamp + ".264 -t 40000", shell=True)

         print "  Captured trailcam" + "_" + timestamp + ".264"      

          # Record previous state

         Previous_State=1

       elif Current_State==0 and Previous_State==1:

         # PIR has returned to ready state

         print "  Ready"

         Previous_State=0

Item No.

Part

Supplier

Comment

1

Raspberry Pi Model B

CPC

 

2

Raspbery Pi Camera Module

CPC

 

3

Project Box

Maplin

N24HG (125mm x 80mm x 50mm)

4

PIR Module

ebay

 

5

Jumper wires (female/female)

ModMyPi

40 pack

6

Power Supply

ModMyPi

 

7

USB to micro USB Noodle Power Cable

ModMyPi

This cable is compact enough to fit inside the N24HG project box

8

20m Network Cable

Amazon

 

9

M2 Nylon Bolt, Washer & Nut

ebay

10 off

10

Nylon Hex Spacers/ Screws/ Nuts

ebay

M3, 120 parts

11

1/4-20 UNC Nut

ebay

2 off

12

49mm Filter

ebay

 

13

16GB Class 10 SDHC Card

Amazon

30MB/s