Video Surveillance System

1,865 views

Published on

This is a project on video surveillance
system that can detect movement of any object, record video footage of that object
and can transmit recorded video footage using Ad-Hoc network to a server.

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,865
On SlideShare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
0
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Video Surveillance System

  1. 1. Faculty of Computing, Engineeringand Technology Video Surveillance System Name of the Authors Mohammed Mohiuddin –mw 009216 Seikh Faiyaz Moorsalin -mw00914 Md. Nadeem Chowdhury-cw009217 Sohana Mahmud –mw009215 Award Title: Individual modules UG frame work FCET-ERASMUS overseas students Name of the Supervisor Sam O. Wane October 2010
  2. 2. AbstractOver the last few years application of video surveillance system is increased. Thepopularity of such system leads to conduct extensive research for introducing morenew features in it. Most important feature of the video surveillance system is torecord video footage of the surveillance area. This is a project on video surveillancesystem that can detect movement of any object, record video footage of that objectand can transmit recorded video footage using Ad-Hoc network to a server. In thisproject, existing video surveillance system is studied. The components that arerequired for implementing such system is discussed. Suitable components to buildthis video surveillance system are selected. Selected component features arediscussed. Hardware implementation of the system is discussed. Software for videofootage recording and transmission is developed and discussed. Results from pilotwork to evaluate the system performance are included. Base on the results of pilotwork, methods of increasing system performance is proposed and scope of futurework is described. i
  3. 3. AcknowledgementFirst and foremost, all praises and gratitude to the almighty Allah for giving us thestrength, patients and courage to complete this project.We would like to convey our heartfelt gratitude to our supervisor Mr. Sam O. Wanefor his valuable guidance, inspiration and friendly attitude. We are thankful to himfor offering this unique project to us, which has a great value to the industry. He alsopromotes our project commercially to the industries as well as to the United Nations(UN) for remote disaster management. All these became possible for his visiontoward this project and its potentiality. We are much indebted for all theopportunities he has provided us for the completion of our group project.We would also like to thank Professor Moofik Al-Tai for introducing this groupproject module especially for Erasmus Undergraduate students. This module createsan opportunity to work in a group as a practical job experience and also expends thewindow of sharing knowledge with each other.Our special thanks go to lab technicians Mr. Dave and Mr. Paul for their constanttechnical support during the risk, safety and health assessment and also during theproject‟s implementation.We would like to say thanks to the members of our Bangladesh community inStaffordshire University. They always helped us to feel like home in a foreigncountry.We also like to express our deepest gratitude and love to our respective familiesespecially to our parents.Last but not the least; we are very much grateful to Staffordshire Universityauthority for offering us this great opportunity to study in promising Britishuniversity and to enjoy British civilization and their customs and culture. ii
  4. 4. Table of ContentsAbstract .................................................................................................................................... iAcknowledgement ................................................................................................................... ii1 Introduction .......................................................................................................................... 1 1.1 Background .................................................................................................................... 1 1.2 Aims and Objectives ...................................................................................................... 2 1.2.1 Objectives ............................................................................................................... 2 1.2.2 Deliverables ............................................................................................................ 2 1.3 Distribution of Work ...................................................................................................... 3 1.4 Project Planning ............................................................................................................. 62 Literature Review ................................................................................................................. 9 2.1Video Surveillance System.............................................................................................. 9 2.1.1Introduction: ............................................................................................................ 9 2.1.2 Classification of video surveillance system .......................................................... 10 2.2 Transmission of Video Footage ................................................................................... 11 2.2.1Wireless Networking ............................................................................................. 11 2.2.2 Ad-hoc Network.................................................................................................... 12 2.2.3 Bluetooth Transmission Technology .................................................................... 17 2.2.4 Protocol issues ...................................................................................................... 18 2.2.5 TCP/IP model ........................................................................................................ 19 2.2.6 Live streaming....................................................................................................... 23 2.2.7 Professional Video Surveillance Software ............................................................ 23 2.2.8 Encryption............................................................................................................. 27 2.2.9 Video Encryption .................................................................................................. 283 System Concept, Design and Implementation ................................................................... 30 3.1 Requirement analysis .................................................................................................. 30 3.2 Selection of Hardware ................................................................................................. 31 3.2.1 Selection of sensor ............................................................................................... 31 3.2.2 Selection of Video Camera ................................................................................... 32 3.2.3 Selection of Motor ................................................................................................ 32 3.2.4 Selection of PC ...................................................................................................... 32 3.2.5 Selection of Microcontroller ................................................................................. 33 3.2.6 Selection of Power Source .................................................................................... 33 iii
  5. 5. 3.3 Software design ........................................................................................................... 33 3.3.1Video Capturing Software Requirement .............................................................. 34 3.4 Component selection and Features ............................................................................ 35 3.4.1 Hardware Component Selection .......................................................................... 35 3.4.1.1 PIR Sensor ...................................................................................................... 35 3.4.1.2 Mbed Rapid Prototyping Board ..................................................................... 38 3.4.1.3 Servo Motor ................................................................................................... 40 3.4.1.4 FitPC2 ............................................................................................................. 42 3.4.1.5 Logitech Webcam C120 ................................................................................. 44 3.4.1.6 Power Supply ................................................................................................. 44 3.4.2 Software Selection ................................................................................................ 45 3.4.2.1 .Net Framework 4: ......................................................................................... 45 3.4.2.2 Microsoft C# .................................................................................................. 46 3.4.2.3 Direct Show API ............................................................................................. 46 3.4.2.4 Video Capture Devices................................................................................... 47 3.5 Cost Analysis ................................................................................................................ 47 3.6 System Implementation .............................................................................................. 48 3.6.1Hardware Implementation .................................................................................... 48 3.6.2 Software Development ......................................................................................... 56 3.6.2.1 Video Capturing ............................................................................................. 56 3.6.2.2 Client Server Transmission Software ............................................................. 63 3.6.3 System Integration ............................................................................................... 834 Pilot Work ........................................................................................................................... 93 4.1 The Nature of the work ............................................................................................... 93 4.2 The objectives of the Pilot Work ................................................................................. 93 4.3 Selection of Places ....................................................................................................... 93 4.3.1 Pilot Study 1 .......................................................................................................... 94 4.3.2 Pilot Study 2 .......................................................................................................... 95 4.3.3 Pilot Study 3 .......................................................................................................... 95 4.4 Results and Discussion................................................................................................. 965 Critical Analysis ................................................................................................................. 1026 Parallel Development ....................................................................................................... 104 6.1 Laser Range Finder URG-04LX-UG01 ......................................................................... 104 6.2 Hokuyo URG-04LX LRF analysis ................................................................................. 106 iv
  6. 6. 6.3 Developing Program for Hokuyo: .............................................................................. 1077 Future Work...................................................................................................................... 1188 Conclusion ........................................................................................................................ 1209 References ........................................................................................................................ 12210 Appendices ..................................................................................................................... 125 v
  7. 7. List of FiguresFigure1.1 Project Gantt chart part1........................................................................................7Figure 1.2 Project Gantt chart part2.......................................................................................8Figure 2.1: Ad-hoc Network............................................................................................... ...12Figure 2.2: A multi-node ad-hoc network .............................................................................13Figure 2.3: The hidden station problem ...............................................................................15Figure 2.4: Eye line video software ......................................................................................24Figure 2.5: Find and Play Recordings Window .....................................................................24Figure 2.6: Video Recordings ...............................................................................................25Figure 2.7: VideoLan Streaming Solution..............................................................................26Figure3.1: Block diagram of video surveillance system ........................................................31Figure3.2: General system architecture of PIR sensor .........................................................35Figure 3.3: Parallax-PIR sensor .............................................................................................36Figure 3.4: Jumper Pin (H and L) Position......................................................................... ....36Figure 3.5: Waveform of PIR sensor output for retrigger mode of operation................ .....37Figure3.6: Waveform of PIR sensor output for normal mode of operation .........................37Figure 3.7: mbed Microcontroller........................................................................................ 39Figure3.8: Servo motor ........................................................................................................40Figure3.9: Internal circuit of a servo motor..........................................................................41Figure3.10: Some random pulse and its corresponding rotation of a servo shaft................41Figure 3.11: fitPC2................................................................................................................ 43Figure3.12: Logitech C120 webcam .....................................................................................44Figure 3.13: Operation of CLR in .Net Framework............................................................... .45Figure3.14: Schematic diagram of input output test circuit..................................................49Figure3.15: Microcontroller and PIR sensor test circuit schematic diagram.........................50Figure 3.16: Experimental Figure...........................................................................................50Figure3.17: Three main pulse and their corresponding rotation .........................................52Figure 3.18: Connection diagram for serial communication.................................................53Figure 3.19: TeraTerm terminal window ..............................................................................54Figure 3.20: Schematic Diagram of power supply unit..........................................................55Figure3.21: Power supply unit.............................................................................................. 55Figure3.22: Software Diagram...............................................................................................56Figure3.23: Video Surveillance System GUI ..........................................................................57Figure 3.24: Communication in Local Network ....................................................................64 vi
  8. 8. Figure 3.25: Communication through Internet ....................................................................65Figure 3.26: Ad-hoc Communication between Two Systems...............................................65Figure 3.27: Ad-hoc Communication using more nodes...................................................... 66Figure3.28: Sending Video from Client to Server using Multi-node Ad-hoc Network .........66Figure 3.29: Log file’s data....................................................................................................69Figure3.30: Placing two flags on the frame edge..................................................................83Figure3.31: Diagram to calculate camera coverage angle.....................................................84Figure 3.32: Camera mounted on the servo shaft.................................................................85Figure 3.33: 1st step of fixing rotation angle..........................................................................85Figure 3.34: 2nd step of fixing rotation angle.........................................................................86Figure 3.35: 1st attempt of reducing PIR coverage angle.......................................................87Figure 3.36: Fresnel lens........................................................................................................87Figure 3.37: Solution of reducing PIR coverage angle...........................................................88Figure 3.38: Calculating PIR cover length for any angle Ө.....................................................89Figure 3.39: Identifying covered PIR angle ...........................................................................90Figure 3.40: Final connection diagram of the video surveillance system..............................91Figure 3.41.: Camera and sensors mounted on the system .................................................92Figure 3.42: Stand alone system on a tripod ........................................................................92Figure 4.1: Voltage and current of the system for continuous operation ............................97Figure4.2: Voltage and current of the system for discontinuous operation ........................97Figure 4.3: Voltage and current of the system for idle condition .........................................97Figure 4.4: Screen Shot of Recorded Video Footage in Over-Crowded Place ......................98Figure 4.5: Screen Shot of Recorded Video Footage in Less-Crowded Place .......................98Figure 6.1: Hokuyo URG-04LX Laser Rangefinder ...............................................................104Figure 6.2: Internal mechanism of Hokuyo LRF...................................................................105Figure 6.3: Range detection area of URG-04LX LRF.............................................................106Figure 6.4: Range diagram of an empty room.....................................................................107Figure 6.5: Range diagram of a room with 1 person...........................................................107Figure 6.6: Detection of movement in an empty room when a person passed................. 116Figure 6.7: Detection of movement in busy room when people are frequently passing....116 vii
  9. 9. List of TablesTable 3.1: Mode of operation of PIR sensor......................................................................... 37Table 3.2: Price list of components...................................................................................... 47Table 4.1: Data for Different Speed ......................................................................................99Table 4.2: Data for Detection Range and Area of Each Sensor ...........................................100Table 4.3: Experimental Data of Transmission Time...........................................................100Table 4.3: Experimental Data of Transmission Time...........................................................101Table 4.4: Experimental Data of Transmission Range.........................................................101Table 4.5: Experimental Data of Robustness Test...............................................................101 viii
  10. 10. Chapter 11 Introduction1.1 BackgroundOver the last few years due to globalization a major change has been occurred indifferent sectors worldwide such as business, security, health etc. One of theimportant sectors which are now concern worldwide is security. Due to theemergence of protecting premises, providing security is one of the most importanttasks. Thus in order to providing security, video surveillance system was introduced.A video surveillance system is used to monitoring of the behaviour, activity or otherinformation generally of people in a specific area. The application of videosurveillance is now not only limited to provide security of an area. Such systems arenow implemented in different sectors like hospital for monitoring patient, in industryand process plant to monitor the activity of the production line etc. Generally a videosurveillance system consists of a video camera for capturing video footage and amonitor to see the capturing footage. Early model of such system had somelimitation. Thus in order to improve this system research has been conducted andmore developed system has been arrived in the market. Current systems that isavailable in the market have different features such as video capturing andrecording.A new feature which has been introduced in this type of system over the last fewyears is transmission of video footage using wireless communication. This featurehas given an advantage to place this system into any area. Thus it is now possible tomonitor any place where human presence is not all time attainable.It is still now expensive to build this type of system and also the implementation ofsuch system with fully automation. This project aims to design and construct of astandalone video surveillance system which is capable movement detection of anyobject, record video footage of that object and transmits that video footage using Ad-Hoc network to a server. 1
  11. 11. 1.2 Aims and ObjectivesThe aim of this project is to design and construct a video surveillance system whichcan capture video footage of home, office, or any premise. The system is able todetect any object in motion within a particular area and can capture video footagetriggered by motion as it happens. And also the system is able to transmit therecorded video footage via a wireless Ad-Hoc network to a server. The system willbe standalone and will be able to function for one week unattended. It must thereforebe extremely robust and be able to recover from any errors without intervention.1.2.1 ObjectivesThe objectives of the project are:  Interfacing sensor with microcontroller for motion detection.  Position and speed control of a motor to achieve precise angle.  Interfacing microcontroller with a PC.  Developing software for capturing video footage.  Develop a client-server video streaming system that will transmit the recently stored video and broadcast it through the network. The client system will be able to transmit stored video and the server system will be able to receive it.  A complete battery system and power supply unit to power up the video surveillance system.  To construct a robust shell for this system.1.2.2 DeliverablesFor achieving aim of the project following are the deliverables:  A program that tests microcontroller I/O port by turning on a LED connected to output port by giving an input to the input port. 2
  12. 12.  A motion detection circuit with three motion detector sensors that interfaced with the microcontroller and detect motion. Three LED will be connected with the output port of the microcontroller and each LED will turn on when motion is detected by associated sensor.  A program that will send few bytes of information from microcontroller to PC and the information will be displayed on the PC.  A program to scan ports for a data and show the data.  Software with Graphical User Interface (GUI) which will consist of a start and stop button for capturing video footage. It will save the video footage with particular date and time in a specific format into a specific folder.  A circuit with motor and microcontroller. The microcontroller will be able to control the motor with precise angle.  A program that will turn the motor shaft in a specific location and control the rotation angle precisely.  A frame that will contain sensors, motor and camera.  Client-side software that will transmit recorded video footage.  Server-side software that will receive the transmitted video and stream it to the local network.1.3 Distribution of WorkThis is a final year group project. This group consists of four members. The nameand the ID of the group member are given below: 1. Mohammed Mohiuddin (MM) - 09009216 2. Sheikh Faiyaz Moorsalin(SFM) - 09009214 3. Md Nadeem Chowdhury(MNC) - 09009217 4. Sohana Mahmud(SM) - 09009215Each member of the group is assigned with individual objectives and deliverables inorder to fulfil the overall objectives and deliverables of this project. At the end of theproject each member submitted report on their work. And this report is completed 3
  13. 13. with the help of individual report of each member but as a group wise manner. Theindividual objectives and deliverables in the projects and contribution of eachmember in this report are given below separately with their initials.Mohammed Mohiuddin (MM):Objectives  Interfacing PIR (Passive Infrared) sensor with microcontroller for motion detection.  Interfacing microcontroller with an embedded PC.Deliverables: 1. A program that tests microcontroller I/O port by turning on a LED connected to output port by giving an input to the input port. 2. A motion detection circuit with three motion detector sensors that interfaced with the microcontroller and detect motion. Three LED will be connected with the output port of the microcontroller and each LED will turn on when motion is detected by associated sensor. 3. A program that will send few bytes of information from microcontroller to PC and the information will be displayed on the PC.Contribution in the Report:In this report contributions of Mohammed Mohiuddin are in abstract, introduction,literature review (video surveillance system), system concept and design, hardwarerequirement analysis, hardware selection criteria (sensor, microcontroller, PC,webcam), selection of hardware component (PIR sensor, mbed Microcontroller,fitPC2, Logitech webcam C120), cost analysis, hardware implementation (PIRsensor, fitpc2, mbed microcontroller, power supply unit), Hardware and softwareintegration, pilot work, critical analysis (Hardware part), future work andconclusion. 4
  14. 14. Sheikh Faiyaz Moorsalin (SFM)Objectives  Developing software for capturing video footage.Deliverables: 1. A program to scan ports for a data and show the data. 2. Software with Graphical User Interface (GUI) which will consist of a start and stop button for capturing video. After pressing the stop button it will save the video footage with particular date and time in a specific video format into a specific folder.Contribution in Report:In this report contributions of Sheikh Faiyaz Moorsalin are in software requirementanalysis, software design for video capturing, and future work for softwareimprovement.Md Nadeem Chowdhury (MNC)Objectives  Interfacing between motor, motor controller and microcontroller.  Position and speed control of a motor.  Detecting Motion using Hokuyo URG Laser Range Finder.Deliverables: 1. A circuit with motor, motor controller and microcontroller. The microcontroller will be able to control the motor via motor controller. 2. A program that will turn the motor shaft in a specific location and control the rotation angle precisely. 3. A frame that will contain sensors, motor and camera. 4. A program that will scan and detect movement by Hokuyo URG Laser Range Finder. 5
  15. 15. Contribution in Report:In this report contributions of Md Nadeem Chowdhury are in motor selection (servomotor), controlling method of motor, system implementation (servomotor), robustshell design, cover design to reduce the PIR angle and axis equalization Logitechwebcam and PIR sensor. And in future work to improve movement detectionperformance of the system using Hokuyo Laser sensor.Sohana Mahmud (SM)Objective  Develop a client-server video streaming system that will transmit the recently stored video and broadcast it through the network. The client system will be able to transmit stored video and the server system will be able to receive it.Deliverables: 1. A Client-side software that will transmit recorded video using Ad-Hoc network 2. A Server-side software that will receive the video and stream it to the local network.Contribution in Report:In this report contributions of Sohana Mahmud are in literature review(Transmission of video footage), software design for transmission, critical analysis(transmission software), future work for software improvement.1.4 Project PlanningThe Gantt chart of the project is given in figure 1.1 and figure 1.2 6
  16. 16. Figure 1.1: Project Gantt chart 7
  17. 17. Figure 1.2: Project Gantt chart 8
  18. 18. Chapter 22 Literature Review2.1Video Surveillance System2.1.1Introduction:The video surveillance system was first used in 1960 to monitor crowds attracted tothe arrival of the Thai royal family in Trafalgar Square, London [1]. The early modelthat was used for video surveillance system was all analog and known as CCTV(closed circuit television). A basic CCTV video surveillance system consists of acollection of video cameras. This camera usually mounted in fixed position. Thesurveillance area of CCTV video surveillance system depends on the field of viewangle of the cameras. The video footage captured is transmitted to a central location.In central location the transmitted video footage displayed on one or several monitoror recorded in a storage device. In CCTV video surveillance system the person incharge, who stays in the central location will monitor the activities of thesurveillance area and will decide if there is any intruder or any activity is ongoingthat warrants a response. With invention of digital technology this system started tochange in the mid of the 20th century. Present video surveillance systems are fullydigitalized and automated. Automated video surveillance system introducesautomatic object detection in the surveillance. This system can generate alarm orgenerate message that allow user to know if there is any intruder in the surveillancearea, thus reducing the burden of the user. This system can be based on PC, orembedded devices, constitute a monitoring system, and multimedia management.With the development in communication sector such as wireless communication,broadband, the transmission system of video footage from a surveillance area is nowchanged. Many systems are now using wireless communication technology fortransmission instead of cable transmission. 9
  19. 19. 2.1.2 Classification of video surveillance systemVideo surveillance system technologies can be classified based on movementdetection technique. Two types of technique are widely used for object detection invideo surveillance system, these are 1. Video surveillance system using motion detection by sensors. 2. Video surveillance system using motion detection by image processing.1. Video surveillance system using motion detection by sensors:This type of video surveillance system use different types of sensor for objectdetection. Some sensor that are widely use for detecting object are passive infraredsensor, ultrasonic sensor and microwave sensor. Among the sensors, PIR sensors arewidely used in surveillance systems and automatic light switching systems. In 2004,in university of Malaya a PIR based intruder system is designed. The designedsystem can track occupants in a designated area, switch on alarm when intrusionoccurs, notify client of the intrusion and provide real time monitoring function byusing personal computer through the internet [2]. Their system used three differentPIR sensors to detect movement. The output from PIR sensor modules are wired to amicrocontroller. The microcontroller acts as the heart of the system and processesthese sensor signals. This signal is then send to a PC using FM transmitter andfurther analyzed by software for sending alarm or message signal to the user. Theirimplemented system is able to detect the presence of human in a protected area withmaximum distance of around 7 meters. On April 2006 Mitsubishi ElectricCorporation proposed a design on video surveillance system with Object-AwareVideo Transcoder [3]. The proposed system not only store high quality video data. Italso transmits the data over a limited bandwidth network. On 2002 College ofSciences, Massey University, a security system has been developed using motiondetection. Their system used PIR sensors which are interfaced to a microcontrollerfor motion detection [4]. They also developed software to add appropriate behaviourto the security platform. In 2008 Ying-Wen Bai and Hen Teng, Department ofElectronic Engineering, Fu Jen Catholic University,Design ahome surveillancesystem. The system includes an ARM processor together with a Web camera and a 10
  20. 20. PIR sensor. The system triggers the Web camera in presence of an intruder in orderto capture and send to a remote server the snapshot. [5]2. Video surveillance system using motion detection by image processing:In this type of video surveillance system movement is detected comparing theimages of video surveillance area. If the two images are same them no movement isdetected. When a intruder enter the surveillance area the results of the comparisoncan detect the intruder thus movement can be detected using this technique. Thereare many different algorithms available for detection of movement using imagesprocessing.This project is related the work with the video surveillance system by movementdetection using senor. Thus this literature review helped to get an idea about theexisting video surveillance system.2.2 Transmission of Video FootageTo build a robust and appropriate software for transmission of video footage viawireless network, reviews of some existing protocols, architectures is done. Reviewsof the existing protocols, architectures are as follows2.2.1Wireless NetworkingWireless network is a type of computer network where interconnectionsbetween nodes are implemented without the use of wires. This network is set up byusing radio signal frequency to communicate among computers and other networkdevices. Sometimes it‟s also referred to as WiFi network or WLAN. This network isgetting popular nowadays due to easy to setup feature and no cabling involved.[6]The simple explanation of how it works is between 2 computers each equipped withwireless adapter and a wireless router is setup. When the computers send out thedata, the binary data will be encoded to radio frequency and transmitted via wirelessrouter. The receiving computer will then decode the signal back to binary data. The 11
  21. 21. two main components are wireless router or access point and wireless clients whichconnects the wireless device with other network or internet.2.2.2 Ad-hoc Network Figure 2.1: Ad-hoc Network [7]An ad hoc network, or MANET (Mobile Ad hoc NETwork), is a network composedonly of nodes, with no Access Point. Messages are exchanged and relayed betweennodes. In fact, an ad hoc network has the capability of making communicationspossible even between two nodes that are not in direct range with each other: packetsto be exchanged between these two nodes are forwarded by intermediate nodes,using a routing algorithm. Hence, a MANET may spread over a larger distance,provided that its ends are interconnected by a chain of links between nodes (alsocalled routers in this architecture). In the ad hoc network shown in the followingfigure, node A can communicate with node D via nodes B and C, and vice versa[8]. 12
  22. 22. Figure 2.2: A multi-node ad-hoc network [8]A sensor network is a special class of ad hoc network, composed of devicesequipped with sensors to monitor temperature, sound, or any other environmentalcondition. These devices are usually deployed in large number and have limitedresources in terms of battery energy, bandwidth, memory, and computational power[8].Mode:No fixed infrastructure or base station is needed. Entities communicate with eachother through multiple wireless links. Each node serves as a router to forwardpackets for others.Power issue:Nodes are usually powered by batteries. Power –aware and energy efficientalgorithms can significantly improve the performance of the systems. Ad-hocnetwork consist of large numbers of unattended devices where battery replacementis much more difficult [9].The optimization goal of routing is to lower the power usage so as to enhance thenetwork availability.Long term Connectivity:One of the important problems is the long term connectivity maintenance ofnetworks. Nodes are often homogeneous in terms of initial energy while their 13
  23. 23. workloads are always unevenly distributed, causing some nodes to deplete theirenergy faster than others. More seriously, nodes closer to sink always have moreworkload than more distant nodes. They not only transmit their own data but alsohelp to forward others data. Consequently, they are prone to failure because of thedepletion of the energy. This is the so-called “hot spot” problems [10][11]. But thisnot has been fully investigated.Advantages and disadvantagesA wireless network offers important advantages with respect to its wired homologue[8]: The main advantage is that a wireless network allows the machines to be fully mobile, as long as they remain in radio range. Even when the machines do not necessarily need to be mobile, a wireless network avoids the burden of having cables between the machines. From this point of view, setting a wireless network is simpler and faster. In several cases, because of the nature and topology of the landscape, it is not possible or desirable to deploy cables: battlefields, search-and-rescue operations, or standard communication needs in ancient buildings, museums, public exhibitions, train stations, or inter-building areas. While the immediate cost of a small wireless network (the cost of the network cards) may be higher than the cost of a wired one, extending the network is cheaper. As there are no wires, there is no cost for material, installation and maintenance. Moreover, mutating the topology of a wireless network – to add, remove or displace a machine – is easy.On the other hand, there are some drawbacks that need to be pondered [8]: The strength of the radio signal weakens (with the square of the distance), hence the machines have a limited radio range and a restricted scope of the network. This causes the well-known hidden station problem: consider three machines A, B and C, where both A and C is in radio range of B but they are not in radio range of each other. This may happen because the A - C distance is greater than the A - B and B – C distances, as in Figure, or because of an obstacle between A and C. The hidden station problem occurs whenever C is 14
  24. 24. transmitting: when A wants to send to B, A cannot hear that B is busy and that a message collision would occur, hence A transmits when it should not; and when B wants to send to A, it mistakenly thinks that the transmission will fail, hence B abstains from transmitting when it would not need to. Figure 2.3: The hidden station problem [8] The site variably influences the functioning of the network: radio waves are absorbed by some objects (brick walls, trees, earth, human bodies) and reflected by others (fences, pipes, other metallic objects, and water). Wireless networks are also subject to interferences by other equipment that shares the same band, such as microwave ovens and other wireless networks. Considering the limited range and possible interferences, the data rate is often lower than that of a wired network. However, nowadays some standards offer data rates comparable to those of Ethernet. Due to limitations of the medium, it is not possible to transmit and to listen at the same time, therefore there are higher chances of message collisions. Collisions and interferences make message losses more likely. Being mobile computers, the machines have limited battery and computation power. This may entail high communication latency: machines may be off most of the time (doze state i.e. power-saving mode) and turning on their receivers periodically, therefore it is necessary to wait until they wake up and are ready to communicate. 15
  25. 25.  As data is transmitted over Hertzian waves, wireless networks are inherently less secure. In fact, transmissions between two computers can be eavesdropped by any similar equipment that happens to be in radio range.Routing protocols for ad hoc networks [8]In ad hoc networks, to ensure the delivery of a packet from sender to destination,each node must run a routing protocol and maintain its routing tables in memory.Reactive protocolsUnder a reactive (also called on-demand) protocol, topology data is given only whenneeded. Whenever a node wants to know the route to a destination node, it floods thenetwork with a route request message. This gives reduced average control traffic,with bursts of messages when packets need being routed and an additional delay dueto the fact that the route is not immediately available.Proactive protocolsIn opposition, proactive (also called periodic or table driven) protocols arecharacterized by periodic exchange of topology control messages. Nodesperiodically update their routing tables. Therefore, control traffic is more dense butconstant, and routes are instantly available.Hybrid protocolsHybrid protocols have both the reactive and proactive nature. Usually, the network isdivided into regions, and a node employs a proactive protocol for routing inside itsnear neighborhood‟s region and a reactive protocol for routing outside this region.The Optimized Link State Routing protocolThe Optimized Link State Routing (OLSR) protocol is a proactive link state routingprotocol for ad hoc networks.The core optimization of OLSR is the flooding mechanism for distributing link stateinformation, which is broadcast in the network by selected nodes called MultipointRelays (MPR). As a further optimization, only partial link state is diffused in thenetwork. OLSR provides optimal routes (in terms of number of hops) and isparticularly suitable for large and dense networks. 16
  26. 26. 2.2.3 Bluetooth Transmission TechnologyThe dream for true, seamless, mobile data and voice communications that enablesconstant connectivity anywhere is quickly becoming a reality. Wireless andcomputer industries are clearly leading the way with revolutionary components thatwill shape our lives in the next century. In 1994, Ericsson Mobile Communicationsinitiated a study to investigate the feasibility of a low power, low cost radio interfacebetween mobile phones and their accessories. The aim of this study was to eliminatecables between mobile phones and PC Cards used to connect the phones to acomputer for dial up networks (DUN). In 1998 Intel, IBM, Toshiba, Ericsson andNokia began developing a technology that would allow users to easily connect tomobile devices without cables [12].This technological vision became a reality through the synergy of market leaders inlaptop computing, telecommunications, and core digital signal processing. May20th, 1998 marked the formation of the Bluetooth Special Interest Group (SIG) withthe goal to design a royalty free, open specification, de facto, short range, low powerwireless communication standard, as well as a specification for small-form factor,low-cost, short range radio links between mobile PCs, mobile phones and otherportable devices codenamed Bluetooth. The result was an open specification for atechnology to enable short-range wireless voice and data communications anywherein the world. A simple way is to connect and communicate without wires or cablesbetween electronic devices including computers, PDA‟s, cell-phones, networkaccess and peripherals.The technology of Bluetooth operates in a globally available frequency bandensuring communication compatibility worldwide. One of the primary advantages ofthe Bluetooth system is ease of computer vendor product integration. Other keybenefits of this technology are low power, long battery life, low cost, lowcomplexity, and wireless connectivity for personal space, peer-peer, cablereplacement, and seamless and ubiquitous connectivity. To achieve the Bluetoothgoal, tiny, inexpensive, short-range transceivers are integrated into devices eitherdirectly or through an adapter device such as a PC Card. Add on devices such as aUSB or Parallel port connections are also available for legacy systems. By 17
  27. 27. establishing links in a more convenient manner this technology will add tremendousbenefits to the ease of sharing data between devices.One universal short-range radio link can replace many proprietary cables thatconnect one device to another. Laptop and cellular users will no longer requirecumbersome cables to connect the two devices to send and receive email. Possiblehealth risks from radiated RF energy of cellular handsets are mitigated with lowertransmission power of the Bluetooth enabled ear set. (The ear set solution does notrequire the handset to be close to the head.) Moreover, unlike the traditional headset,the wireless ear set frees the user from any unnecessary wiring.As Bluetooth offers the ability to provide seamless voice and data connections tovirtually all sorts of personal devices the human imagination is the only limit toapplication options. Beyond un-tethering devices by replacing the cables, thistechnology provides a universal bridge to existing data networks, allows users toform a small private ad hoc wireless network outside of fixed networkinfrastructures, enables users to connect to a wide range of computing andtelecommunications devices easily and simply, without the need to buy, carry, orconnect cables. The Bluetooth technology allows users to think about what they areworking on, rather than how to make their technology work. The InternalDocuments and Presentations (IDC) forecast in 2004, 103.1 million devices in theUnited States and 451.9 million devices worldwide would become Bluetoothenabled [12].2.2.4 Protocol issuesDesigning a network protocol to support streaming media raises many issues, suchas: Datagram protocols, such as the User Datagram Protocol (UDP), send the media stream as a series of small packets. This is simple and efficient; however, there is no mechanism within the protocol to guarantee delivery. It is up to the receiving application to detect loss or corruption and recover data using error correction techniques. If data is lost, the stream may suffer a dropout. The Real-time Streaming Protocol (RTSP), Real-time Transport Protocol (RTP) and the Real-time Transport Control Protocol (RTCP) were specifically designed 18
  28. 28. to stream media over networks. RTSP runs over a variety of transport protocols, while the latter two are built on top of UDP [13]. Another approach that seems to incorporate both the advantages of using a standard web protocol and the ability to be used for streaming even live content is the HTTP adaptive bitrates streaming. HTTP adaptive bitrates streaming is based on HTTP progressive download, but contrary to the previous approach, here the files are very small, so that they can be compared to the streaming of packets, much like the case of using RTSP and RTP [14]. Reliable protocols, such as the Transmission Control Protocol (TCP), guarantee correct delivery of each bit in the media stream. However, they accomplish this with a system of timeouts and retries, which makes them more complex to implement. It also means that when there is data loss on the network, the media stream stalls while the protocol handlers detect the loss and retransmit the missing data. Clients can minimize this effect by buffering data for display [15]. Unicast protocols send a separate copy of the media stream from the server to each recipient. Unicast is the norm for most Internet connections, but does not scale well when many users want to view the same program concurrently.2.2.5 TCP/IP modelThe TCP/IP model is a description framework for computer network protocolscreated in the 1970s by DARPA, an agency of the United States Department ofDefense. It evolved from ARPANET, which were the worlds first wide areanetwork and a predecessor of the Internet. The TCP/IP Model is sometimes calledthe Internet Model or the DoD Model [16].As with all other communications protocol, TCP/IP is composed of layers: IP - is responsible for moving packet of data from node to node. IP forwards each packet based on a four byte destination address (the IP number). The Internet authorities assign ranges of numbers to different organizations. The organizations assign groups of their numbers to departments. IP operates on gateway machines that move data from department to organization to region and then around the world. 19
  29. 29.  TCP is responsible for verifying the correct delivery of data from client to server. Data can be lost in the intermediate network. TCP adds support to detect errors or lost data and to trigger retransmission until the data is correctly and completely received. A socket is a name given to the package of subroutines that provide access to TCP/IP on most systems.The TCP/IP model, or Internet Protocol Suite, describes a set of general designguidelines and implementations of specific networking protocols to enablecomputers to communicate over a network. TCP/IP provides end-to-end connectivityspecifying how data should be formatted, addressed, transmitted, routed andreceived at the destination. Protocols exist for a variety of different types ofcommunication services between computers [16].It defines as a four-layer model, with the layers having names, not numbers, asfollows:  Application Layer (process-to-process): This is the scope within which applications create user data and communicate this data to other processes or applications on another or the same host. The communications partners are often called peers. This is where the "higher level" protocols such as SMTP, FTP, SSH, HTTP, etc. operate.  Transport Layer (host-to-host): The Transport Layer constitutes the networking regime between two network hosts, either on the local network or on remote networks separated by routers. The Transport Layer provides a uniform networking interface that hides the actual topology (layout) of the underlying network connections. This is where flow-control, error- correction, and connection protocols exist, such as TCP. This layer deals with opening and maintaining connections between Internet hosts.  Internet Layer (internetworking): The Internet Layer has the task of exchanging datagrams across network boundaries. It is therefore also referred to as the layer that establishes internetworking; indeed, it defines and establishes the Internet. This layer defines the addressing and routing structures used for the TCP/IP protocol suite. The primary protocol in this scope is the Internet Protocol, which defines IP addresses. Its function in 20
  30. 30. routing is to transport datagram to the next IP router that has the connectivity to a network closer to the final data destination.  Link Layer: This layer defines the networking methods with the scope of the local network link on which hosts communicate without intervening routers. This layer describes the protocols used to describe the local network topology and the interfaces needed to affect transmission of Internet Layer datagram to next-neighbor hosts. (cf. the OSI Data Link Layer).AddressesEach technology has its own convention for transmitting messages between twomachines within the same network. On a LAN, messages are sent between machinesby supplying the six byte unique identifier (the "MAC" address). In an SNAnetwork, every machine has Logical Units with their own network address.DECNET, Appletalk, and Novell IPX all have a scheme for assigning numbers toeach local network and to each workstation attached to the network [16].On top of these local or vendor specific network addresses, TCP/IP assigns a uniquenumber to every workstation in the world. This "IP number" is a four byte value that,by convention, is expressed by converting each byte into a decimal number (0 to255) and separating the bytes with a period.An Uncertain Path [16]Every time a message arrives at an IP router, it makes an individual decision aboutwhere to send it next. There is concept of a session with a preselected path for alltraffic. There is no correct answer about how does the router make a decisionbetween routes. Traffic could be routed by the "clockwise" algorithm. The routerscould alternate, sending one message to one place and the next to other place. Moresophisticated routing measures traffic patterns and sends data through the least busylink.If one phone line in this network breaks down, traffic can still reach its destinationthrough a roundabout path. This provides continued service though with degradedperformance. This kind of recovery is the primary design feature of IP. The loss ofthe line is immediately detected by the routers, but somehow this information mustbe sent to the other nodes. Each network adopts some Router Protocol which 21
  31. 31. periodically updates the routing tables throughout the network with informationabout changes in route status.If the size of the network grows, then the complexity of the routing updates willincrease as will the cost of transmitting them. Building a single network that coversthe entire US would be unreasonably complicated. Fortunately, the Internet isdesigned as a Network of Networks. This means that loops and redundancy are builtinto each regional carrier. The regional network handles its own problems andreroutes messages internally. Its Router Protocol updates the tables in its ownrouters, but no routing updates need to propagate from a regional carrier.TCP treats the data as a stream of bytes. It logically assigns a sequence number toeach byte. The TCP packet has a header that says, in effect, "This packet starts withbyte 379642 and contains 200 bytes of data." The receiver can detect missing orincorrectly sequenced packets. TCP acknowledges data that has been received andretransmits data that has been lost. The TCP design means that error recovery isdone end-to-end between the Client and Server machine. There is no formal standardfor tracking problems in the middle of the network, though each network hasadopted some ad hoc tools.Each large company or university that subscribes to the Internet must have anintermediate level of network organization and expertise. Half dozen routers mightbe configured to connect several dozen departmental LANs in several buildings. Alltraffic outside the organization would typically be routed to a single connection to aregional network provider.However, the end user can install TCP/IP on a personal computer without anyknowledge of either the corporate or regional network. Three pieces of informationare required:1. The IP address assigned to this personal computer2. The part of the IP address (the subnet mask) that distinguishes other machines on the same LAN (messages can be sent to them directly) from machines in other departments or elsewhere in the world (which are sent to a router machine)3. The IP address of the router machine that connects this LAN to the rest of the world. 22
  32. 32. 2.2.6 Live streamingLive streaming means taking the video and broadcasting it live over theinternet/network. The process involves a camera for the video, an encoder to digitizethe content, a video publisher where the streams are made available to potential end-users and a content delivery network to distribute and deliver the content. The mediacan then be viewed by end-users live [17].There are some primary technical issues related to streaming. They are: The system must have enough CPU power and bus bandwidth to support the required data rates The software should create low-latency interrupt paths in the operating system (OS) to prevent buffer under run.However, computer networks were still limited, and media was usually deliveredover non-streaming channels, such as by downloading a digital file from a remoteserver and then saving it to a local drive on the end users computer or storing it as adigital file and playing it back from CD-ROMs.During the late 1990s and early 2000s, Internet users saw greater networkbandwidth, increased access to networks, use of standard protocols and formats,such as TCP/IP, HTTP. These advances in computer networking combined withpowerful home computers and modern operating systems made streaming mediapractical and affordable for ordinary consumers. But multimedia content has a largevolume, so media storage and transmission costs are still significant [17].2.2.7 Professional Video Surveillance SoftwareEyeline video surveillance softwareDesigned specifically for business, Eyeline is perfect for video monitoring of officesand buildings, or to log in-store cameras. Used in conjunction with a security alarm,Eyeline can capture, analyse and play back security footage to determine if a 23
  33. 33. security call out is warranted. Eyeline is also a simple and effective video securitysystem for your home [18]. Figure 2.4: Eye line video software [18]Camera Properties: Figure 2.5: Find and Play Recordings Window [18] 24
  34. 34. Figure 2.6: Video Recordings [18]Features of this software [18] Records up to 100+ camera sources simultaneously Motion detection recording saves space by only recording when something is happening Email or SMS alerts available for motion detection Automatic time stamping of frames lets you use footage as evidence if required Web control panel lets you access and view recordings remotely Save to feature lets you save footage to a network folder Back up recordings via FTP Video can be monitored live on the screen as it records Cameras can be setup in a flash by just a click of a button Find and play recordings ordered by camera, date, duration and motion detected Integrated with Express burn to record video files to DVD Intelligent, easy to use and extremely reliable for day-to-day operation 25
  35. 35. Streaming video Using VLCThe VLC media player is an amazing piece of software. In its most basic form it is alightweight media player that can play almost any audio or video format you throwat it. VLC is also multiplatform in the most extreme sense of the word; it can run onWindows, OSX, Linux and PocketPC / WinCE handhelds along with other systems.VLC works great as a streaming server and video transcoder too [19] [20]. Figure 2.7: VideoLan Streaming Solution [21]The network needed to setup the VideoLAN solution can be as small as one ethernet10/100Mb switch or hub, and as big as the whole Internet. Moreover, the VideoLANstreaming solution has full IPv6 support [21].Examples of needed bandwidth are: 0.5 to 4 Mbit/s for a MPEG-4 stream, 3 to 4 Mbit/s for an MPEG-2 stream read from a satellite card, a digital television card or a MPEG-2 encoding card, 6 to 9 Mbit/s for a DVD.VLC is able to announce its streams using the SAP/SDP standard, or using Zeroconf(also known as Bonjour) [21]. 26
  36. 36. 2.2.8 EncryptionEncryption is a process that takes information and transcribes it into a different formthat is unable to read by anyone who does not have the encryption code [22].Manual EncryptionManual encryption is a type that involves the use of encryption software. These arecomputer programs that encrypt various bits of information digitally. Manualencryption involves the users participation completely. The files he wants to encryptare chosen, and then an encryption type is chosen from a list that the security systemprovides.Transparent EncryptionTransparent encryption is another type of computer software encryption. It can bedownloaded onto a computer to encrypt everything automatically. This is one of themost secure types of encryption available because it doesnt leave out anything thatmight be forgotten when using manual encryption.Symmetric EncryptionNot all encryption is done via a computer software program. Anyone can easilyencrypt information. One of the simplest ways to do this is through symmetricencryption. Here, a letter or number coincides with another letter or number in theencryption code.Asymmetric EncryptionAsymmetric encryption is a secure and easy way that can be used to encrypt datathat you will be receiving. It is generally done electronically. A public key is givenout to the public to see. They can then encrypt information using the key and send itto you. This is often done when writing emails. However, to decipher the encryptedcode, there is another key, a private one, that only one person has. This means thatwhile any can encrypt the data with the public key, it can only be read again bywhoever has the private key. 27
  37. 37. 2.2.9 Video EncryptionVideo encryption or video scrambling is a powerful technique for the preventingunwanted interception and viewing of transmitted video, for example from a lawenforcement video surveillance being relayed back to a central viewing centre [23].Video encryption is the easy part. It is the unscrambling thats hard. There areseveral techniques of video encryption. However, the human eye is very good atspotting distortions in pictures due to poor video decoding or poor choice of videoencryption hardware. So, it‟s important to choose the right video encryptionhardware else you video transmissions may be unsecure or you‟re decoding videoun-viewable.Some popular techniques for Video Encryption are outlined below [22] [23]: Line Inversion Video Encryption: Encryption Method: Whole or part video scan lines are inverted. Advantages: Simple, cheap video encryption. Disadvantages: Poor video decrypting quality, low obscurity, low security. Sync Suppression Video Encryption: Encryption Method: Hide/remove the horizontal/vertical line syncs. Advantages: Provides a low cost solution to scrambling and provides good quality video decoding. Disadvantages: This method is incompatible with some distribution equipment. Obscurity (i.e. how easy it is to visually decipher the image) is dependent on video content. Line Shuffle Video Encryption: Encryption Method: Each video line is re-ordered on the screen. Advantages: Provides a compatible video signal, a reasonable amount of obscurity, good decode quality. Disadvantages: Requires a lot of digital storage space. There are potential issues with video stability. Less secure than the cut and rotate encryption method. Cut & Rotate Video Encryption: Encryption Method: Each scan line is cut into pieces and re-assembled in a different order. 28
  38. 38. Advantages: Provides a compatible video signal, gives an excellent amount of obscurity, as well as good decode quality and stability. Disadvantages: Can have complex timing control and requires specialized scrambling equipmentThe cut and rotate video encryption method is probably the best way of achievingreliable and good quality video encryption.Factors in video encryption implementationFinally and most obviously each user must have a unique encryption key so thatother users of the system cannot view the transmitted video by accident or purposewithout the key owner‟s knowledge. The total number of possible user keys must besuch that it is highly unlikely for someone to guess the correct key [24]. The keypoints for a good video encryption method are: Everyone has a unique encryption key or code. The video encryption system should not try and decode not encrypted video transmissions. The encrypted signal should be positively identified by the decoder. The decoder should recognize the encrypted signal and only attempt to decode when fully validated. On screen status display and identification. Automatic configuration to any video standard. 29
  39. 39. Chapter 33 System Concept, Design and ImplementationIn this section the requirement analysis for building video surveillance system isdescribed. The conceptual system block diagram is included. And a detail selectioncriterion of each component is discussed.3.1 Requirement analysisThe video surveillance system will detect movement of any moving object. Afterdetecting movement it will turn the camera towards the moving object and start torecord video footage of that object. When the recording is finished it will transmitthe video footage through wireless Ad-Hoc network from the client (surveillancesystem) to a server. The key requirements of the system are: 1. The system must consist of a sensor which will detect movement of any object. 2. The system must have a video camera to record footage. The camera should capable of recording high quality video footage in order to ensure that, the recorded object can be detected from the recorded video footage. 3. The system must consist of a device which can turn video camera to any direction within 180 degree. 4. The system must consist of a storage device that will store video footage. 5. The system must consist of a device which has a wireless transmission capability to transmit the recorded video footage. 6. There should be a device which will control the whole system. 7. There must be software which will record video footage and store it to a storage device. 8. There must be software which will transmit recorded video footage via wireless Ad-Hoc network. 9. The system must consist of a power supply unit that will power up the whole system. 30
  40. 40. After finishing the requirement analysis a block diagram of the system is designed. Figure 3.1 shows the blocks diagram of the system. Figure3.1: Block diagram of video surveillance system3.2 Selection of HardwareAccording to the requirement analysis each hardware component will be selected sothat it will meet the system requirements. In the following section the selectioncriteria of each component is described.3.2.1 Selection of sensorThe sensor should be able to detect the movement during day or night. The range ofthe sensor must be as large as possible; it will ensure a good coverage area for videosurveillance. The sensor should consume less power, which will give an advantageto run the standalone video surveillance more time with a single power source. 31
  41. 41. 3.2.2 Selection of Video CameraThe video camera of the system must have the following features 1. The resolution of the video footage of the camera should be high. It will ensure easy recognition of the object from the recorded video footage. 2. The weight of the camera should be less in order to couple it with any motor. 3. The video camera must have easy connectivity features so that it could be easily connected with the relevant device for capturing video footage. 4. It should consume a small amount of power.3.2.3 Selection of MotorAccording to the requirement analysis the system should be able to record videofootage from any direction within 180 degree. Thus the system requires a motorwhich shaft can be positioned in any desired direction between 0-180 degrees. Thecamera will be mounted on the motor shaft and the motor will turn the video cameratowards the moving object precisely. The motor must have strong torque to turn thecamera toward the moving object. The motor should consume a small amount ofpower.3.2.4 Selection of PCFor capturing and transmitting video footage a computer will be used. Theconfiguration of the PC should be high enough so that it can run the software thatwill use to record and transmit video footage. The PC must have connectivity port toconnect the video camera with it. The PC should be small enough to use it in thestandalone system and should consume a small amount of power. It must consist of awireless network card to establish wireless communication with other device. ThePC should quickly boot up, it should robust to any kind of power failure and must beable to start program without user intervention. 32
  42. 42. 3.2.5 Selection of MicrocontrollerMicrocontroller will control the whole system. The microcontroller will take thesignal from the sensor and it will turn the motor so that the camera can turn towardsthe moving object. And it will send a signal to the PC to record video footage whena movement is detected. Thus the micro controller should have the followingfeatures 1. It should consist of serial or USB communication so that it can communicate with PC for sending the triggered signal. 2. It must have input port so that it could take input signal from the sensor when the sensor is triggered by any movement. 3. It should have some output port so that it can control the motor for turning any direction. 4. The clock frequency should be high for faster operation. Faster operation means more power i.e. processing speed. A higher processing will ensure faster execution of program thus the controller can control the whole system more faster. 5. It should consume a small amount of power.3.2.6 Selection of Power SourceThe power source of the system should be able to run the system for a long time andit should capable to deliver required power by the system. Thus a high Ampere Hourrating power source is required.3.3 Software designAs per general approach of design, wherever possible use commercially availabletools and products. While design software sections this approach has vitalimportance. The language selection for design must suit for managing all type ofstandard input output system and it should have flexibility to required workingplatform. Low level programming language like C or Pascal should be use for 33
  43. 43. programming microcontrollers and its interfaces. Using high level language likeMicrosoft C++, Java, Microsoft C# etc can be used for programming differentalgorithm and control strategy. In the following sections, there are some discussionabout some common programming language and its available libraries.3.3.1Video Capturing Software RequirementThe video capturing software requirements are as follows  The software must be able to read trigger signal from microcontroller through serial port to start video capturing.  The software must capture and save video footage from webcam after getting a trigger signal.  The software must store the video footage with the specific capturing date and time.  The software must allow user to select various capture duration.  The software must have an interactive and user friendly Graphical User Interface (GUI) to interact with non-technical users.The first requirement deals with serial port communication with the microcontrollerand PC. This communication is based on string transmitting and receiving frommicrocontroller to start the capturing right away.The second requirements deals with capturing from connected external webcam.The third requirement deals with storing video footage with capturing date and time.Here the software will read time and date from operating system and will place it asthe file name of the captured footage.The fourth requirement deals with building a simple and user friendly GUI whichcan allow user to control the surveillance system, select capture duration. 34
  44. 44. 3.4 Component selection and FeaturesBased on the criterion that is previously described, selected component is describedin this section. Selection of component is not based on the best components, rather itis related to cost, availability and meeting the requirements by the system.3.4.1 Hardware Component Selection3.4.1.1 PIR SensorFor movement detection passive infrared sensor (PIR) is selected. Any object thatgenerates heat also generates infrared radiation. Object including human body andanimals has strongest infrared radiation at wavelength of 9.4μm [25]. Infraredradiation cannot be seen since its wavelength is longer than visible light. But it canbe detected by Passive Infrared sensor. The PIR sensor converts incident IR flux intoan electrical output. It is done through two steps: there is an absorbing layer insidethe PIR sensor that transforms the radiation flux change into a change in temperatureand the pyroelectric element inside the PIR sensor performs a thermal to electricalconversion [26]. Thus when an object movement occurs in the Field of View (FoV)of the sensor it generates an output electrical signal in the response of thatmovement. This output electrical signal then processed by amplifier and comparatorand, used in different circuit for movement detection. In figure 3.2 general systemarchitecture of PIR sensor is shown. Figure3.2: General system architecture of PIR sensor [27]The PIR sensor that is selected for this system is Parallax-PIR sensor. This sensorhas the following features:  Detection range up to 20 ft 35
  45. 45.  Single bit output  Small size makes it easy to conceal  Compatible with all Parallax microcontrollers  Low current draw, less than 100 uA  Power requirements: 3.3 to 5 VDC  Operating temp range: +32 to +158 °F (0 to +70 °C)In figure 3.3 the selected Parallax-PIR sensor is shown Figure 3.3: Parallax-PIR sensor [28]There are two mode of operation of this sensor. These modes are retrigger andnormal. These two modes of operation are selected by jumper pin H and L. In figure3.4 jumper pins position is shown. Figure 3.4: Jumper Pin (H and L) Position [29]The mode of operation for the two setting is given in table 3.1 36
  46. 46. Table 3.1: Mode of operation of PIR sensor [29] Position Mode Description Output remains HIGH when H Retrigger sensor is retriggered repeatedly. Output is LOW when idle (not triggered). Output goes HIGH then LOW L Normal when triggered. Continuous motion results in repeated HIGH/LOW pulses. Output is LOW when idle.The output waveform for the two mode of operation is shown in figure 3.5 and 3.6 Figure 3.5: Waveform of PIR sensor output for Retrigger mode of operation Figure3.6: Waveform of PIR sensor output for normal mode of operation 37
  47. 47. PIR sensor output remains high minimum two second for single movementdetection. “The PIR Sensor requires a „warm-up‟ time in order to function properly.This is due to the settling time involved in „learning‟ its environment. This could beanywhere from 10-60 seconds. During this time there should be as little motion aspossible in the sensors field of view [29]”. Science the PIR sensor draw less than100uA current, a 24Ah battery can operate it for 240000 hours.3.4.1.2 Mbed Rapid Prototyping BoardFor controlling the whole system mbed NXP LPC1768 prototyping board is used.This board is based on LPC1768 ARM Cortex-M3 based microcontroller. Thisboard has the following features:  Convenient form-factor: 40-pin DIP, 0.1-inch pitch.  Drag-and-drop programming, with the board represented as a USB drive.  ARM Cortex-M3 hardware 100 MHz with 64 KB of SRAM, 512 KB of Flash  Ethernet, USB OTG (USB On-The-GO).  SPI (Serial Peripheral Interface Bus), I2C (Inter-Integrated Circuit), UART (Universal Asynchronous Receiver/Transmitter).  PWM (Pulse Width Modulation), ADC (Analog-to-Digital Converter), DAC (Digital-to-Analog Converter.)  Web-based C/C++ programming environmentThere are 26 digital input/output pin (pin5-pin30) to take digital input or send digitaloutput. When these pin are set as digital input pin, any voltage that is above 2.0V islogic 1 and below 0.8V is logic 0. When these pin are set as digital output pin, forlogic 0 the output pin is at 0V and for logic 1 output voltage is 3.3V. These pin cansource or sink a maximum current of 40mA. Thus in the system these pin can beused as input pin from the PIR sensor [30].There are six PWM output pin (pin21-pin26) in this prototype board. All PWMoutput shares the same period but can be set to give different pulsewidth. Thuschanging the period of one will change the period of other output [31]. There are 38
  48. 48. built in function for PWM signal generation by which period and pulsewidth can beset precisely in seconds, millisecond or microseconds. Thus in this videosurveillance system the servomotor that is used can be control precisely by thismicrocontroller prototyping board.This microcontroller can establish serial RS-232 communication with PC. Pinsp9/p10, p13/p14, p28/p27 and USBTX/USBRX can be used for serial RS-232communication. One of the serial connections goes through via USB port. Thus itallows easy communication with host PC. And this USB port is used as virtual RS-232 serial port. Baud rate for serial communication is from a few hundred bits perseconds, to megabits per second. This allows high speed data transfer betweenmicrocontroller and host PC. The data length is 7 or 8 bits long. This virtual RS-232serial port feature enables the microcontroller to be used with any computerespecially latest PC which does not have any RS-232 serial port. Thus by using thismicrocontroller in the video surveillance system will make the system connectableto any old or latest PC.The microcontroller can be powered by USB or 4.5v - 9.0v applied to VIN pin. Andit takes less than 200mA (100mA with Ethernet disabled) current. Thus it is possibleto operate it 120 hours with a 24Ah rated battery.There are many built-in functions that enable to use the microcontroller easily in anyapplication.In figure 3.7 mbed NXP LPC1768 prototyping board is shown Figure 3.7: mbed Microcontroller [32] 39
  49. 49. 3.4.1.3 Servo MotorA Servo is a small device that has an output shaft. This shaft can be positioned tospecific angular positions by sending the servo a coded signal. As long as the codedsignal exists on the input line, the servo will maintain the angular position of theshaft. As the coded signal changes, the angular position of the shaft changes. Servois extremely useful in robotics. The motor is small, has built in control circuitry, andare extremely powerful for its size. A standard servo such as the HITEC-HS-475HBhas torque 0.54 N.m @ 6.0V, which is pretty strong for its size. There are 3 wiresthat connect to the outside world. The red wire is for power (+5volts), the black wireis ground, and the yellow wire is the control wire. In figure 3.8 a servo motor isshown Figure3.8: Servo motor [33]The servo motor has some control circuits and a potentiometer that is connected tothe output shaft. This potentiometer allows the control circuitry to monitor thecurrent angle of the servo motor. If the shaft is at the correct angle, then the motorshuts off. If the circuit finds that the angle is not correct, it will turn the motortowards the correct direction until the angle is correct. The output shaft of the servois capable of travelling 0 to 180 degrees; also there are servos that are capable oftravelling 0 to 210 degrees. A normal servo is used to control an angular motion ofbetween 0 and 180 degrees. A normal servo is mechanically not capable of turningany farther due to a mechanical stop built on to the main output gear. 40
  50. 50. Figure3.9: Internal circuit of a servo motor [34]The control wire is used to communicate the angle. The angle is determined by theduration of a pulse that is applied to the control wire. This is called Pulse CodedModulation. The servo expects to see a pulse every 20 milliseconds. The length ofthe pulse will determine how far the motor turns. A 1.5 millisecond pulse, forexample, will make the motor turn to the 90 degree position (often called the neutralposition). If the pulse is shorter than 1.5 ms, then the motor will turn the shaft tocloser to 0 degree. If the pulse is longer than 1.5ms, the shaft turns closer to 180degree.Figure3.10: Some random pulse and its corresponding rotation of a servo shaftAccording to the requirement analysis HITEC-HS-475HB servo motor is used in theproject. The technical specification of the servo is given below. 41
  51. 51. Technical specification:  Operating Voltage: 4.8V/6.0V  Speed @ 4.8V: 0.23 sec/60°  Speed @ 6.0V: 0.18 sec/60°  Torque @ 4.8V: 0.43 N.m  Torque @ 6.0V: 0.54 N.m  Motor Type: 3 Pole  Bearing Type: Top Ball Bearing  Weight: 1.41oz (40.0g)  Dimensions: 38.8 x 19.8 x 36mmAccording to the requirement analysis the system should be able to record videofootage from any direction. The HITEC-HS-475HB servo motor shaft can cover anyangle 0 degree to 180 degree. This is primarily enough for the project whichincludes three PIR sensors. But to cover 0 degree to 360 degree two similar servomotors can be used.From the aspect of positioning the servo shaft in a specific angle a particular pulsewidth modulated signal is enough to given through control wire.From the aspect ofmounting the camera the HITEC-HS-475HB servo motor is perfect. The motor shaftis well made and very comfortable to mount the camera. The torque of the HITEC-HS-475HB servo motor is 76.37 oz-in (5.5kg/cm) @ 6.0V which is more thanenough to rotate the camera. The HITEC-HS-475HB servo motor usually consumes200mA current during rotation with ideal load which is much less and cost effective.Current consumption may increase with load.3.4.1.4 FitPC2For video capturing and transmission fitPC2 running on Windows 7 is selected. Thespecification of fitPC2 is as below:  Intel Atom Z530 1.6GHz  Memory 1GB DDR2-533MHz  Internal bay for 2.5″ SATA HDD 160 GB 42
  52. 52.  Intel GMA500 graphics acceleration  Wireless LAN - 802.11g WLAN  6 USB 2.0 High Speed ports  Windows 7 Professional  Case - 100% aluminium Die cast body  Dimensions-101 x 115 x 27 mm 4″ x 4.5″ x 1.05″  Weight - 370 grams / 13 ounces – including hard disk  Operating Temperature - 0 – 45 deg C with hard disk 0 – 70 deg C with SSD  Power- 12V single supply 8-15V tolerant  Power Consumption- 6W at low CPU load <7W at 1080p H.264 playback 8W at full CPU load 0.5W at standbyThe smaller size, less weight and low power consumption features of the fitPC2 willmake the video surveillance smaller in size, lesser in weight and operate for longhours. Moreover USB2.0 connection can be used to communicate with themicrocontroller via virtual serial port to receive triggering signal. The built inWLAN 802.11g card will allow the video surveillance system to transmit recordedvideo footage through wireless network. And the wide temperature range will allowthe PC in different environmental condition. There is no cooling fan inside it, thus itwill work quite noiseless in any place. In figure 3.11 fitPC2 is shown. Figure 3.11: fitPC2 [35] 43
  53. 53. 3.4.1.5 Logitech Webcam C120Logitech webcam C120 is selected for video recording. This web cam has thefollowing specifications:  Video capture: up to 800 x 600 pixels  Up to 30 frames per second video  Hi-Speed USB 2.0 communication  Resolution up to 1.3 megapixel  Weight 100 gm800 x 600 pixels and 30 frames per second will give a high quality video footage forthe video surveillance system. And the webcam can transfer data faster using USB2.0 port. And the light weight of the camera will makes it easy to mount with theservo motor. The minimum system requirement of a PC to connect this webcam is1GHz CPU and 256 MB of RAM with Windows XP operating system thus thiswebcam performance will be better with fitPC2. In figure 3.12 the selected LogitechC120 webcam is shown. Figure3.12: Logitech C120 webcam [36]3.4.1.6 Power SupplyFor power supply a 12v, 24Ah battery is chosen. The fitPC2 will be powereddirectly from 12v supply. A power supply circuit will be used to reduce the voltagelevel to power up the microcontroller, PIR sensor and Servomotor. 44
  54. 54. 3.4.2 Software SelectionMicrosoft .Net framework has a collection of huge number of libraries for securecommunication and solution for all common programming problems. The featuresinclude multi language interoperability, virtual machine and common languageruntime (CLR).The common language runtime (CLR) is a major component of .Net Framework.User no needs to care about the execution time for the specific system. The CLR willdeal with all CPU dependent operations while execution a program. The programwritten in any language converts in to byte code called as Common IntermediateLanguage (CIL). And the runtime it again transfers to the specific system platform.Figure 2.4 shows the operations of CLR. So CLR helping the programmers to writeprogram in less effort without considering the memory management, security,Garbage collection, Exception handling and thread management. Figure 3.13: Operation of CLR in .Net FrameworkIt also allows the developers to apply common skills across a variety of devices,application types, and programming tasks. It can integrate with other tools andtechnologies to build the right solution with less work.3.4.2.1 .Net Framework 4:The .NET Framework is Microsofts comprehensive and consistent programmingmodel for building applications that have visually stunning user experiences,seamless and secure communication, and the ability to model a range of businessprocesses.The .NET Framework 4 works side by side with older Framework versions.Applications that are based on earlier versions of the Framework will continue to runon the version targeted by default. 45
  55. 55. System Hardware Requirements:Recommended Minimum: Pentium 1 GHz or higher with 512 MB RAM or moreMinimum disk space:x86 – 850 MBx64 – 2 GB3.4.2.2 Microsoft C#Microsoft c# is an object oriented programming language designed for windowsgraphical programming. The object orientation is the structured method for solvingproblems. And the mental models can easily transfer in to programs using objectoriented programming. Another attractive benefit of the object oriented language isits ease of code reusability and maintenance. Among this all benefits object orientedlanguages are the time consuming and large sized. In object oriented language itdefines an object with its own properties and classes with a set of objects withcommon behaviour.3.4.2.3 Direct Show APIMicrosoft DirectShow is architecture for streaming media on the MicrosoftWindows platform. DirectShow provides for high-quality capture and playback ofmultimedia streams. It supports a wide variety of formats, including AdvancedSystems Format (ASF), Motion Picture Experts Group (MPEG), Audio-VideoInterleaved (AVI), MPEG Audio Layer-3 (MP3), and WAV sound files. It supportscapture from digital and analogue devices based on the Windows Driver Model(WDM) or Video for Windows. It automatically detects and uses video and audioacceleration hardware when available, but also supports systems withoutacceleration hardware.DirectShow is based on the Component Object Model (COM). DirectShow isdesigned for C++. Microsoft does not provide a managed API for DirectShow.DirectShow simplifies media playback, format conversion, and capture tasks. At thesame time, it provides access to the underlying stream control architecture for 46
  56. 56. applications that require custom solutions. You can also create your ownDirectShow components to support new formats or custom effects.3.4.2.4 Video Capture DevicesMost new video capture devices use Windows Driver Model (WDM) drivers. In theWDM architecture, Microsoft supplies a set of hardware-independent drivers, calledclass drivers, and the hardware vendor provides hardware-specific minidrivers. Aminidriver implements any functions that are specific to the device; for mostfunctions, the minidriver calls the Microsoft class driver.In a DirectShow filter graph, any WDM capture device appears as the WDM VideoCapture filter. The WDM Video Capture filter configures itself based on thecharacteristics of the driver. It appears under a name provided by the driver you willnot see a filter called "WDM Video Capture Filter" anywhere in the graph.Some older capture devices still use Video for Windows (VFW) drivers. Althoughthese drivers are now obsolete, they are supported in DirectShow through the VFWCapture filter.3.5 Cost AnalysisAfter selecting the hardware software system budget is estimated in table 3.2. Thelist included only the selected component that will be needed to complete theproject. Other component like resistors, capacitors and op-amps should notdrastically raise our budget, and also these components are available in thelaboratory. Table 3.2: Price list of components. Component List Price (£) mbed microcontroller 45 Camera 8 PIR Sensor 21 Servo Motor 7 fitPC2 270The total budget of the project will not exceed 500 pound 47

×