Energy Consumption and Lifetime of Wireless Sensor Networks Applications in Smart Cities: Simulation for Urban Mobility

: From now to 2030, the world urban mobility will increase by 50%. This increase will be mainly performed in developing countries which already suffer from congestion traffic especially in large cities where road traffic reaches a high density. This situation leads to a serious impact on the economic and social growth. The urban traffic management has become an essential factor. Within the framework of a Moroccan city like Casablanca (1.5 million vehicles a day run there ), an efficient road traffic management turns to be necessary so as to solve the serious problem of traffic jams and to decrease the problem of traffic jams and improve the fluidity of the road traffic. We are settling intelligent systems transport (IST) such as the case of smart cities. The traffic simulation is a better way to evaluate a road traffic network. The latter is simulated by using two simulators, Green Light district (GLD) and Simulator Urban Mobility (SUMO). We have been working with an Open Street Map in the SUMO traffic, in order to get closer to reality. This study describes a low cost and energy saving urban monitoring mobility system based on wireless sensor networks (WSNs ). Simulation results show that our suggested algorithm is efficacious and practical in different cases; it could reduce the number of packages sent from each sensor placed on the track. This proposed solution provides the sensor networks with a longer lifetime of sensor networks:by reducing its energy consumption.


Introduction
In Casablanca, getting around town is a challenge. The city has several problems in terms of mobility [1], parking and public transport. Urban transport also raises the question of fluidity of movement and the safety of users. Urban mobility is therefore a current issue and coming to the city of Casablanca. Moreover, this city records 10 million movements per day. On of all journeys, 18% are on foot, 11% in two-wheel drive 41% and 35% by public transport. Paradoxically, this distribution is already causing traffic congestion ( Figure 1). What measures are in place to improve urban mobility? It is therefore an urgent need to think of today to transform and optimize the various services and Casablanca infrastructure to meet the new needs of its people to improve their quality of life [2]. They have more than ever need a smart city [3].
In recent years, researchers [4], industry and academia have concentrated their efforts to solve these problems of traffic congestion [5][6][7], pollution [8], and existing infrastructure, and Intelligent Transportation Systems (ITS) with wireless sensor networks [9][10][11][12][13][14] are more effective in dealing with the above issues in future smart cities [15]. However, these efforts are still insufficient simulating traffic management systems with wireless sensor network in a reliable manner that can handle the foreseeable increase in population and vehicles in smart cities. Indeed, sensor networks used in urban traffic management [16,17] are often characterized by a deployment in environments limited in terms of resources (deployed at intersections). The limits imposed are in terms of processing capacity, storage and especially energy. Energy use in sensors plays an important role in the network's lifetime.
Several research studies [18,19] appeared with the objective optimizing the energy consumption of nodes through the use of innovative conservation techniques [10,11] to improve network performance, including maximizing its lifetime. Generally, energy saving eventually refers to finding the best compromise between the various energyconsuming ways.
This manuscript breaks down as follows: section 2 states the objectives and problem. Section 3 studies wireless sensor networks. Section 4 discuses consumption of energy sources by a sensor node, and then we combine this with the notion of the life of the network and we draw energy conservation techniques, and the proposed algorithm in the literature [10,11]. Finally in section 5 we present the SUMO simulation results with discussions and section 6 concludes this paper.

Wireless Sensors Networks
Wireless Sensors Networks (WSNs) have become a leading solution in many important applications and especially the urban traffic management [10-14, 16, 17, 19]: They act on the intersections, by undertaking to implement a strategy to change traffic lights which are controlled by a light controller. This traffic light management will represent an essential aspect of the fluidity of road traffic.
WSNs are very fashionable because of their quicker transfer of information, easy installation, but saving energy is still a major problem in sensor networks. Indeed, recharging energy sources is often too expensive and sometimes impossible. This requires that the sensors are saving the maximum energy in order to function for several years. In order to design energy efficient solutions, it is extremely important to first know the architecture and to analyze the different factors causing the dissipation of the energy of a sensor node [20].

Sensor Architecture
In this section we distinguish two parts composing a sensor: Figure 2 is the most general illustration of the architecture of a intelligent sensor. This architecture is composed of four units: Sensing unit: it allows the measurement of physical or analog greatness and converting them into digital data. It consists of the sensor itself and Analog-to-Digital Converters (ADC) allowing data conversion. The sensor is responsible for recovering the analog signals it transmits to the ADC whose role is to transform and transmit the analog data into digital data understandable to the processing unit.

Hardware Architecture
Processing unit: this is the main unit of the sensor. It is usually represented by a processor coupled to a random access memory. Its role is to control the operation of the other units. It can also be coupled to a storage unit, which will be used for example to save them the information provided by the data acquisition unit.
Communication unit: it has the function of transmitting and receiving information. it is composed of a transmitter / receiver (radio module) for communication between the various nodes of the network.
Power unit: this is an essential element of the architecture of the sensor, it is what provides energy to all other units. It usually corresponds to a battery powering the sensor, where limited resources are a major problem in this type of network since they are usually deployed in areas not accessible.

Software Architecture
The energy constraint sensor requires the use of lightweight operating systems such as TinyOS [21] or Contiki [22]. However, TinyOS is still the most used and most popular in the field of WSN. It is free and is used by a large community of scientists in simulations for the development and testing of algorithms and network protocols.
TinyOS only becomes active when a vehicle is detected. The rest of the time, the sensor is in the standby state, guaranteeing a maximum life expectancy knowing the low energy resources of the sensors. This type of operation allows a better adaptation to the random nature of wireless communication between sensors.

Power Consumption of a Sensor Node
The sensor nodes are microelectronic devices that can be equipped only with a limited power source (0.5 Ah, 1.2 V) in the form of battery.
In addition, WSNs when they are deployed, they are often in difficult access areas and sensors are usually deployed to not be deployed. It becomes unthinkable to want to change the batteries of the sensors.
If the number of sensors over hundred entities, it is even more difficult to intervene to find the faulty sensor and change the battery. The lifetime of a sensor is dependent on the life of its battery. This energy is consumed by different sensor units (section III-a), in order to realize the capture spots, data processing and communication. Data communications are actions that cost the most in terms of energy. The energy consumption of wireless sensor networks must be as low as possible. For this, it is highly necessary to limit the number of communications between sensors.

Energy Conservation of a Sensor Node
Experimental measurements have shown that, generally, the transmission of data is the largest consumer of energy, and significantly, the calculations themselves, consume very little [20,23]. The energy consumption of the detection module depends on the specificity of the sensor. In many cases, it is negligible compared to the energy consumed by the processing module and, above all, the communication module.
In other cases, the energy expended for the detection can be comparable or greater than that required for the transmission of data. The lifetime of a sensor network can be extended by the joint application of different techniques [10,11,21,[36][37][38][39]. For example, [10,11] proposed an energy efficient solution designed to minimize energy consumption during the activity of the network, minimizing the number of packets to be sent

Construction of a Network
The generation of a map (here called a network) is not necessarily automated by an interface but relies on the construction of an XML file of the mapCasablanca. net. xml type, which can be obtained in multiple ways Two main tools exist to generate such networks as shown in the table below: -NETGEN allows to generate in command line -NETCONVERT Converts a wide range of possible inputs into SUMO readable road networks. Networks can be created from XML descriptions or automatically generated from OpenStreetMap >> netconvert --osm-files mapCasablanca. osm -o mapCasablanca. net. xml

NETGEN
Generates abstract network for the SUMO-simulation NETCONVERT Network importer and generator; reads road networks form different formats and them into the SUMO-format

Open Street Map
The use of OpenStreetMap (OSM) [31,32] data in traffic simulation environments is very important today [33,34,35] thanks to the free data. To obtain the desired network (creation of a map), it is possible to define a set of XML files. This approach may seem heavy and difficult to do manually, but remains sufficient and practical for small networks.
In a complex case, we chose this method(OSM-data): After having selected the zone to be modeled; it must be translated into a SUMO [24,26] traffic network. This process is facilitated by the NETCONVERT tool provided in SUMO Software, which allows the import of networks directly from OpenStreetMap ( Figure 3). It allows you to export a rectangular area of a traffic network, which can then be imported into SUMO using the NETCONVERT tool. First, it's to convert the network to the Openstreetmap format (mapcasablanca. osm) into several XML files: a mapCasablanca. net. xml b mapCasablanca. osm c mapCasablanca. poly. xml d mapCasablanca. rou. alt. xml e mapCasablanca. rou. xml f mapCasablanca. sumo. cfg, Using the "netconvert" application, they can be read by SUMO. The file mapcasablanca. typ. xml, which contains important information about the network, such as speeds or priorities for each route class, should also be included. Figure  3 below shows an overview of how to convert it with the command lines used. To convert the Openstreetmap data to a file compatible with the input of the SUMO simulator. It is necessary to go through several steps Figure 4.
First, convert the format (*. osm) file to several XML files (*. net. xml, *. poly. xml, and * rou. xml), This is generated by applying the NETCONVERT module, they can be read by SUMO.
Second, the network file generated and viewed with the use of SUMO-GUI, to verify if the network is built with precision in order to obtain a graphical interface

sumo-gui mapCasablanca. sumo. cfg
The application of SUMO-GUI The display of the graphical interface appears clean, and of various types: very basic, standard or under a more realistic view. The possibility of adjusting the speed of execution of the simulation always exists, this is adjustable by defining the number of milliseconds to which corresponds a program step. During execution, each vehicle movement and traffic progress can be observed ( Figure 5).

Simulation Results
SUMO allows to generate various outputs for each simulation run; visualization is done using SUMO-GUI. We were interested in the vehicles queues at the junctions, and the average waiting time on each lane. As a output of the simulator, the result is done using --queue-output <FILE>.
This command generates a file type XML as shown Figure  6. <QueueCasa. xml> is the name of the file the Output will be wirtten to, below a part of this file: Before deserializing, an XmlMapSerializer must be constructed using the type of the object that is being deserialized. After deserializing the XML file to an object class, we now proposed an algorithm (developed in C#) ( Figure 8: Algorithm 2) that will allow us to calculate the average waiting time. The result is a file of type". txt" in the form of a table of two columns: The first column represents cycle number(iteration= time_step), and the second column represents the values of the average mean waiting time for a junction.  We recall that our objective is to reduce the energy consumption of the sensors deployed in the different intersections of the studied study area (city of Casablanca). This energy is consumed by the various units of the sensor (the processing unit, the acquisition unit, the communication unit).
Our research team has previously proposed an efficient energy solution to minimize energy consumption during network activity by minimizing the number of packets sent: the algorithm [13,14] is based on the results of Simulation of the GLD simulator. Figure 10. Proposed Algorithm [13]. Now we have used the SUMO simulator results (Output of Algorithm 2) being as the input parameters of the algorithm above as shown in Figure 10.  Figure 11 shows the number of sent packets by the sensors which is placed before the traffic light for 1000 cycles. The results show, in a normal function, this sensor sends about 275 messages to the fire controller, on the other hand with our proposed algorithm the same sensor sends about 216 messages. Consequently, the objective has been achieved to reduce the number of packets sent by the sensor and thus to minimize the energy consumption of the sensor.

Conclusion and Future Work
In this article, we discussed the problem of energy consumption in wireless sensor networks, which are deployed as part of urban traffic management. We chose the study area to work on a realistic case. Then, we simulated the mobility of vehicles with the Urban Mobility Simulator (SUMO). The latter can import the chosen road map in OSM format. The OSM card was converted into a format compatible with SUMO and introduced into the simulator.
Our current work is a continuity of earlier work and our perspectives was proposed previously. Here, we have evaluated our algorithm this time using other tools. The results obtained are efficient in energy which aim to reduce the energy consumption by minimizing the number of packets sent and consequently prolong the lifetime of the sensor.
Future work, we will work on other techniques to reduce the energy consumption of wireless sensors, in relation to the algorithms that manage the traffic lights, and to calculate the consumed energy of all the data packets sent by a sensor. It is a power to relay the data packets of the nodes of the source sensor to the receiver.