Vous êtes sur la page 1sur 6

2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

Remote Monitoring System based on a Wi-Fi


Controlled Car Using Raspberry Pi
Nazirah Ahmad Zaini, Norliza Zaini, Mohd Fuad Abdul Latip, Nabilah Hamzah
Faculty of Electrical Engineering
Universiti Teknologi MARA (UiTM) Shah Alam, Malaysia
nazirahahmadzaini@gmail.com

Abstract— Developing surveillance and monitoring systems can small enough to fit in the area and have the ability to move
be quite challenging at times, since the systems should be through small spaces.
designed with consideration of the environment to be monitored. Monitoring and surveillance operations in large buildings
Good surveillance systems need to have dynamic features, e.g.
also require a dynamic control system. A large building is
monitoring cameras that are mobile and can move around the
area being monitored. One scenario that requires such mobile
usually monitored by a team of security officers. There may be
monitoring is the surveillance of a large building with many times in which some of the team will leave the control room to
levels, which would incur a high cost to install many cameras at patrol from one level to another. Assuming that the time to
many places. Monitoring such a large area would also be a patrol any one level is about five minutes, if the building has
challenge for the security officers, as they will need to spend too more than 20 levels, it would take about an hour to complete a
much time to patrol covering all places. Other scenarios that patrol round on all levels. In addition, patrols also need to be
require dynamic surveillance systems include dangerous areas, repeated throughout the day. In this scenario, the advent of a
e.g. areas with explosion and fire risk, or those contaminated dynamic and mobile surveillance system may lead to a more
with toxic gases. Another use case includes areas that cannot be
efficient process. Security officers may not need to leave the
accessed by humans. To address these challenges, we propose a
dynamic monitoring system based on a moving camera carried
control room because they can virtually patrol on many
by a Wi-Fi remote controlled car. The remote-controlled (RC) different levels at any one time via several monitors in the
car is able to move on its own in an area remote from the control room.
operator. Users can be in the next room, the next building, or Concerning the scenarios described above, in this paper we
even in another country while controlling the movement of the present a mobile monitoring prototype employed on a Wi-Fi
car via the Internet. Some sensing mechanism is needed to help remote-controlled (RC) car. The RC car is driven by a
the user to locate the current location of the car and effectively Raspberry Pi and remotely controlled by the user via the
navigate. Thus, the camera that is attached to the car also act like Internet. The user is provided an interface via the browser to
the eyes showing the frontal view of the car to be seen by the user
view the live video captured by the camera attached to the car.
via a browser in real-time. This system is using Wi-Fi as the only
communication medium to connect the car to the server. The web A control panel is also provided, allowing the user to remotely
application which provides the interface for the user to interact control the movement of the car. The live video streaming from
with the car also provides live streaming views in the vicinity to the camera provides a dynamic surveillance view, which can
be monitored, i.e. via some other CCTV cameras installed in the be moved around the area to get a closer look of the current
area. suspicious event. In general, this prototype exploits the concept
of Internet of Things (IoT), where the RC car will be controlled
Keywords— Monitoring; Raspberry Pi; RC car; USB via the web by the user, while the transmission of data from the
webcams; Wi-Fi. car will be sent via the wireless network to the online server.
Other related systems are described in [15-17]. [15]
I. INTRODUCTION presents an RC car that can be controlled by a computer via a
A monitoring and surveillance system is usually designed parallel port. The commands used to control the RC car are
and built based on the characteristics of the area to be inclusive of voice and facial commands. [16] presents an RC
monitored. For example, areas that are too dangerous for car designed on Arduino microcontroller and controlled by
humans to operate in require aa dynamic monitoring system to smart phone running an Android application. In this project,
act in place of a safety officer. This includes areas in which the RC car is meant to be used in search mission in the
flammable liquids or gases present in excessive quantities can occurrence of natural disaster. [17] presents on a robotic
easily lead to an explosion or fire. In dangerous places such as vehicle that be controlled via Internet for surveillance purpose.
these, installation of equipment and special techniques should The surveillance vehicle can be maneuvered via keyboard. The
also be designed to avoid potential explosions and fire [1]. vehicle is also mounted with robotic arm, which can be used to
Another example scenario requiring dynamic and mobile help pick and move objects whenever necessary.
monitoring system is an area too small to be accessed by
humans. To monitor such areas, a monitoring system must be

978-1-5090-1181-0/16/$31.00 ©2016 IEEE 224


2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

II. SYSTEM OVERVIEW For this prototype, Raspberry Pi is chosen over other
An overview of the prototype design will first be presented controller such as Arduino due to its higher performance and
followed by some details on the proposed algorithm. For specifications, which allows more computation-intensive
connection to the server, the system will rely on a Wi-Fi applications to be deployed. For this prototype, the model used
network which allows data to be transferred to and from the is Raspberry Pi 2 Model B. Fig. 2 shows the features offered
Raspberry Pi to the web server. The Wi-Fi allows the RC car to by Raspberry Pi 2 Model B. This model comprises a 900MHz
access the Internet at broadband speeds once connected to an quad-core ARM Cortex-A7 CPU and 1GB RAM with 4 USB
access point (AP), or in ad hoc mode [14]. Wi-Fi has been ports, GPIO pins, full HDMI port, Ethernet port, a combined
chosen over Bluetooth since Wi-Fi have all specifications 3.5mm audio jack and composite video, camera interface
needed for this system. For instance, Wi-Fi allows some (CSI), display interface (DSI), Micro SD card slot and
security measure to be imposed if needed, e.g. a user that is not VideoCore IV 3D graphics core [1].
connected to the same network, as the Pi will not be able to The Pi is attached the RC car especially to enable live video
control the RC car via the web interface. This project is limited streaming from the camera and remote control of the car
to an area that has network coverage only and the camera used movement via the Internet. The Pi will be connected onto the
can only provide frontal views. same network as the monitor and the output will be shown in
the web browser.
A. System Architecture
2) The Camera: The camera used for this prototype is a
In this project, the main hardware components running on
USB webcam [5], which is connected to the Raspberry Pi.
the RC car were connected as shown in Fig.1. These include
Prior to camera installation, the chosen USB webcam model is
the Raspberry Pi, USB Webcam, Wi-Fi Dongle, L298 Dual H
checked against the list of Raspberry Pi compatible USB
Bridge Motor Controller, and RC Car. Each component is
illustrated in Fig 1. webcam to ensure that it will work well with the Pi [3].
Having the camera attached to the Pi will allow the captured
real-time footage to be streamed by the Pi onto the Internet via
Wi-Fi connection. The real-time live video is streamed via a
web interface for the user to view e.g. for surveillance or to
remotely control the car movement.
3) Wi-Fi Connection: To allow Wi-Fi connection, two
models of Wi-Fi Dongle are explored for this prototype:
Wireless N 150 USB Adapter and TL-WN727N USB
Adapter. Wi-Fi dongles enable Raspberry Pi to connect either
Fig. 1: System Block Diagram
automatically or manually to any Wi-Fi assigned by the user.
1) Raspberry Pi: The Raspberry Pi is a low cost, credit-card A USB webcam, as with the Wi-Fi dongle, must also be
sized computer that plugs into a computer monitor or TV and compatible with the Raspberry Pi. A list of compatible
uses a standard keyboard and mouse [2]. Despite its small dongles is taken from [4].
size, Raspberry Pi is capable of many big things and operates
4) RC car Motor Controller: For controlling the RC car
like a desktop computer, allowing browsing the Internet,
movement, L298 Dual H Bridge motor controller is used,
playing video games and word processing. However, unlike
specifically to control motors speed and direction. The
other controllers, which are compatible with almost every
controller can also be used for other purpose such as driving
programming language, Raspberry Pi uses several high-level
the brightness of lights, e.g. a high-powered LED array [6].
languages such as Scratch and Python.
5) Power Supply: Raspberry Pi can be powered from a 5V
micro USB supply, where the amount of current needed is
dependent on the type(s) of component(s) connected to the
Raspberry Pi. However, the ideal amount of current to run the
Raspberry Pi is 1.2 Ampere [2]. For this prototype, the power
supply used is a Pineng Power Bank, providing 2 amps and
5V. A fully charged power bank is able to support the
Raspberry Pi for approximately about 1 day and 4 hours (28
hours).
6) Radio Controlled (RC) car: For this project, the RC car
used has dimensions of 18cm x 11cm x 10cm, scale of 1:24. It
requires 3 AA batteries and has 2 motors that control the
forward, backward, left and right movements.
Fig. 2: Features offered by Raspberry Pi 2 Model B

225
2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

7) Raspbian Jessie OS: The Raspbian OS is chosen to run the car controller interface, which continuously waits for the
the Raspberry Pi. Raspbian is an unofficial port of Debian commands from the user. Based on the commands given by the
Wheezy with compilation settings adjusted to produce user, the system will react accordingly.
optimized “hard float” code that will run on the Raspberry Pi.
This provides significantly faster performance for applications
that make heavy use of floating point arithmetic operations.
Although Raspbian is primarily the efforts of Mike Thompson
(mpthompson) and Peter Green (plugwash), it has also
benefited greatly from the enthusiastic support of Raspberry Pi
community members desiring maximum performance from
their devices [7]. The Raspberry Pi is installed with Raspbian
Jessie as its operating system.
8) Python: Other special features of Raspbian Jessie include
updates of several of the applications that ship with Raspbian.
There are new versions of Scratch, Sonic Pi, and the Epiphany
web browser and also built-in Python applications. Therefore,
Python users can access the file without the having to install
anything [11]. Python is a clear and powerful object-oriented
programming language, comparable to Perl, Ruby, Scheme, or
Java, the syntax is very clean, with an emphasis on readability.
It uses standard English keywords. In this project, a Python
program will be used to transfer the data from GPIO pins all
the way to the motor of the RC Car.
B. Overall Activity Flow
Fig. 4: Web Interface Flow Chart
The overall activity flow of the system running on the
Raspberry Pi can be divided into several steps, as shown in Fig.
D. Hardware and Software Design
3. Once the Raspberry Pi is turned on, the Pi will search for
Wi-Fi access and automatically connect to the assigned Wi-Fi. Fig. 5 shows the connection between the RC car and the
The USB webcam will then automatically start to capture real- Raspberry Pi. The RC car consists of two motors, which
time video. The captured videos will first be compressed and control the front wheels; turn left or turn right, and the back
sent to the web server for live streaming. At the same time, the wheels; moving forward or backward. L298N H-Bridge is used
Pi will also wait for remote commands or input from the user to to control both motors on the RC Car. The RC car uses 3 AA
control the movement of the RC car. batteries as its power source. In this project, the power source
used will be separated for both L298N and the Pi. However, it
is possible to power up both L298N and Raspberry Pi
controller using one source. The connection between the RC
car and the L298N H Bridge is shown in Fig. 6.

Fig. 3: Overall Activity Flow (Raspberry Pi)

C. Web Interface Flowchart


Fig. 4 shows a flow chart of the web interface of the
system. Once the web interface is accessed, the user will be
prompted to log in. Upon successful authentication, the user
will be directed to a web browser displaying the live videos Fig. 5: Circuit Diagram showing connections between RC car and Raspberry
from the RC car’s camera. The user will also be provided with Pi

226
2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

This prototype offers one special feature, where the user is


allowed either to remotely control the unit via the Pi from
anywhere or only from the same network as the Pi. There are a
few methods that can be used to allow this feature. To allow
user to access the Pi from anywhere, port forwarding may be
set-up by configuring the router to forward all inbound traffic
from the Internet on a specific port to the local IP address of
the Raspberry Pi. Most routers have this feature available.
However, each router has a different configuration. One
disadvantage of port forwarding is that it exposes a network
port on the private LAN to the public Internet. This is a known
security vulnerability and must be managed carefully [8].
To allow access only from the same network, the Pi will be
Fig. 6: Connection between RC car and L298N H Bridge
installed with Weaved App to enable a locally connected user
to connect and access the Pi via SSH. Weaved is software
III. SYSTEM SETUP installed on the Raspberry Pi that allows connection between Pi
This section presents on the setup and configuration works with any device from anywhere over the Internet. SSH, VNC,
done to integrate all components together. Snapshots of the HTTP, SFTP file transfer and any other TCP service running
outputs are also shown following correct integration. on Pi can be enabled for secure remote access over the Internet
without port forwarding [8]. Fig. 9 shows that once Weaved is
A. Raspberry Pi Setup
installed on the Pi, it can be accessed from weaved.com on the
To set up the Raspberry Pi, several devices are essential to Internet.
ensure that every function is working perfectly for the first
time booting [2]. Table I comprises of the essential devices for
Raspberry Pi first booting. Fig. 7 shows on the first Pi booting
for the project.

TABLE I. COMPONENTS NEEDED DURING THE FIRST BOOT FOR


RASPBERRY PI
Devices Details

SD Card It is recommended to use at least 8GB class as the


card will be installed with the Raspbian Image
HDMI/DV Work as a display for the Pi. HDMI input will be the
Input best result.
Keyboard Any standard USB Keyboard and Mouse will work
Fig. 7: Raspberry Pi during first boot
and Mouse perfectly.
Power Supply Pi is powered using USB Micro power supply that
gives at least 2A at 5V. Lower current like 700mA
will work for basic usage. However, Pi will reboot if
the power is drawing too much.
Ethernet Used to connect PI to a local network and the Internet
Cable
Audio Lead Unnecessary if not using any audio

B. Wi-Fi Configuration
The Pi was configured to connect automatically to the
selected Wi-Fi network. To enable such Wi-Fi configuration,
two files, specifically the network interface and WPA
supplicant file, were edited using the script editor. This project Fig. 8: Raspberry Pi connected to Wi-Fi network
uses a nano script editor, i.e. GNU Nano, which is an easy-to-
use end of command line editors. In addition, the Pi is also C. Camera Installation
configured to have its own IP Address. Fig. 8 shows the To enable the live streaming video, the USB Webcams will
successful connection of the Pi with the Wi-Fi network. be installed with Motion, which is a program that monitors the

227
2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

video signal from cameras. It is able to detect if a significant a command-line utility GPIO that can be used to program and
part of the picture has changed; in other words, it can detect set up the GPIO pins and to read and write the pins. It may
motion. The output generated by Motion can be configured as even be used to exercise control from shell scripts [13].
JPG files, PPM format files or MPEG video sequences [9].
After all configuration has been done, the live video E. Web Interfacing
streaming can be accessed directly via a web link through the To allow access for the video live streaming and RC car
browser. Fig. 10 shows a live video streaming accessed via a controller, the web is designed using the HTML language. The
web browser. In this project, the image resolution used is the overall web interface can be seen as in Fig. 12. WebIOPi can
default resolution, which is 320px width and 240px height. To be used in addition to a web browser. WebIOPi is a web
increase the quality of the camera, MJPG Streamer can be
application that allows user to control the GPIO pins directly.
installed and used [9]. Nonetheless, the framerate must be set
However, support for Raspberry Pi 2 Model is not stable yet,
correctly or the video will stream much too fast. Another way
leading to some technical problems. This issue reinforces the
is to troubleshoot the criteria of the video by lowering the
frame rate, adjusting the size of the video, and using a higher- decision to choose a web browser over WebIOPi [14].
quality web camera.

Fig. 9: Successful login to the weaved.com website Fig. 11: Editing Python Script using GNU Nano Editor

Fig. 10: Live video streaming via a web browser on port 8008
Fig. 12: The complete web interface accessed from a mobile phone
D. Programming using Python Scripting
Scripting can be done using either nano editor or the GUI IV. RESULTS AND DISCUSSIONS
interface. Fig. 11 shows on how the scripting is done using Prototype development work has been carried out with an
nano scripting. Extra care should be imposed when writing the RC car which provides live video streaming that can be used
program, especially to ensure that the pin written to is the for surveillance purposes and is remotely controlled via the
same as the pin connected. Additional tools that can be used Internet. The RC car is driven by a Raspberry Pi, which has a
include WiringPi, which is a GPIO access library written in C Wi-Fi access to communicate with a web server. The Pi is
for the BCM2835 used in the Raspberry Pi. WiringPi includes attached with a USB webcam to provide live video streaming.

228
2016 IEEE Conference on Systems, Process and Control (ICSPC 2016), 16–18 December 2016, Melaka, Malaysia

A motor controller is also attached to the Pi to control the [4] “RPi USB Wi-Fi Adapters - eLinux.org", Elinux.org, 2016.
movement of the RC car. A web interface was created to [Online]. Available: http://elinux.org/RPi_USB_Wi-
provide both live video streaming and RC controller panel for Fi_Adapters. [Accessed: 23- May- 2016].
the user. Via this interface, the user is able to watch the live [5] V. Kadiam and G. Pavani, "Smart Phone Controlled Two Axes
video while navigating the area by remotely controlling the Robot for Video Surveillance Using Wireless Internet &
car’s movement. For power supply, the Pi is connected with a Raspberry Pi Processor", Hyderabad, India, 2014.
37 wh power bank that delivers 5v and 2.1a, while the RC car [6] "Arduino Modules - L298N Dual H-Bridge Motor Controller",
is powered up by 3 AA batteries. Instructables.com, 2016. [Online]. Available:
http://www.instructables.com/id/Arduino-Modules-L298N-
For local access authorization, a test was carried out in Dual-H-Bridge-Motor-Controll/?ALLSTEPS. [Accessed: 22-
which an unauthorized locally connected user was unable to May- 2016].
access the live streaming and did not have the ability to control [7] “RaspbianAbout - Raspbian", Raspbian.org, 2016. [Online].
the RC Car. Such users are directed to an error web page Available: https://www.raspbian.org/RaspbianAbout. [Accessed:
showing unauthorized access. In another test case, the RC car 22- May- 2016].
could only be controlled by an authorized user with correct id [8] “Access your Raspberry Pi over the Internet - Raspberry Pi
and password, with the ability to access the web browser Documentation",Raspberrypi.org, 2016. [Online]. Available:
regardless of their location, as long as the Pi has been powered https://www.raspberrypi.org/documentation/remote-
on. access/access-over-Internet/Internetaccess.md. [Accessed: 23-
May- 2016].
V. CONCLUSION [9] "WebHome < Motion < Foswiki", Lavrsen.dk, 2016. [Online].
This paper presents the development work of remote Available:
monitoring prototype system using a Wi-Fi controlled RC car http://www.lavrsen.dk/foswiki/bin/view/Motion/WebHome.
driven by a Raspberry Pi. The different hardware components [Accessed: 23- May- 2016].
and their assembly were described and a few studies were [10] "Troubleshooting.", Instructables.com, 2016. [Online].
conducted to explore ways on how the components can be Available: http://www.instructables.com/id/Raspberry-PI-
integrated to communicate with a web interface. The camera L298N-Dual-H-Bridge-DC-Motor/step5/Troubleshooting/.
[Accessed: 31- May- 2016].
acts as the viewer, either to provide surveillance view or to
guide the user while remotely navigating the car. The web [11] "Raspbian Jessie is here - Raspberry Pi", Raspberry Pi, 2015.
[Online]. Available: https://www.raspberrypi.org/blog/raspbian-
interface enables live streaming video, while the user is jessie-is-here/. [Accessed: 25- May- 2016].
provided with the navigation controller panel to allow control
[12] "Introduction to HTML", W3schools.com, 2016. [Online].
of the RC car movement.
Available: http://www.w3schools.com/html/html_intro.asp.
With a fully functional prototype, this project may be used [Accessed: 25- May- 2016].
for monitoring purposes in a building, in a hazardous area and
[13] "How to use WiringPi2 for Python on the Raspberry Pi in
other such locations. Several improvements can be made to Raspbian part 1",RasPi.TV, 2013. [Online]. Available:
enhance the capability of the project. For example, the camera http://raspi.tv/2013/how-to-use-wiringpi2-for-python-on-the-
maybe upgraded to a higher-quality camera to boost the quality raspberry-pi-in-raspbian. [Accessed: 25- May- 2016].
of live streaming. [14] J. Lee, Y. Su and C. Shen, "A Comparative Study of Wireless
Protocols: Bluetooth, UWB, ZigBee, and Wi-Fi", IECON 2007 -
ACKNOWLEDGMENT 33rd Annual Conference of the IEEE Industrial Electronics
We would like to extend our acknowledgement to Society, 2007.
Universiti Teknologi MARA (UiTM) and to those who have [15] K. Dumbre, S. Ganeshkar & A. Dhekne,"Robotic Vehicle
directly and indirectly contributed to our project. This research Control using Internet via Webpage and Keyboard",
is funded by the Synergised Industry-Experimenter Research International Journal of Computer Applications (0975 – 8887),
Grant Initiative, Universiti Teknologi MARA (600- Volume 114 – No. 17, March 2015.
IRMI/DANA 5/3/SINERGI (0003/2016)). [16] S. Rathod, V. Bansal & K. T. Patil, "Android Controlled RC car
Unit", International Journal in IT and Engineering, Vol.04 Issue-
04, (April, 2016).
REFERENCES [17] C. Pornpanomchai, P. Sukklay, "Operating Radio-Controlled
[1] "Hazardous (classified) locations. - 1910.307", Osha.gov, 2016. Cars by a Computer", IACSIT International Journal of
[Online].Available: Engineering and Technology, Vol.3, No.3, June 2011.
https://www.osha.gov/pls/oshaweb/owadisp.show_document?p_
table=STANDARDS&p_id=9884. [Accessed: 23- May- 2016].
[2] “Raspberry Pi - Teach, Learn, and Make with Raspberry Pi",
Raspberry Pi, 2016. [Online]. Available:
http://www.raspberrypi.org. [Accessed: 23 May- 2016].
[3] “RPi USB Webcams - eLinux.org", Elinux.org, 2016. [Online].
Available: http://elinux.org/RPi_USB_Webcams. [Accessed:
23- May- 2016].

229

Vous aimerez peut-être aussi