Wireless sensor networks (WSN) are the base of the Internet of Things (IoT) that all together give rise to the smart city. These WSNs consist of several sensors, which are densely distributed to observe physical or environmental conditions, like humidity, temperature, light intensity, and gas concertation. The sensors reading data are transmitted to the network coordinator, the IP-gateway, which is at the heart of the wireless network.
WSN is a technology developed with great potential in a great number of fields, including earth observation, environmental monitoring, agriculture, resource organization, public health, public security, transport, and military. The potential of WSN in earth applications and its general tendencies are discussed and essential questions are raised 
. WSNs are formed by a set of devices that are wirelessly interconnected with each other through a wireless network and transmit the data to a gateway to be sent to the internet. A device is called a node, where each node is attached to one (or multiple) sensors as shown in Fig.ure
1. There are typically several parts for each sensor network node: a radio transceiver with an internal antenna or an external antenna connection, a microcontroller 
. There are also an electronic circuit of sensor interfacing as a source of energy, typically a battery or an embedded type of energy harvesting [3,4]
Figure 1Figure 1
. Wireless Sensor Network Architecture for Environmental Monitoring.
A sensor node is a wireless device responsible for detecting events from its environment and then communicating them to the sink node 
. The sensor may be used in some cases as forwarder; aggregating data from multiple sensor nodes, removing redundancy and communicating the data to the next hop 
. To perform these tasks in an efficient way, the sensor node should be equipped by a microcontroller with specific characteristics. In this context, a low power and fast microcontroller is needed to achieve complex computational instructions without ignoring energy constraints. The size of a sensor node varies from a shoebox to the size of a fingertip, the cost of sensor nodes varies from a few to hundred dollars, depending on the complexity of each sensor node [7,8]
2. Wireless Sensor Network Monitoring Applications
A wireless sensor network (WSN) is considered as several sensor nodes randomly distributed in a target field to co-operatively monitor and record its physical conditions. This network includes hundreds or thousands of smart devices with sensing and processing capabilities that are powered by a dedicated battery. These devices are requested to acquire environmental stimuli, including humidity, temperature, light, and vibrations. The sensor nodes are designed for sensing events, communicating data, and aggregating and processing packets in a central location named sink node 
. Due to these characteristics, the WSNs are used in various fields such as health care, industry, environmental monitoring, and research and development 
. In this context, the authors in 
reviewed some healthcare-based applications and outlined the challenges in wireless sensor networks to support high levels of trust-worthiness and to ensure the privacy and security of medical data. In 
, the authors proposed a health monitoring system capable of acquiring physiological parameters from multiple patient bodies using a wireless body sensor network (WBSN). When detecting an abnormal condition, this system issues an alarm to the patient and sends a SMS/email to the healthcare providers. The system has been evaluated in terms of coverage, energy consumption, and end-to-end delay.
Actually, the wireless sensor networks support many types of applications: medical, military, and civil. These applications include but are not limited to environmental monitoring, medical supervision, home surveillance and automation, object tracking, and agriculture control applications. Despite multiple offered services, the WSNs suffer from a severe limitation in terms of the energy resource at each sensor node. In addition, it is not often convenient to replace nodes’ batteries. Therefore, using energy-harvesting techniques based on the ambient resource can play a key role in extending the batteries’ lifetime 
The IoT framework is establishing connectivity of anyone with anything anywhere for a very large-scale Internet. Recently, a few papers started studying the security of IoT communications, especially their current status, challenging architectures and prospective measures [23,24,25]
. First, the current status of IoT covers mainly its layered architectures and their impact on the proposed solutions. Second, several IoT challenges are considered due to the limited edge device capability, the involved heterogenous technologies, and the lack of security. Third, prospective measures have been implemented to address the security concerns specific to IoT layers and devices and to ensure interoperability in an heterogenous environment. The heterogenous network based on WSN and IoT is deployed to monitor animal health with the precise location in 
The authors in 
proposed an educational IoT model to design a weather station based on ThingSpeak cloud services. Their platform involves both software and hardware parts including DHT11 and BMP180 sensors, Mega 2560 microcontroller, cloud API interfaces, MATLAB scripts as well as applications implemented upon both Windows and Android operating systems. The weather station consists of measuring environmental events (temperature, humidity, and pressure) and sending them to the ThingSpeak server via an ESP8266 WiFi module. The ThingSpeak server implements two channels. The Meteostanica channel is used to store the measured data as well as for MATLAb visualization. The second channel allows MATLAB data analysis, calculating the average values of measured metrics and then determining their current states.
, the authors presented an environmental monitoring infrastructure using a sensor network-based architecture. Similar to 
, this work employs three main components: sensors, gateway, and cloud. The data (temperature and humidity) is measured by specific sensors and routed by the gateway toward the cloud where data are accessible in real time for visualization and analysis using smart phones. This architecture integrates both button memory and µPanel aspects for various reasons. First, button memory can allow this architecture to work even in absence of power and Internet connection. Second, µPanel is designed to operate with slow and unreliable Internet connection. In addition, µPanel-based cloud infrastructure becomes capable of monitoring sensors locally without permanent Internet connectivity. In terms of results, the authors demonstrated the µPanel efficiency in supporting easy and fast deployment of complex monitoring systems. They affirm that their compact transmission scheme at the smart-phones as well as the push notifications support are the main concepts reinforcing real time clients as similar to the smartphone-based monitoring in 
The authors in 
used both smart sensor devices and cloud-hosted application in order to design a flexible IoT API for more end-to-end communication security. The main goal of this work is to provide secure end-to-end communications despite the recurrent network dis-connectivity and fog-device limitations especially in terms of energy, buffer, computing capacity, and network channel speed. To achieve these goals, the middleware implements two algorithms: Session Resumption and Optimal Scheme Decider algorithms. Any device, recently disconnected due to an unreliable network connectivity, can resume using the first algorithm. Moreover, to match with a given resource constraint, the user employs the second algorithm to select the most suitable end-to-end security scheme via supervised machine learning. In terms of results, this work demonstrated that using static properties of Preshared Key or Certificates can significantly speed-up secure communications.
The work performed in 
introduces the main technologies able to solve environmental problems in smart cities. This work involves a wireless sensor network (WSN) including wireless sensor nodes, gateway, and cloud sites. First, data are collected from WSN nodes using Smart Environment Monitoring (SEM) applications. A gateway is used to translate the data from IoT devices and transmit them to Google Cloud Platform (GCP) IoT Core that can detect enormous vulnerabilities. When the parameters deviate from normal values, a notification email is sent to detect abnormalities in the environmental parameters. To manage IoT access and prevent MQTT (Message Queuing Telemetry Transport), message conflict in the AWS (Amazon Web Service) IoT Core, an email audit function is developed to check the security and status of edge device certificates via SNS (Simple Notification Service) email notification. The limitation of this mechanism resides on the device-server data synchronization required by X.509 certificates. A new connection between IoT device and GCP Core server is accomplished with a server certification file for authentication. In addition, several parameters such as ID, region, and device topic are used at the transport layer MQTT protocol to ensure more reliability and credibility of the connection. The main result of this work is limited to perform a comparison of the capability of IoT cores in AWS and GCP to identify the available services as well as how to use them in cloud-based IoT applications.
, the authors developed a WSN and cloud computing-based communication system able to monitor ambient air quality. On one hand, the wireless sensor network is equipped with low-power ZigBee motes responsible for measuring field air quality and transmitting data to the cloud via an intermediate gateway. On the other hand, a cloud computing approach has been developed to collect, monitor, process, and visualize the air quality distribution in large areas. The collected data are processed in the cloud using pattern recognition and support vector machine-based artificial intelligence techniques that allow detecting contaminants and discriminating BTEX compounds. The authors performed a case study to evaluate the system operation, which demonstrated good performance in detecting, measuring, and discriminating the common volatile organic compounds. Their results are summarized by a discrimination rate of 93.05% and around 0.99 for coefficients determination.