DIY Surveillance Camera with Raspberry Pi Camera Module and Pan & Tilt kit

Ingredients

1. Raspberry Pi B.

2. Raspberry Pi Camera Module, a longer 50cm meter ribbon wire will be nicer to allow further movements.

3. Servo controller like Raspy Juice from www.2wattelements.com.

raspy_juice-top4. 4GB SD Card with Raspbian installed.

5. USB Wifi dongle.

6. 12V 3A Power via battery or wall adapter. Each servo will draw 1A, so you will need a good power supply.

7. Pin & tilt kit with 2 mini servos, such as the one from Adafruit or similar.

8. Extra wires and plugs as necessary.

 

Hardware installation

1. Prepare the Pi with the standard SD Card, Wifi dongle and Raspbian. We will not use the standard 5v adapter for this project, although you may need it when connecting up to the Internet and install software initially.

raspbian-Selection_014

 

 

 

 

 

2. Assemble the pan & tilt kit. With a bit of cutting, fitting, and screwing you should be able to attach the kit and the two servos.

1968-02

IMG_5230

IMG_5227

 

 

 

 

 

3. Connect the camera cables into the camera and the Pi.

1367_LRG

 

 

 

 

 

4. Attach the camera to the kit. If you have an official Pi Camera enclosure, it will sit nicely between the tilt gripper. If not, the camera maybe attached by screwing if you are keen to drill the holder or just strap it to the tilt surface with a couple of sellotapes.

IMG_1208

 

 

 

 

 

5. Connect the 2 servo wires into the servo controller (any port 1-4) and power it with a wall adapter. Raspy Juice includes a step-down UBEC, so you can power it with any power source supplying 5+V. Please note you may need a barrel converter plug to to fit the red and black wires with the wall adapter. Please do not plug the Pi standard micro USB power when you power it from the Juice power input, unless you want the whole component fried so nastily.

IMG_1209

 

 

 

 

 

6. Attach the controller to the Pi GPIO panel, so it looks like this:

Raspy_Juice

 

 

 

 

 

Software Installation & Programming

  1. Prepare Raspbian with SSH and Wifi access.
  2. Install python 3.
  3. Install picamera module for Python 3 and dependencies.
  4. Install SMBus library for Python 3 and dependencies.
  5. Install mjpeg_streamer to view the pictures on a web browser. Or if you want awesome implementation using ws4py websocket server: https://github.com/waveform80/pistreaming.
  6. Program your own servo driver to control the pan & tilt kit with Python 3. If you happen to have Raspy Juice check this out: Raspy Juice Review.
  7. Test the driver: juice.py You can easily integrate this with a web-based controller using Tornado or other websocket server.
  8. Program the camera and view it on a client’s web browser.
  9. Test the whole thing. A nice control implementation is to include Up, Down, Center, Left, Right buttons on a web-page to control the pan and tilt rotations.


(Visited 1,044 times, 1 visits today)