HOME JOURNALS CONTACT

Journal of Environmental Science and Technology

Year: 2017 | Volume: 10 | Issue: 2 | Page No.: 80-87
DOI: 10.3923/jest.2017.80.87
Development of a Microcontroller-based Portable Surveillance System with User Alert Notification
Kishoor N. Pentaiah and Pin Jern Ker

Abstract: Background: Most surveillance systems require continuous power supply, resulting in their utilizations are limited in area with constant power supply only. Battery powered portable surveillance systems are highly desirable especially at remote areas or industrial sites to eliminate the need to electrical wiring for each installation. Objective: This study presents the development of microcontroller-based portable surveillance system with intrusion alert notification. Methodology: The hardware and software designs is presented to develop the system by using a cost-effective Raspberry Pi microcontroller. Incorporating electronic components such as motion sensors, Wi-Fi adapter and modem has enabled the microcontroller to perform different control and monitoring functions. Moreover, communication through 3G broadband was realized and video streaming over internet was made available to the authorized users. The Raspberry Pi was configured as a mini web server which could be accessed through the internet. Results: The accessibility of the web server was made possible through port forwarding and dynamic domain name service. In addition the low-power surveillance system can be powered using a 5-V power bank and it does not require direct power supply due to the intelligent alert system which triggered the camera only when there was a detected intrusion. Conclusion: Compared to conventional camera system with DVR recorders, the work reported in this study provides features and compactness which can be more readily utilized in remote industrial sites monitoring, moving vehicle monitoring and control, and movable storages.

Fulltext PDF Fulltext HTML

How to cite this article
Kishoor N. Pentaiah and Pin Jern Ker, 2017. Development of a Microcontroller-based Portable Surveillance System with User Alert Notification. Journal of Environmental Science and Technology, 10: 80-87.

Keywords: Intrusion alert, web server, monitoring, portable, raspberry Pi and surveillance system

INTRODUCTION

Due to the advancement and drastic development in communications and computing technologies, different types of surveillance systems are readily available to the end-users. Surveillance systems are utilized in many places for public and private security, such as banks, supermarkets and environments which are hazardous or inaccessible for human beings (for example, in environments which with poisonous gases, or very low or high temperatures). Since computers and network are widespread, many new network-based applications are emerging in everyone’s daily lives.

Today many business and industrial owners have a surveillance monitoring system. Furthermore, the number of residential owners employing surveillance systems is also in an increasing trend. Traditionally, these systems have been built in an ad hoc fashion with direct wired connections from the cameras to a control center to monitor these cameras. Generally, this type of wired system is very costly and it limits the number of cameras within the system1,2. This is changing due to the use of local area network technology, WiFi, Bluetooth and ZigBee for the interconnections and the fact that the control system can be connected to the Internet. The connection of the surveillance system to the Internet enables owners to access information collected by the security and monitoring system from any place through Internet.

The development of Internet Protocol (IP) cameras has initiated the evolution towards surveillance system with internet connectivity3,4. These IP cameras are usually connected to the router through Wi-Fi while the internet connection is provided by the wired-internet service provider. However for remote industrial sites and for movable assets or premises such as vehicles, power utilities substations and telecommunication base stations, a portable surveillance is preferred in which wireless broadband can be utilized and the system does not require constant power supply from the power distribution grid. In this study, a portable surveillance camera with 3G video streaming and intrusion alert system was designed to ensure maximum power efficiency and high mobility of the system. This surveillance system with 3G connectivity eases the burden of the owner to install and subscribe to long-term wired internet connection. This is particularly important for remote sites and movable assets. In addition, the camera system will be triggered only when there is an intrusion detected, thus tremendously saving unnecessary power consumption.

To date, there is only one available literature which reports on the utilization of microcontroller-based system for monitoring system but it is with limited functions such as live streaming and email notification only5. In this study, the development of the microcontroller-based portable surveillance system is discussed. Using Raspberry Pi (RP) microcontroller, 3G communication, configuration of RP as a web server, web page creation, video streaming at web page, setting up of Dynamic Domain Name Service (DDNS), short messaging service (SMS) and email alert notifications are incorporated into the portable surveillance system. This system can be readily used for different types of monitoring system by slight modifications to the sensors or other input signals. Therefore, the main objective of this project would be to develop an internet protocol-based miniature camera system with intrusion alert notification that is cost effective and with low power consumption.

EXPERIMENTAL

Raspberry Pi model B+ was selected as the microcontroller which coordinated all the functions for the portable surveillance system. To ensure efficient power management, the surveillance system was designed such that the camera module (Raspberry Pi Camera Board) would function only when there was an intrusion detected. Hence, 2 passive infrared (PIR) motion sensors were used and connected to the Input/Output (I/O) pins of the RP. As shown in Fig. 1, a WiFi adapter and a Global System for Mobile (GSM) modem were connected through the Universal Serial Bus (USB) ports of the RP. The former was used for internet connection through a WiFi router and the later was employed for Short Messaging Service (SMS) alert notification. Since all these components can be powered up at DC 5V, the system can be highly portable by connecting a high-capacity power bank as the main power supply.

Fig. 1: Experimental setup and electronic components of the portable surveillance system

Configuration of raspberry Pi and camera: The RP requires an operating system which can act as a set of basic programs and utilities that makes the RP to operate. Raspbian distribution was chosen whereby Raspbian is a version of Debian Linux specifically configured to run on the RP and was recommended by the Raspberry Pi Foundation as the operating system to be installed6. Firstly, the Raspbian image was downloaded and it was available for free in the Raspberry Pi website. Next, the Secure Digital (SD) card was installed with the image file. The recommended method to flash an SD card was a program called Win32DiskImager. The RP was then ready to operate.

Fig. 2: RP Camera that is connected to RP using the Flexible cable

The flexible cable that comes with the RP camera was inserted into a connector situated between the Ethernet and HDMI ports of the RP7. Figure 2 shows the picture of the camera module that is connected to the RP. The camera is then activated by navigating to “Enable Camera” and selecting “Enable” in the command prompt by using the following command.

Finally, a software module called PiCamera was installed to the RP to control the camera using Python commands. Followings are the commands used for downloading and installing the PiCamera software module:

Input and output interface with PIR sensors: The PIR sensors were connected to the I/O pins of RP and they would output logic ‘high’ when there was a motion detected. The I/O pins of the RP were studied fully in order to effectively control and receive the input signals from the PIR sensors.

Figure 3 shows all the I/O pins of RP. The first PIR motion sensor was connected to pins 2, 6 and 7 while the second sensor was connected to pins 4, 9 and 11. Therefore, the program or algorithm would detect or sense the input signals through GPI04 (pin 7) and GPI017 (pin 11).

Configuration of raspberry Pi as a web server: The RP can be configured as a web server by using different types of application such as the Apache8 and Lighttpd9. Apache is a popular web server application that can be installed on the RP to allow it to work as a web server.

Fig. 3: I/O pins of RP7

On its own, Apache can serve as a platform for dynamic web pages using scripting languages such as Hypertext Pre-Processor (PHP)10. The PHP is a general-purpose scripting language that is commonly used for web development. The following command was used for the installation of Apache on RP:

After installing the package, a default PHP file was created in a designated folder. This default web page could be viewed at http://localhost/ on the RP itself, or the RP’s local IP address on the network. The web server was then tested by accessing the local IP address of RP through another computer that was connected to the same Local Area Network (LAN). For example, when the RP was accessed through a computer at an address of 192.168.0.163, the default webpage was shown as in Fig. 4.

Web page for video streaming and control: A PHP software module was required to allow the Apache server to process PHP files. A PHP5 module was installed for this purpose. The following command was inserted in the LT Terminal for the installation:

Next, the index.html file was moved to index.php by the command below:

The file was then edited accordingly using the following command:

The index.php file was edited accordingly based on the design requirements which was to preview the camera video stream and some other added functions such as to capture image, record video, start motion detection, camera standby, shutdown system and reset system. For the purpose of the added functions, “script.js” file was edited. Furthermore, an additional tab was added for accessing the images and videos captured. To ensure that only authorized person would be able to access the webpage, it was designed to be secured with added coding on the main script.

Fig. 4:
Default web page after the installation of Apache web server application

Fig. 5:
Screenshot of the designed main web page that request the user to enter the password for accessing the content

Figure 5 and 6 show the screenshot of the web server in a web browser. The main page (Fig. 5) was requesting for password.

If the correct password is entered, the contents which include the video streaming and all the control buttons or functions will be made available to the users, as shown in Fig. 6. However, the web page will prompt the user to re-enter the password and access will not be granted when a wrong password is entered.

Table 1 summarizes the functions or descriptions for each button which is designed and included in the web page.

Connection to 3G through Wi-Fi, port forwarding and dynamic domain name system: Internet connectivity was provided through a 3G network via a router. The router was connected to a 3G broadband modem (Huawei E176) and the RP was connected wirelessly to the TP-Link 3G Wireless N Router (TL-MR3420) via a Wi-Fi adapter (Adafruit Realtek RTL8192cu). This configuration was used to provide a path for connecting RP to the internet so that it would be accessible easily.

Table 1: Descriptions and functions of the buttons on the main web page

Fig. 6:
Screenshot of the main content of the video streaming web page

The web server set up using Apache was viewed over the network by setting up the port forwarding configurations. Port forwarding was needed to ensure that the router was able to direct the request to the correct port which the RP was connected to. Firstly, it was requested from the service provider that the broadband SIM was given a Public IP address. The IP address was used for access over the internet. Prior to that, configurations on the router were made such that a virtual server was set up for RP so that it would identify the device’s port number. Figure 7 shows the summary of access of RP server remotely through any devices such as computers or smart phones.

From Fig. 7, it can be seen that the remote computer can access the router at IP 113.210.24.144. Since port forwarding configurations were made on the router such that port 1234 was assigned to the RP, the complete IP address for the access of RP would be 113.210.24.144:1234.

Moreover, a Dynamic Domain Name System (DDNS) service was set up. This is because the 3G broadband SIM will obtain a different public IP whenever it is rebooted. It will be inconvenient and difficult to obtain the current public IP. Therefore an application called No-IP was used as a dynamic DNS service provider. A No-IP account was created and No-IP client was installed in RP. The following commands were used for this purpose.

In this way, the personal web server can be accessed without the need of having a static public IP. Instead, RP web server was accessible through a specific address which was http://fypkishoor.ddns.net. This was because when there was a change in public IP, the application which was installed in RP would update the public IP that was associated to http://fypkishoor.ddns.net.

Email alert notification: A few packages were installed to enable simple mail capabilities.

Once the packages were installed, the defaults of Simple Mail Transfer Protocol (SMTP) were set and finally the configurations were edited accordingly with user information. For normal email sending, the following code was used:

SMS alert notification: An application named Gammu was used for the sending of SMS using RP11. It provides the necessary functions to communicate with the modem and send messages.

Fig. 7:
Remote access path of devices through the internet

A SIM card was inserted to a USB modem (Huawei E176) and the modem was connected to RP through USB port. The application was installed by downloading a package.

It was then configured by using the following command.

whereby, ********** represents the mobile number to be sent. For example, if a message “test” is to be sent to +6012-3456789, then the command will be echo “test” | sudo gammu sendsms TEXT +60123456789.

Incorporation of all functions using python scripts: Three programming scripts were created to carry out all the functions and features of a portable surveillance camera system. However only the main script was required to start and initiate all the other 2 functions. The main script was written using the Python language and it was named “fyp.py” which was integrated with two other scripts namely “RPi_Cam_Web_Interface_Installer.sh” and “recording.py”.

Main program
“fyp.py” :This is the program that coordinates all the features and functions of a working surveillance system. There were two motion sensors namely "Intruder alert sensor 1" and "Intruder alert sensor 2". When one of these sensors was outputting an active high signal, the main program would call the “RPi_Cam_Web_Interface_Installer.sh” script.

Function 1
“Rpi_Cam_Web_Interface_Installer.sh”: The script was designed to carry out a sequence of tasks which was to first send an email, record a video of 10 seconds (by calling the recording.py function) and finally to start the camera . It also allows the user to stream the video through the web server.

Function 2
“Recording.py”: This script was created to record a video for 10 seconds upon motion detection. It was initiated by the “RPi_Cam_Web_Interface_Installer.sh” script once an email was sent. The recorded video was saved in the same directory as the camera stream videos which was accessible in “/var/www/media”. Therefore all the recorded videos and images could be accessed through the web server too.

Autorun using crontab: It is very important to auto-start all the programs upon booting-up of the RP. For the script to automatically start upon every system reset, an application was used to perform this. Crontab was used to auto-start the program script at every reboot. A script named “launcher.sh” was created to be included in the “fyp.py” script.

RESULTS

This system worked in such a way that when there was a motion detected by either one of the PIR Motion sensors, an SMS was sent to the designated mobile number. It then proceeded to send a notification email and SMS to the assigned e-mail address and phone number, respectively before triggering the camera to record a 10 sec video.

Fig. 8:
Flowchart of the program for the portable surveillance system

Once recorded, the system started the video streaming which could be viewed at the hostname http://fypkishoor.ddns.net. At this web server, several functions could be used such as capturing an image, recording a video, starting motion detection, putting camera in standby mode, video quality settings, shutdown and reset the system.

If the motion sensors were not triggered, the system would keep checking for motion before performing the same process. At all other time, as long as the RP was turned on, the web server could be accessed. However, the video streaming only started when there was an intruder or motion was detected by the PIR motion sensors.

The flowchart in Fig. 8 summarizes the functions of the portable surveillance system.

DISCUSSION

Since the portable surveillance system is controlled using RP through Python script, the system flow can be easily modified to suit different types of practical applications. For example, for a movable container which acts as an ultra-high capacity battery storage, additional sensors such as temperature sensor and smoke sensor can be added such that the safety and condition of the storage area can be monitored remotely. Furthermore, this type of internet-based solution was also reported to be useful for the development and operation of an unmanned robotic airship12. Therefore, this microcontroller-based system will certainly find its applications in unmanned aerial vehicle system, especially those related to monitoring and control processes. It is noted that 3G broadband connection speed may vary at different areas. Although, it is expected that the launching of 4G connection will further enhance the connection speed and quality, the developed system has catered for the need to adjust the video quality and resolution in cases where the connection speed are not sufficiently high. Users may adjust the settings through the web-based interfaces.

By creating a web server and establishing 3G internet connection through a microcontroller, the work reported in this study has enabled further development of more microcontroller-based systems which can be more portable, with lower power consumption and lower production cost. These will certainly cater for the current and future demands of end-users. This type of microcontroller-based system can also further be enhanced by designing and developing mobile applications (Androids and IOS) which can access the system using mobile phones.

The portable surveillance system developed through this project provides more additional features and flexibilities to the users if it is compared with a few previously reported Internet Protocol-based camera systems3,4. This is because it can be battery-powered for the highest mobility and the configuration of the microcontroller as a mini server allows users to access the surveillance system remotely for reconfiguration and downloading of images or videos. In addition, user alert notification provides the convenience of continuous monitoring the site without 24 h manual monitoring.

CONCLUSION

The Raspberry Pi microcontroller was studied to discover the capability and functions which could be carried out. By installing applications and packages which enabled the execution of 3G internet connection, web server application, SMS, DDNS, video streaming and web page design, a microcontroller-based portable surveillance system with intrusion alert notification was fully designed and developed. Compared to conventional IP camera systems, this surveillance system offers lower power consumption and much higher mobility, which are advantageous for movable assets or premises and remote industrial sites monitoring.

SIGNIFICANCE STATEMENTS

This study describe the development of microcontroller-based portable surveillance system that can be utilize in remote industrial sites monitoring, moving vehicle monitoring and similar application in more reliable manners.

ACKNOWLEDGMENTS

K.N. Pentaiah would like to thank the Electronic and Communication Engineering Department, College of Engineering, Universiti Tenaga Nasional for providing the lab facilities and necessary financial support (UNITEN Internal Grant: J510050608) in completing this project. The authors would also like to thank the Institute of Power Engineering (IPE) of the Universiti Tenaga Nasional for the professional advice and technical assistance.

REFERENCES

  • Bosman, J.A., S. Olivieri, I. Ozil and B.C. Steacy, 2007. Design of a completely wireless security camera system. A Major Qualifying Project Report, University of Limerick, Faculty of Worcester Polytechnic Institute, Worcester, Massachusetts.


  • Ahmed, S.F., 2007. A new approach in industrial automation application embedded system design for injection molding machine. Proceedings of the IEEE International Multitopic Conference, December 28-30, 2007, Lahore, Pakistan, pp: 1-5.


  • Li, B., W. Zhang, Z. Liu, M. Kang and S. Li, 2011. Development and implement of the IP camera based on DM6437. Proceedings of the International Conference on Mechatronic Science, Electric Engineering and Computer, August 19-22, 2011, Jilin, China, pp: 1961-1964.


  • Navas, B., I. Sander and J. Oberg, 2009. Camera and LCM IP-Cores for NIOS SOPC system. Proceedings of the 6th FPGAworld Conference, September 10, 2009, ACM., New York, USA., pp: 18-23.


  • Zafar, S. and A. Carranza, 2014. Motion detecting camera security system with email notifications and live streaming using Raspberry Pi. Computer Engineering Technology, New York. http://www.asee.org/documents/zones/zone1/2014/Student/PDFs/218.pdf.


  • Munsell, A., 2013. Getting started with raspberry pi: Installing raspbian. January 14, 2013. https://www.andrewmunsell.com/blog/getting-started-raspberry-pi-install-raspbian/.


  • Upton, E., 2013. Camera board available for sale. May 14, 2013. https://www.raspberrypi.org/blog/camera-board-available-for-sale/.


  • Vukotic, A. and J. Goodwill, 2011. Apache Tomcat 7. Apress, Berkeley, CA., USA., Pages: 296


  • Bogus, A., 2008. Lighttpd. Packt Publishing, UK


  • Upton, L., 2014. Setting up an apache web server on a raspberry pi. December 12, 2014. https://www.raspberrypi.org/documentation/remote-access/web-server/apache.md.


  • Anonymous, 2014. Send SMS from a raspberry pi. http://www.mattiasnorell.com/send-sms-from-a-raspberry-pi/.


  • Ramos, J.J.G., S.M. Maeta, L.G.B. Mirisola, S.S. Bueno and M. Bergerman et al., 2003. Internet-based solutions in the development and operation of an unmanned robotic airship. Proc. IEEE., 91: 463-474.
    CrossRef    Direct Link    

  • © Science Alert. All Rights Reserved