Friday 11 December 2015

Abstract

The main aim of the project is to protect the boundaries and Army monitoring the boundary at extreme condition and secure it from the Unauthorized Intruder . This is a Defence oriented project which monitor the "Area under Surveillance" continuously at extreme condition like very low temperature (-530c) high attitude pressure, unique color, low power supply, long range distance coverage and self activated automatic weaponry which ensure the safety.
            The device consist a Camera as a sensor for the purpose of monitoring the Area under surveillance and sending image as input to the Pc which is running using MATLAB coding, send the particular  quadrant value to the Micro-controller which will actuate and control the Stepper motor.
            If our army wants to occupy the "Area under Surveillance" then a transmitter is given to deactivate the "unmanned gun control mechanism". The receiver antenna receive and decode the transmitted data and compares the receive data.
            If an intruder come with other attire the LDR based boundary control Mechanism is use to control the boundary under surveillance. The device consists of LDR which is turn to sense the LESER light if intruder pass the light then Micro-controller is Automatically actuated and control the stepper motor.

            The micro computing unit is used in the Project and Programmed after successful simulation of the Hardware. The firmware used in the project continuously monitor and automatically defenses the "Area under Surveillance". This project make device better and simpler but cheaper as well.

Contact Me

Stylo_ashish

Conclusion

This project is designed to safe ground the boundaries at extreme conditions (Siachien). Where human intervention is very difficult and save the precious  live of our soldiers. It is used to reduce the power consumption of the micro-controller using OS concepts. The direction of the LASER is accurately pointed by alleging the camera with respect to the stepper motor. The power consumption of LASER is reduced by using relays.

This Project is completely sound, and has a great market value. Concerned with the threats to the nation at the border with enemies in blasting the base camps, weapons, machinery and lot of warfare materials of high cost. This modern is built in such a way that it is going to acquire the data by a high resolution camera and process, and then makes a suit at the enemy. Hence we can say that this product is best suitable for boarder security and even in some secure areas where national integrity and safety is major issue.

Future Scope

The project “UNMANNED GUN CONTROL” is used to safe grounding the boundaries in any weather harsh weather condition. During the battle in harsh condition the area where army person can’t afford the situation due to low temperature and high altitude snow in that condition automatic weapon are may be used to protect the area. Which are work when enemy person come inside the boundary it detect and shoot the target.


            Going a step forward it is also required it is also required to safeguard the people who are guarding our boundaries and we need to take to take care of the issues that re faced by them. During the last Kargil war it was observed that the Pakistani military had occupied the India's vacated positions during winters in violation of the Simla Agreement. Every winter the military forces of both the countries (INDIA and PAKISTAN) vacate their positions in the Siachen and then re-occupy it when the snow melts as it becomes very difficult to survive in the cold.


Conclusion



This project is designed to safe ground the boundaries at extreme conditions (Siachien). Where human intervention is very difficult and save the precious  live of our soldiers. It is used to reduce the power consumption of the micro-controller using OS concepts. The direction of the LASER is accurately pointed by alleging the camera with respect to the stepper motor. The power consumption of LASER is reduced by using relays.


This Project is completely sound, and has a great market value. Concerned with the threats to the nation at the border with enemies in blasting the base camps, weapons, machinery and lot of warfare materials of high cost. This modern is built in such a way that it is going to acquire the data by a high resolution camera and process, and then makes a suit at the enemy. Hence we can say that this product is best suitable for boarder security and even in some secure areas where national integrity and safety is major issue.


Implementation and Result

Unmanned Gun Control Mechanism can be implemented using existing purpose Camera (web Cam) under the "Area of surveillance" to detect the Intruders. This project is focused on shape detection to observe the real object image. This paper starts by describing the method of converting RGB image to binary signal using MATLAB.
            To accomplish this we propose a mechanism which will employ image processing in which webcam will be continuously observing the area under surveillance. This data will be then processed by a MATLAB code which will be running on a PC and will be able to detect a particular color in front of a white background.
            Depending on this process data the information about the intruder location will be sent to a microcontroller (89c51) via the serial / parallel port of the PC and then motor control gun will be used to point in the direction of the intruder. With this mechanism will be online that is the gun will be continuously be pointing in the direction of the intruder. Further depending on range (distance from the gun) (fixed range in this project) the gun can be activated and a laser pointer will be switched ON to depict shooting the targets.


5.1 MATLAB GUI Call back Program Screen shot

Figure 5 (a): MATLAB GUI Programming window

Above screen shot of the MATLAB call back program shows the initialization of webcam for capturing the image in any weather condition. In this, MATLAB code use for provide the specification of image about their resolution, length, width etc.

5.2 MATLAB Program GUI Screen shot

Figure 5 (b): MATLAB GUI Program Execution window.

Above MATLAB program screen shot shows the execution of the code. In which the webcam are continuously capturing the video at 5ms intervals of time. In screen shot the figure shows when the webcam detecting red color the gun pointer shoot the target. MATLAB calculate the numerical accuracy of the image.

5.3 Photograph of Project





6. ADVANTAGES AND DISADVANTAGES

6.1 Advantages
  •  It is used at extreme conditions.
  •  Cost effective.
  • High performance language is used.
  • Safe and secured.


6.2 Disadvantages
  • Difficulty in mounting.
  • Special night vision cameras required in dark and bad light conditions.


6.3 Future development
  •  Future work will concentrate on improving the accuracy of pointing the gun towards the intruder.
  • The new MATLAB coding should be developed for the night vision cameras.
  • To detect the intruder in complex background.
  • Implementing the same code for the detection of intruder to the home  locations.
  • Improve the speed of the coding so that can be Implemented in fast moving vehicles like helicopters.


Software Requirements

We require two software's for the implementation of the project.
1. MATLAB : For implementing vehicle License Plate tracking and reorganization.
2. KEIL : For implementing the decision making using microcontroller 8051.

4.1 MATLAB
            MATLAB is an abbreviation of Matrix Laboratory. It is a popular Mathematical Programming Environment used extensively in Education as well as in industry. The trick behind MATLAB is that everything is represented in the form of arrays or matrices mathematical operations starting from simple algebra to complex calculus may be conveniently carried out using the environment. The main use of MATLAB can be converted into C, C++, or Visual C++.
            Although MATLAB is intended primarily for numerical computing, an operational toolbox uses the MuPAD symbolic engine, allowing access to symbolic computing capabilities.
            We can use MATLAB in a wide range of Application, including signal and image processing, communications, control design, test and measurement, financial modeling and analysis, and computational biology. For a million engineers and scientists in industry and academia, MATLAB is the language of technical computing.

4.1.1 Image Processing
            Image processing generally involves extraction of useful information from an image. This useful information may be the dimension of an engineering component, size of diagnosed tumor, or even a 3D view of an unborn baby. The main areas of application of image processing are Bio-Medical, Engineering, Quality control, Face detection, Traffic control etc.

4.1.2 MATLAB Language
            MATLAB provides a high-level language and development tools that let us quickly develop and analyze our algorithms and applications. The MATLAB language supports the vector and matrix operations that are the fundamental to engineering and scientific problems.
            In many cases, MATLAB eliminates the need for 'for' loops. As a result, one line of MATLAB code can often replace several lines of C or C++ code. At the same time, MATLAB provides all the features of a traditional programming, including arithmetic operators, flow control, data structure, data types, object oriented programming (OOP), and debugging features.
            For general purpose scalar computations, MATLAB generates machine-code instructions using its JIT (Just-In-Time) compilation technology. This technology, which is available on most platform, provides execution speeds that rival those of traditional programming languages.

4.1.4 Designing Graphical User Interfaces

            We can use the interactive tool GUIDE (Graphical User Interface Development Environment) to layout, design, and edit user interfaces. GUIDE lets us include list boxes, pull-down menus, push buttons, radio buttons, and sliders, as well as MATLAB plots and Microsoft Active X controls. we can create GUIs programmatically using MATLAB functions. 


4.1.5 MATLAB programming technique for image processing
4.1.1.1 Recording of the processing used
When it is used to process images one generally writes function files, or script files to perform the operation, these files form a formal record of the processing used and ensures  that the final results can be tested and replicated by others should the need arises.

4.1.1.2 Access to implementation details
MATLAB provides many function for image processing and other tasks most of these functions are written in the MATLAB language and are publically readable as plain text files, thus the implementation details of these functions are accessible and open to scrutiny.

4.1.1.3 Numerical accuracy
Another advantage of MATLAB is that it allows one to ensure maximal numerical precision in the final result.

4.1.1.4 Advanced algorithms
MATLAB is a scientific programming language and provides strong mathematical and numerical support for the implementation of advanced algorithms, it is for this reason that MATLAB is widely used by the image processing and computer vision community. new algorithm are very likely to be implemented first in MATLAB, indeed they may only be available in MATLAB.

Key Features
  • High level language for technical computing.
  • Development environment for managing code, files, and data.
  • Interactive tools for iterative exploration, design, and problem solving.
  • 2D and 3D graphics functions for visualizing data.
  • Functions for integrating MATLAB based algorithm with external applications and languages, such as C, C++, Fortran, Java, COM, and Microsoft Excel.  

4.1.6 Flow chart: MATLAB GUI



4.1.7 Explanation of flowchart: MATLAB GUI
  • Start the MATLAB GUI.
  • First find the password for protection purpose.
  • If the password entered is valid then it displays your valid person else displays you are not a valid person. so the access is denied.
  • Detection toggle button on the GUI is clicked to start the detection.
  • Displaying the toggle button to stop after the start button is pressed and in future these same button is pressed to stop the detection.
  • Video from the camera is inputted into MATLAB using image acquisition tool in MATLAB and dividing the same input image into 16 quadrants.
  • Serial port is initialized to COM port1 to communicate with the microcontroller.
  • The input video is previewed on the GUI.
  • While the toggle button in stop detection position the following action happens.
  • The input image color components are stored in different arrays.
  • The conditioning equation is used to obtain particular color i.e. segmentation
  • is done and converted it into binary image.
  • The noise in the image is removed by means of the same mathematical image processing technique.
  • Then the mean value are calculated and compared with the co-ordinates values these
  • values are sent to the microcontroller through the serial port.
  • Stop the detection. toggle button is pressed to stop the detection.
  • End of the MATLAB GUI program.

4.2 Keil µVision 3 Software

            The use of C language to perform microcontroller is becoming too common. And most of the time it is not easy to build an application in assembly which instead we can make easily in C. So it is important that we know C language for Microcontroller which is commonly known as Embedded C.
            As we use Keil C51 compiler, hence we also call it Keil C. The Keil development tool offers numerous features and advantage that help us to develop embedded applications quickly and successfully. They are easy to use and are guaranteed to help us achieve our goals in timely manner.

4.2.1 8051 Development Tool Support

            The Keil C51 Compiler and the Keil Linker/Locator provide optimum 8051 architecture support with the following features and C language extensions :
  • Interrupt functions with register bank support are written directly in C.
  • Bit and bit-addressable variables for optimal Boolean Data type support.
  • Compiler time stack with data overlaying uses direct memory access and gives high-speed code with little overhead compared to assembly programming.
  • Re-entrant functions for usage by multiple interrupt or task threats.
  • Absolute Variable locating enables peripheral access and memory sharing.
  • Code and variable banking expend the physical memory address space.

4.2.2 Embedded system and C programming
  • An embedded system is an application that contain at least one programmable computer (typical in the form of a microcontroller and microprocessor of digital signal processor chip).
  • It is easier and less time consuming to write in C than assembly.
  • C is easier to modify and update.
  • We can use code available in function libraries.
  • C code is portable to other Microcontroller with little  or no modification.
  • It is very efficient.
  • It is popular and well used.
  • Even desktop developers who have used only Java and C++ can soon understand C syntax.
  • Good, well-proven computers are available for every Embedded processor (8-bit to 32 bit or more)
  • Experience staff are available.
  • Book, training courses, code sample and internet sites discussing the use of the language are very widely available.

4.2.3 Flow chart: Embedded C Program

Figure 4.1.3 : Flow chart of Embedded C Program

Figure 4.1.3 shows the flow chart of embedded C program and it is described by following steps which are listed below:-
  • Start the coding.
  • Declaration of all the variable and ports used in coding.
  • Initialization of the COM port for the serial communication and stepper motor to initial position.
  • Bring the stepper motor to the middle position so that it can move in any corner of the screen with the same display period.
  • While super loop is been used to run the code continuously until the power supply is turned off.
  • Before checking the switches the particular quadrant value and update the current step value of stepper motor.
  • Checking the current value with the new value before incrementing the count value of the stepper motor.
  • Updating the current value of the stepper motor after the increment.
  • Checking for the wireless disable bit before switching on the LASER pointer.
  • End of the code.


4.2.4 Embedded OS Programming
  • To obtain periodic function execution and avoid wasting processor cycle we can use interrupts.               

4.2.4.1 Tasks, Functions and scheduling
  •   In case of EOS, we are able to control the execution times of a single task.
  • The task will be implemented as an interrupt service routine: This ISR will be invoked by the overflow of a timer.

4.2.4.2 Saving Power
  •  Problem noted with many ‘super loop’ applications are that the processor wasted a large no of CPU cycle in a delay loop.
  •  8051 devices have an idle mode where power consumption may be reduced by a factor 10.
  •  Using EOS, we can reduce the power consumption of the application by having the processor enter idle mode when it finishes executing the ISR.

4.2.4.3 Portability
  • ON-chip timer which can be used to generate interrupts in this way is by no means restricted to the 8051 family.
     4.2.5 Flow chart: Embedded OS Program

Figure 4.1.4 : Flow chart of Embedded OS Program



   Figure 4.1.4 shows Explanation of Embedded OS program which is described by following steps:-
  • Start the simple embedded OS code.
  • Declaration of all the variables and ports used in coding.
  • Initialization of the COM port for the serial communication and stepper motor to initial position.
  • Initialize stepper motor to the auto reload register.
  • Bring the stepper motor to the middle position so that if it can move in any corner of the screen same delay period.
  • While super loop is been used to run the code continuously until power is turned off.
  • Running the microcontroller in ideal come of power saving mode.
  • The code is internally connected to the timer2 interrupted function where previously code is made in to function and placed in this interrupt function.
  • This function waked up when the function is interrupted from the ant of the used ports.
  • End of the coding. 

4.2.6 Co-operation scheduler programming
  •   A co-operation scheduler provides single-tasking system architecture.

4.2.6.1 Operation
  • Tasks are scheduled to run at specific times (either on a one-shot or regular basic).
  •   When a task is scheduled to run it is added to the waiting list.
  •   When the CPU is free, the next waiting task (if any) is executed.
  • The task runs to completion and returns control to the scheduler.

4.2.6.2 Implementation
  • The scheduler is simple and can be implemented in a small amount of code.
  •  The scheduler must be allocated memory for only a single task at a time.
  •  The scheduler will generally be written entirely in a high-level language (such as ‘c’).
  •  The scheduler is not a separate application; it becomes part of the developer’s code.

4.2.6.3 Performance
  • Obtain rapid response to external events requires care at the design stage.

4.2.6.4 Reliability and safety
  • Co-operate scheduling is simple, predictable, reliable and safe


4.2.7 Flow chart: Co-operative Scheduler

Figure 4.1.5 :Flow chart of Co-operative Scheduler

Figure 4.1.5 shows the flow chart of Embedded scheduler program and can be explained by following step:-
  •  Start the scheduler code.
  • Initialize the timer2 to the auto reload register of the scheduler function.
  •  Declarations of all the variables and port used in coding.
  • Initialization of the COM port for serial communication and stepper motor to the initial position.
  • Initialize thetimer2 to auto reload register.
  • Bring the stepper motor to middle position so it can move any corner of the screen with same delay.
  • Scheduler adds function to the required function to run where ever required and when the function is interrupted.
  • While super loop is been used to run the code continuously until the power supply is turned off.
  •  End of the code.


4.3 Issues faced during the development of the hardware
  • Mounting of the stepper motor.
  • Connecting the stepper motor to the microcontroller.
  • Camera interfacing with the MATLAB.
  • Embedded coding and dumping the code in to the Microcontroller.
  • Simple embedded and scheduler programming and rigging the code.
  •  Color detection and finding the quadrant value.
  • Automatic adjustment of the stepper motor to initial position.
  • Adjusting the distance between the white background and camera in synchronous to gun pointer.
  •  Detecting the person coming in while attire on white background.
  • How to control the gun action when our army needs to occupy the same area under surveillance.

4.4 Methods used to resolve the issues
  • In this project stepper motor was placed on another stepper motor using a good gum.
  • In this project for driving inductive load like relay we used ULN2003 and relay is used
  • for the switching action of the stepper motor.
  • In this project an extensive search was made for finding the coding related to image acquisition from camera.
  •  In this project embedded coding related tutor was taken for the code dumping technique.
  • In this project image acquired from the camera was noisy, it was removed by software programming was done using advance topic like Mathematical Morphology.
  • In this project micro switch where used to set the stepper motor to the initial position.
  • In this project transmitter and receiver were used to disable the gun action.

4.5 System Functional Requirements
4.5.1 Definition
Statement of service the system should provide how the system should react to the particular
Situation.

4.5.2 Initialization
Once you have tasted the working of embedded coding and MATLAB coding, you’ll probable to put it to use by proper interfacing with the microcontroller and in turn with the stepper motor. Now the camera will capture the area under surveillance.

4.5.3 User Interface
The user interface should be designed in secured  way with a lot of specific instruction and must fulfill the ergonomic requirements the purpose achieved with the help of MATLAB GUI coding.

4.5.4 Identification
It is done using the particular secured password handled higher authority officers.

4.5.5 Response
The system should response to each input and should transmit without any error.


4.6 Non-functional requirements
4.6.1 Definition
Constrain on the services or function offered by the system such as timing constrains, constrains on the development process, standard etc.

4.6.2 Reliability
All the components and circuit elements are stable and can work under the temperature of -40c.The transmitter can operate up to the range of 250fts.

4.6.3 Performance
Threats are detected accurately and gun point towards the intruder and works accurately.

4.6.4 Robustness
The serial data is transmitted in nano seconds to the microcontroller and switching of the relays are very speed.

4.6.5 Maintainability
Skilled persons are required for the alignment of camera and gun so the system is secured.

Code to Enable The Camera

% clc
% clear all
% close all
i=1;

obj=videoinput('winvideo', 1,'YUY2_320x240');
set(obj, 'SelectedSourceName', 'input1','ReturnedColorSpace','rgb')
src_obj = getselectedsource(obj);
get(src_obj)
preview(obj);
% while i<5
pause(3)
 frame = getsnapshot(obj);
imwrite(frame,strcat('input',num2str(i),'.jpg'));
% imwrite(frame,'input1.jpg')
% figure,imshow(frame)
i=i+1;
% end
% image(frame);

delete(obj);