Web Controlled Surveillance Camera





Introduction: Web Controlled Surveillance Camera

The purpose of this work is to show, how to build surveillance system with the web-page interface. The webcam can be turned in the vertical or horizontal direction throught the interface, but only in the area that border sensors will allow. The control page is secured with login system, where the user types in an username and a password.

On the control page the user can control how the webcam will turn and how many steps it will run. The user can also turn the webcam on and off via web interface. Information about the states will immediately update to screen. User can also turn the motion detector online, if the camera detectd motion, it will automatically save the frames. Naming of the pictures is done with "timestamps", so it is possible to find out when the picture was taken.

The camera interface is coded by using PHP and XHTML programming languages. The micro controller is programmed by using C-language. System works on Linux operating system.

Step 1: Step Motors

You can find the step motors from the old printer. Printer usually contains two step motors. The step motor can be bipolar or unipolar.

Step 2: Making the Box

Polystrol is cheap and easy to modify. You can bend it to right shape with (hot air) aerophone. Hot glue is good when you stick parts together.

Step 3: Assembly

I have used lot of parts from the Lego kit. These are really useful =). Rest of the parts are taken from the old printer. Only the switches and wires are from the electronic shop.

Step 4: Motor Driver for the Bipolar Step Motor

To control the step motors we have to build a motor driver. There is difference between bipolar and unipolar motor drivers. Bipolar motor driver is little bit harder to do, than unipolar.

Used parts:

- Attiny2313-processor
- 12MHz crystal
- 2x 27 pF capacitors
- L7805CV regulator with 100 nF and 4,7uF/35V capacitors
- L7808CV regulator with 100 nF and 4,7uF/35V capacitors
- 1N5408 diode
- 2x Dual-H-Bridge (model L293B)
- TTL-RS transducer (model ST232ACN) with five 0,1 nF capacitors
- 2,1mm DC connector
- screw terminals

L293B Dual-H-bridge does not contain internal diodes !
Model L293D contains diodes.

Step 5: Micro Controller Board

Solder the components on the board and that's it. About the wiring.. there is nothing to say =)

Step 6: Done

System is ready to use.

Step 7: Easy Motion Detector Program

This works only under Linux!

1. Install your webcamera.
2. Install capture software called Xawtv. It creates file called .webcamrc
3. Open the file with your favorite editor.
4. Delay defines how often the still-picture is sent to server. I used 7 seconds.
Dir defines location folder where the picture goes. Something like: /usr/webcam/pictures/
File defines name of the picture. Something like caption,jpgor what you want to use.
5. Save and exit.
6. Now you can try the command webcam & . The program start updating the picture on every 7 second to
the defined dir folder. & option, put it to run on background.

And next..

Install ImageMagick software.
Under Fedora command is: yum install ImageMagick

Software contains function called compare and this is what we need.

Now you have to code a Shell script. Use your editor to do that.

cp $PATH/caption.jpg $PATH/tmp/caption2.jpg
sleep 10
compare -metric PSNR $PATH/caption.jpg $PATH/tmp/caption2,jpg null > result
result2=`head -c 4 result`
if test $result2 -lt 300
time=`date +%_T_%F`
cp $PATH/caption,jpg $PATH/save/$time.jpg

Now you can run your script with command: sh gived_script_name
If the picture contains difference, it will be saved to defined folder. In my example it goes to /usr/webcam/pictures/ save/

About the ImageMagick and the compare function you will find more information from here http://www.imagemagick.org/script/compare.php

Step 8: Codes

Codes are commented in Finnish.



  • Epilog Challenge 9

    Epilog Challenge 9
  • Science of Cooking

    Science of Cooking
  • Pro Tips Challenge

    Pro Tips Challenge

We have a be nice policy.
Please be positive and constructive.




i m trying to make a this project and plz tell me methodology

hey man can you please link me to where you got your components for the build i got the step motors there a bit monstrous but they work i just need the rest of the stuff my Email is andrewmacmillan1@hotmail.com

cool wow if i could shrink this with micro servos then i could make a robot like bladeruner

hi..nice work!
where can i find the firmware for this and a better resolution schematic?

Ok you have done a nice job but it's just so over kill. I did the same project with two servo's ( eliminating the need for the whole stepper thang here) and it's just such a mess of wires. the exact same thing can be done with 2 servos, a free webcam software download called Yawcam and an arduino, That's it! I will say it must have taken quite sometime put into it and is nice. A+

I have done it also with servos:

Use my instructable to make it work on bright sunlight! https://www.instructables.com/id/Convert-a-Webcam-to-work-outdors-in-bright-light/step3/Before-and-after-photos/

possible to get the codes commented in english?  (a) :D

please im Engineering student....my project on Object tracking
can u send me full information about this please

i am very serious on this project can u please provide more details , as to how to store the video in the hardware.....and also any  furthur details if u have missed here...
my id   svchiku.2006@gmail.com

plzzzzzz help!