30$ Surveillance System With User Interface

25K11611

Intro: 30$ Surveillance System With User Interface

Extremely cheap and very easy to do surveillance system. You don't have to be any kind of rocket scientist to do that. All of the required parts will probably found from your local hardware store. You will need only 2 angle bars, 2 servo motors, couple electronic components and one (old) web cam. And of course some softwares on your computer.

This instructable will show you how to build functional surveillance system.

requirements:

- Linux operating system
- server (apache)
- PHP support
- Mysql (optional) If you don't wanna use Mysql login checking
- about 30$
- web cam
- servo basics

Pictures and the video on below will tell you more than 784 words!

STEP 1: How To: Building the Frame

first at all, you have to buy 2 angle bars. These will cost about 2$ each. Then you have to drill all overall 3 holes for these angle bars. Holes diameter depends, that what is the diameter on your servo axis. Point is that should fit in the hole.

Of course you also will need these servo motors. Every RC-hobby store is full of these and the price is from 5$ to up. You can use screws or hot glue to hook up these parts. I used both.

Focus on, that there is enough space between the servo motor and the angle bar, so it can turn freely!

STEP 2: How To: Servo Motor Control Board

Next you are going to need control board for these servo motors. It is very easy to do and it contains only few components.

Components needed:

- Attiny2313 processor
- Max232 buffer circuit
- 4 x 0,1uF capacitors for the Max232
- 7805 voltage regulator
- 1 x 16V/47uF capasitor for the voltage regulator (input)
- 1 x 100nF capacitor for the voltage regulator (output)
- 1 x 2,1mm DC-jack or what size you ever wanna use
- 1 x D9-connector for RS232
- 2x3 spike bar for the servo motor connection


Follow the schematic instructions and your board should look like this.

STEP 3: Programming the Processor

I'm not going to show how to program the processor. I have to suppose that you are familiar with the AVR-programming. If you don't, then you have to go with the processor and c-code to your friend who can program the code in the processor.

The C-code is very simple and short. It contains only 60 lines of code

STEP 4: Attach the Web Cam Board to the Frame

Okey, now we have control board and the frame. Now it is time to open your web cam and attach the web cam board to the frame. It is easy to do with hot glue. You can safely remove connections to mic and the on/off button. We are not going to need these. You know what I mean when you open your web cam =)

STEP 5: Putting Rest of the Parts Together

Okey, Now we are going to need case. My case is too big and it is also ugly as hell, so go and try to get some smaller and nicer case =)

ATTENTION! Do not do same mistake what I did! I put the power and RS232 connections to front side and they should be back side of course.

STEP 6: Ready for the Test

After the tears, here it is! =) Now it is time to test our system.
Put the power plug in and pray.. No smoke? No sparkling? No fire or screaming? good, then everything is perfectly(hope).

When the power plug is connected, the camera should turn its default position. which is 1500us. It keeps little "surrur" voice, but it is normal.
Now you can try to control your camera with the minicom, gtkterm or what you ever wanna use. It is important use 4800 baudrate. With the another rates it is not going to work!

I suggest that, download gtkterm to your Linux machine and change from port options it to use 4800 speed.
Then press a,s,z,x keys from your keyboard and the cam should turn.
If it works it is time to graz yourself!

STEP 7: User Interface

I programmed the user interface with the xhtml and PHP languages. It is complicant and hard to explain what everything does.

On the right side there is 4 buttons: camera on, camera off, motion on and motion off. Camera on, puts the camera online and then it shows"webcam is running.." and camera off, turn its off and the sign "webcam is stopped" is presented.

Middle of the screen is the video stream which comes from the camera. Turning the camera happen clicking the picture. If you see some object in the edge of the picture(like lamp) and you click it the camera will turn that it is middle of the picture when the next refresh(interval is 1s).

There is also 4 button below the video stream. Up, down, left and right. With these buttons you can turn the camera more closely.

On the left side is the area where the motion detected pictures will update if motion detection is online. There is also button remove pictures, which will remove all of the pictures.

Zip-packet contains everything about the user interface and you can modify/use these files how do you want.

About the motion detector script, check this out: https://www.instructables.com/id/SZVB5BEFGG8PE6R/

11 Comments

Thanks for the response. I've built the schematic but it doesn't work with gtkterm. By the way I've programmed the Attiny with the programmer from lancos and ponyprog (shown in picture). Searching the net I found out that you have to connect max232 and attiny the way the next pictures show. In your schematic these two chips aren't connected at all. I am going to try it out tomorrow and I hope this solves the problem. I'm also thinking of powering the device from the serial cable through pin 7. And by the way thanks to you I've learned a lot about programming avrs and "serializing" the past days.
Yes there is terrible mistake in my schematic. Of course max232 should be connected to attiny2313 and my wiring between DB9 and max232 is wrong. I don't know wtf I have been thinking... Your example pictures is correct. have to fix that schematic as soon as possible. Sorry my bad.
What's the connection of the camera? Usb? Where are you iideetee? Please we need your help
Yes, Connection is USB. You need programmer or just add ISP-port to this circuit, then you can reprogram device when ever you want. Check my Atmega16/32 Development Board With LCD instructable. The schematic shows how to add it. Of course you are going to need cable also. My cable is stk200. Google shows how to do it and how it works.

Processor is Atiny2313-20PI
Max232 is MAX232CPE DIL16

Hope it help =)
hello, i picked this one as my school project, as i found it very cool and tough thing to do. but really need help on where to buy the following components: Attiny2313 processor, Max232 buffer circuit... I think some some url for an online store would be very helpful. cheers.
do i need any extra devices to program the tiny2313 or it can be done through this device? and please answer to hb9666 beacause i have the same question
Hi iideetee, About the IC ATtiny2313 and MAX232. Which one of these should I use? ATtiny2313V-10PU uC DIL20 ATtiny2313V-10SU uC SO20 ATtiny2313-20PI uC DIL20 ATtiny2313-20SU uC SO20 MAX232CPE RS232-transceiver DIL16 MAX232CSE RS232-transceiver SO16 MAX232ECPE RS232-transceiver ESD DIL16 MAX232ECWE RS232-transceiver ESD SO16W MAX232CWE RS232-transceiver SO16W MAX232ACPE RS232-transceiver DIL16
is there any other way to make the micro processor than with the D-9? how bout a USB
The controller circuit schematics is not so readable... will you add a clearer one?