Conference PaperPDF Available

Design and Implementation of a Single-Hop Wireless Sensor Network Based on Matlab Interfaced with Arduino

Authors:

Abstract

The wireless sensor network (WAN) has been developed especially in recent years to provide the time and effort of technological development in control systems, monitoring buildings and even in agricultural land. Using the facility of Matlab interfaced with WSN via Arduino which is act as a gateway the data that collected from number of nodes in the network. As it is known the Matlab have several capabilities to store, processing and displaying in various methods which support the skills of such network. In this research, it has been designed and implemented a single-hope WSN controlled by Arduino interfaced with Matlab. The proposed network consists of four nodes as experimental network and router to aggregate the data from nodes to send it wirelessly single-hop to the Matlab in Personal Computer (PC). The user can choose the way that display the reading, compare it with other one and analyze the results or any processing by designing a simple program with Matlab. The results confirm that the proposed network is active for monitoring and protection for any particular area.
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Design and Implementation of a Single-Hop Wireless Sensor Network
Based on Matlab Interfaced with Arduino
Shahad Ahmed Hamid 1, Dr. Mahmood F. Mosleh 2, Dr. Rashid A. Fayadh 3
1 MSc Student, Department of Computer Engineering, College of Electrical Engineering
Techniques, Middle Technical University, Baghdad, Iraq, Email: shahadahmed142@gmail.com
2Assist. Professor Department of Computer Engineering, College of Electrical Engineering
Techniques, Middle Technical University, Baghdad, Iraq , Email: drmahfa@yahoo.com
3Department of Electrical Power Engineering, College of Electrical Engineering Techniques,
Middle Technical University, Baghdad, Iraq, Email: r_rashid47@yahoo.com.com
Abstract: The wireless sensor network (WAN) has been developed especially in recent
years to provide the time and effort of technological development in control systems,
monitoring buildings and even in agricultural land. Using the facility of MATLAB
interfaced with WSN via Arduino which is acting as a gateway to the data that collected
from number of nodes in the network. As it is known the MATLAB have several
capabilities to store, processing and displaying in various methods which support the
skills of such network. In this research, it has been designed and implemented a single-
hope WSN controlled by Arduino interfaced with MATLAB. The proposed network consists
of four nodes as experimental network and router to aggregate the data from nodes to
send it wirelessly single-hop to the MATLAB software in Personal Computer (PC). The
user can choose the way that display the reading, compare it with other one and analyze
the results or any processing by designing a simple program with MATLAB. The results
confirm that the proposed network is active for monitoring and protection for any
particular area.
Keywords: - WSNs, MATLAB software, Arduino, Single-hop
I. INTRODUCTION
Single hop systems are a star topology that the gateway communicates bi-
directionally with all wireless sensor nodes and allow easy connection for small networks.
Hierarchical scheme with multiple sub networks must be considered once a greatest
number of nodes are reached. In a star configuration, if any node fails, it does not effect on
other nodes, except that fails is the central node. The gateway acts as a computer or an
appropriate embedded device, and works together to deliver information between sensor
nodes and transmit the results to another applications or networks, like the internet. Sensor
nodes don't send data to each node instantly. They use the gateway as coordination and the
data are concentrating. In all topologies of wireless sensor network, the star topology is the
lowest generally in consumption of power however it is limited by the transmission
distance of the radio in each node back to the gateway. Ordinarily, this distance ranges is
starting from 10 to 100 m and depends on the used radio frequency by the node. In general,
www.coleetech.net 1
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
higher ranges are compatible with important factor and higher power consumption when
considering ranges for standalone with battery powered devices [1].
The hop means the number of networks that a packet must pass to reach its
destination address. In a single hop network, when the source packet leaves, take only one
hop (passes through another network or passes through another router from a different
network) before reaching the destination address.
Many research has been implemented a WSN with Matlab tools to perform many
tasks like, [2] presented a detailed analysis of the comparison of one-hop approaches and
multi-hop used for transferring data and inquiries from source to destination. Many
dimensions are normally used to analysis with the respective of applications to increase the
scope of analysis in scenarios of real world. One hop and multiple hop are performed with
the help of the MATLAB simulation software is a tool to get the simulation results and
compare different design constraints. In the proposed architecture of [3], a combination of
heterogeneous of WSN and PAN has been experimented. They suggested architecture used
ZigBee protocol to send sensor data from the sensor node, which in turn redirects the TCP/
IP data to an internet database via a Bluetooth enabled mobile network and mobile phone.
The scalability of the proposed architecture in MATLAB simulation is estimated for using
the results in experiments as a rule. Its findings show that the suggested structure applies to
small networks used by mobile.
This paper is attempt to design and implement a WSN with a single-hop structure
using four nodes with four sensors; distance sensor, light sensor, motion sensor and gas
sensor. It is assumed that the proposed network is used for monitoring and safety purpose
for a particular building. The heart of the proposed network is the Arduino interfaced with
MATLAB to store and process the aggregated data.
II. SINGLE-HOP WSN
Wireless sensor networks consist of a wide range of nodes used in military and home or
privet applications. They have tuned resources such as limited battery power energy,
processing power and memory storage. The WSN consist of the destination node, the
source node, and multiple sequence nodes are placed randomly [2].
WSN is the most connected network communication used in many applications and
organizations. It consists of independent sensors distributed spatially to monitor physical
conditions, like light, temperature, vibration, volume, pollution, or movement, and passing
their data collaboratively across the network to the main location. The considered networks
are defined by using small nodes but each node is defined under the energy definition. The
sensor network is connected with the external network that helps the base station.
The base station is known at a specified distance location. All network nodes send
collected information to the base station and broadcasted this information over the internet
[4]. A single hop network is shown in Fig. 1 is a model that performs the direct
communication with cluster head [2].
www.coleetech.net 2
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Figure 1: Single-hop network
One-hop directives are used to limit public communications by choosing the head of the
cluster to deliver data to the main station. When the communication distance is the distance
between the head of the cluster and the main station increases the hop connections, one
consumes more power representing the main defects of the single hop network [5] .
III. System Model
The system model used in this research is shown in Fig. 2.
Figure 2: Proposed System Model
Nodes are one of the basic components of the network, which senses the
surrounding conditions such as temperature and humidity…etc and turn it into a signal
and then send it to the gateway. Each node consists of sensor, Arduino, XBee and Xbee
shield as shown in Fig. 3. The sensor is transducing the surrounding environment into
electrical signal either in digital or analogy signal.
www.coleetech.net 3
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Figure 3: Node Components
There are many types of sensors can be used in a different networks to perform
many tasks, but in this work it has been used four types of sensors as a case study. In the
following, the detailed explanation for each sensor used in the proposed network of this
research.
i- Distance Sensor
It is an ultrasonic sensor module HC - SR04 that senses distance from 2 cm
to 400 cm, and it has ranging accuracy approximate to 3 millimeters. The
parameters include transmitters, receiver and circuit controller. The electric
parameter of sensor are listed in table 1 [6]:
Table 1: The parameters of distance sensor
Source of volt. DC 5 volt
Current 15 mA
Frequency 40 Hz
Maximum range 4 meter
Minimum range 2 centimetres
There are four pins in this sensor are shown in Fig.4:
Echo = Receive, Trig. = Trigger, Vcc = Power, and GND = Ground.
Figure 4: Distance sensor
ii- Light Sensor
www.coleetech.net 4
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
It is a photocell used to sense the light and send a signal to the Arduino which
is in turn active with MATLAB to record and display the activation time. The
feature of this sensor is cheap, low power, small, and easy for using in projects. It is
often referred to photoresistors, a Cadmium-Sulfide (CdS) cells, Light-Dependent
Resistors (LDR) and photo-resistors as shown in Fig. 5 [7].
Figure 5: Light sensor
iii- Motion Sensor
This sensor is used for detecting the motion of a human who moves in the range
of a sensor. The features of this sensor someone is detected up to approximately 30
feet away or up to 15 feet away in a low sensitivity mode, and the small size makes
it easy to hide an easy interface to any microcontroller as shown in Fig. 6 [8].
Figure 6: Motion sensor
iv- Gas Sensor
This sensor is a MQ-7 semiconductor of carbon monoxide as shown in Fig.7
and good sensitivity for carbon monoxide in large range, the sensor has many
advantages such as a simple drive circuit, long life, and low cost. The main
applications of this sensor are widely used in domestic CO gas alarm, portable CO
gas detector, and industrial CO gas alarm [9].
www.coleetech.net 5
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Figure 7: MQ-7 sensor
The second part of the node component is Arduino for collecting and
processing the data in addition to produce a suitable commands. It is an open
physical source computing program based on a simple output and input board and
the implementation of developing environments that processing language [10].
Two types of Arduino are used in this research shown as in Fig.8 are Arduino
Mega for the sensors node and Arduino Uno for the router.
Figure 8: Arduino, (A) Arduino MEGA, (B) Arduino UNO.
The last component of the node is the Zigbee based IEEE 802.15.4 which is used as
communication part. In this research two types of XBee are used to send data directly to
PC are shown in Fig. 9. The following comparison between the two products is represented
in table 2 [11]:-
Table 2: Parameters comparison between two products of XBee.
Specification XBee S2 XBee S2C
Internal Range 40 meter 60 meter
External Range 120 meter 1200 meter
Power of transmitter 2mW 3.1mW
The data rate 250Kbps 250Kbps
www.coleetech.net 6
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Sensitivity of receiver -98dB -100dB
Volt 2.8 - 3.6 V 2.1 - 3.6V
Current of transmitter 40mA 45mA
Idle/Receive Current 40mA 31mA
Current 1μA 1μA
The frequency 2.4GHz 2.4GHz
Network Topologies Star, Mesh, Point to Point Star, Mesh and Point to
Point
Figure 9: (a) Xbee S2 (b) Xbee S2C
IV. Results
Now, it has been running the final network to show its capability for monitoring the
surrounding environment for each node. Fig.10 presents the numerical reading of the four
sensors. Distance sensor is presented by letter D for example D329 means 329 cm, Motion
Sensor is presented by letter P, light sensor is presented by letter L and gas sensor is
presented by letter C for example C745 means the amount of CO gas is 745. All numerical
reading is stored in the MATLAB, so it can display the result in the form of what the use
need.
Figure 10: Sensors result in IDE.
www.coleetech.net 7
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
Fig.11 shows the amount of gas per second for 14 seconds period so that the user can
determine the amount of gas for any period. Also, it can increase the period of any time
like 10 h, 24 h and so on.
Figure 11: Result of gas sensor.
In addition, it can be displayed the result in another form like Fig.12 which display the
distance VS. time to detect the movement of any object approaching the sensor.
Figure 12: Result of Distance sensor.
For motion sensors, the results are displayed when there are clear motion for any object
closed to the sensor as shown in Fig.13 which shows the movement time in the first
column. For lighting sensor the reading of second column in Fig.13 shows turn off time of
the ligth.
Figure 13: Results of Light and Motion sensors.
V. Conclusion
www.coleetech.net 8
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
In this research, it has been designed a WSN for monitoring and safety of particular
building. An Arduino interfaced with MATLAB is employed in this network to take the
advantage of the MATLAB for storage the data aggregated from all sensors and displayed
in any form that the user needs. The result shows that this network can be monitor the
surrounding environments as numerical reading versus time. The user can read the
environment for any time once he returns to the MATLAB. Also, it can use this network
for alarming or controlling other devices when the reading exceeds a threshold value that is
choose by user.
References
[1] J. Cecílio, P. Furtado, "Wireless Sensors in Heterogeneous Networked Systems",
Computer Communications and Networks, Springer International Publishing
Switzerland, 2014.
[2] Ajit Kumar Singh, Sandeep Rajoriya, Subham Nikhil, Tapan Kumar Jain,
"Design Constraint in Single-hop and Multi-hop Wireless Sensor Network Using
Different Network Model Architecture", International Conference on
Computing, Communication and Automation ICCCA, 2015.
[3] Chen Zhong, Jens Eliasson, Rumen Kyusakov, Jerker Delsing, "Evaluation of a
Heterogeneous Sensor Network Architecture for Highly Mobile Users",
Communications and Network, 2011.
[4] Nisha yadav, Sunil Kumar Yadav, "Implementation of Wire Sensor Network
using MATLAB Simulator", International Journal of Recent Development in
Engineering and Technology, 2014.
[5] Pratistha Sharma, Mr. Abhishek Gupta, " A Review on Multiple Single Hop
Clustering Based Data Transmission in Wireless Sensor Network", International
Journal Of Engineering And Computer Science, 2014
[6] Datasheet of Ultrasonic Ranging Module HC - SR04 by Elec Freaks Available in
the Site https://cdn.sparkfun.com/datasheets/Sensors/Proximity/HCSR04.pdf.
[7] Datasheet of Photocell Tutorial by Adafruit in Electronics Available in the Site
http://www.instructables.com/id/Photocell-tutorial/.
[8] Datasheet of Motion Sensor by Parallax Available in the Site www.parallax.com.
[9] Datasheet of Gas Sensor by Winsen Electronics Technology Available in the Site
www.winsensor.com.
[10] Massimo Banzi, "Getting Started with Arduino", 2nd edition, 2011.
www.coleetech.net 9
The Second Engineering Conference for Graduate Research
Middle Technical University - Electrical Engineering Technical College
Baghdad – Iraq
www.coleetech.net 10
ResearchGate has not been able to resolve any citations for this publication.
ResearchGate has not been able to resolve any references for this publication.