Introduction: Intelligent Surveillance System Using – DIY Robot Prince

About: We are Robotics based startup from Chennai - India.

POWER ON THE ROBOT AND LOGIN.

We have designed a robot named prince.This robot can perform real world tasks like surveillance. We as a team have explained How prince could be used for surveillance?.

To start with we have to boot the system, the terminal opens as shown. You have to typepi as username and raspberry as password. If we want to be a super user in the Linux operating system, we have to open the terminal and then type.

sudo su

and then press enter.

We do not know whether all the applications we use in the operating system, are of the current caliber or outdated. To get the current updates, we have to type the following commands. It is important to know that the applications we use are of current trends.

FOR UPDATES AND UPGRADING:

If you want to update the operating system type the command in the terminal

$ sudo apt-get update

If you want to upgrade the operating system type the command in the command in the terminal.

$ sudo apt-get upgrade

And press enter.

After this process, the operating system will be upgraded.

In Prince, there is a camera module called raspberry-pi camera. In order to use this camera for surveillance we have to enable it.

Step 1: Enabling Camera and Selecting the Localisation Option.

HOW TO ENABLE THE CAMERA?
In order to enable the camera, we type the command in the terminal as,

raspi-config.

and click enter.

SELECTING THE LOCALISATION OPTION.

Then we select the localization option the fourth option in the screen. This is shown above.

Step 2: Selecting the Enable Camera Option.

When we select this localisation option, a new screen appears like this which is shown above.

Step 3: Selecting YES to Enable Camera

After this a screen appears asking to enable the camera interface. Click the yes option to enable, and No to disable. The camera module option will be enabled. This is shown in the above figure.

Step 4: Click Finish to Complete Enabling Camera

A screen for raspberry- pi again appears in the screen shown as raspi configuration tool again .We finally click finish option that is shown in the right hand corner of the window. Another window appears asking us to reboot. Click yes and reboot the system.

Once prince robot is rebooted, you can open the terminal and type

sudo su

and then press enter. If we want prince to take picture of the movements during surveillance, we have type the following commands.

Step 5: Capture the Image and Installation of Gpic View

CAPTURE THE IMAGES

This command is given in the terminal for the Prince to capture the images.

raspistill -o image.jpeg

INSTALLATION OF GPIC VIEW FILE:

If we want to view the photos that had been captured to be displayed, we need an application called gpicview.

For installation of gpic file we type the following command.

$ sudo apt-get install gpicview

Step 6: View the Captured Images in the System.

VIEW THE CAPTURED IMAGES IN THE SYSTEM

This command is given in the terminal, for the Prince to view the captured images.

gpicview image.jpeg.

The image captured is shown above when we type this command.

For the function of surveillance, we use a sensor module. It is a PIR sensor. This sensor detects the human movements. If sensor does not sense the human movements then it is said to be dummy.

So far, we have seen how to test the camera, enable it, take photos and view captured images in the system. If the user is in remote places, Prince can send the captured images to your personal mail-id. This is possible through the following steps

FOR THIS WE NEED PHP MAILER PACKAGE.

Now we will download PHP mailer package from github website. To download a package from github publication we need git. Type the following command in the terminal for installation of git.

$ sudo apt-get install git

Once this installation is completed, type the following command in the terminal.

git clone http://github.com/PHPMailer/PHPMailer.git

The PHP mailer package will be downloaded in our system. After this, we get into the PHP mailer folder. Type the following command in the terminal

cd PHPMailer

After getting into this folder, we have to get into the examples folder. For this type the command in the terminal

cd examples

To get into the gmail.phps we require a word editor. But inbuilt word editor in Linux is not user friendly to work. So we use Leafpad program as the word editor. To install the leaf pad application type the following in the terminal.

sudo apt-get install leafpad

and press enter. The leafpad program gets installed into the system.

To receive content from prince, to our personal mail id, we require gmail.phps file. To open gmail.phps we have to type the following command.

leafpad gmail.phps

Step 7: Entering the Sender and Receiver Mail Id

ENTER SENDER MAIL ID;

In this document, go to line number 43. You will see a command

$ mail->Username="sender mail id"

In this command,enter the sender mail id you want to create and use to send the captured image to the receiver mail id.

ENTER PASSWORD FOR SENDER MAIL ID;

In line number 46 we enter password of your requirement for the sender mail id.

$ mail->Password="*******"

RE ENTER SENDER MAIL ID AND ENTER SENDER NAME;

In line number 49 re enter the sender mail id and sender name.

$ mail->set from('sender mail id, sender name.);

ENTER RECEIVER MAIL ID AND RECEIVER NAME;

In line number 55, enter receiver mail id.

$ mail-> addAddress('receiver mail id, receiver name');

After entering these details in the command type ctrl+s and save the file.

Step 8: Authentication Failure

After editing this file you should run this file. This is a php file. Therefore, we must install php package.

INSTALLATION OF PHP PACKAGE:

To install php package, we must type the following command.

sudo apt-get install php5

Now the php package will be installed. Now we will run the gmail.phps file by typing

php gmail.phps

AUTHENTICATION FAILURE

After this we run the program. An error is shown as authentication failure. In the sender mail id , click the notification given showing authentication error. Then click Allow, as shown in the above figure, the gmail would allow to send the authentication to the receiver mail id.

Step 9: Allowing the Less Secure Apps.

Click the allowing access to less secure apps. Then a screen appears. Now click On the less secure apps.

Step 10: Notification of Access of Less Secure App Turned On.

A notification is sent to the sender mail id stating that the less secure apps are turned on as shown in the above figure.

Step 11: Message Sent Notification Shown in the Terminal.

After this, type php gmail.phps in the terminal. There will be no error and you will see a message sent text in the terminal. This is shown in the above figure at the bottom left of the terminal.

Step 12: Test Mail Sent to the Receiver Mail Id.

When you check the receiver mail id, you would have received a test mail. The test mail sent to the receiver mail id looks like the screen shown above.

Step 13: Attaching Image Captured by Prince.

In the line number 68, within the brackets attach your image location. We have attached an example of our image location. This is a modified file of gmail.phps. This is shown in the above figure.

ATTACHING THE IMAGE LOCATION:

In line number 68 type the command,

$ mail->addAttachment ('/home/pi/testprogram/PHPMailer/examples/image.jpeg');

In this command

('/home/pi/testprogram/PHPMailer/examples/image.jpeg');

This shows the image attachment location which must be entered in this command.

Then type ctrl +s and save then close the file.

After this come back to the terminal, type

php gmail.phps

Then click enter.

If you check the receiver mail id, the picture caught by prince is sent as an attachment to the receiver mail id.

Step 14: Merging Sensor and PHP Mailer.

HOW TO MERGE PIR SENSOR AND PHP MAILER?

Create a new python file by typing

leafpad sensor.py

Save and exit the file.

Compile and run the python file by typing

python sensor.py

If an intruder enters a house then prince captures his movements through sensor and sends it to the receiver mail id. Before we saw how we have to enable the php mailer for prince to send images of movements during surveillance.

Step 15: Image Sent As Attachment to Receiver Mail Id.

Here we just see, how sensors work and send these image as attachments to the receiver mail id. This is shown in the pictures above. This is a mail sent to the receiver mail id with that attachment of the image that was captured by prince during surveillance.

For more details contact us through

support@eprlabs.com

www.princerobot.com

Step 16: