**3.1 Architecture of the proposed system**

**Figure 2**, shows the block diagram of designed system of three smart petrol stations based on IoT. The petrol station system connects to local server or cloud server over the internet. Online data can be visualized by a remote company office on ThingsBoard web user interface through chrome or Firefox web browser from desktop or smart phone or other devices. **Figure 3**, shows the flow chart of this system. The scheme offered consists of hardware part and software part.

#### **Figure 3.**

*Flow chart of the proposed system.*

#### *3.1.1 Hardware part*

It consists of four layers as IoT architecture. These layers are:

#### *3.1.1.1 Sensing layer*

This layer is represented by the control system that controls the fuel dispenser and storage tank.

#### *3.1.1.2 Gateway layer*

This layer is represented by the Wi-Fi router, which receives the sensor data from the station and sent by ESP-32S via the MQTT protocol to be directed to the server at the service layer.

## *3.1.1.3 Service layer*

The service layer of the system designed from the server consists of a Raspberry Pi 4 model B minicomputer with a 1.5 GHz quad-core 64-bit processor that provides about 3 times better performance compared to the previous version, more ports and faster Internet connection, where the certified Raspbian operating system is downloaded [14]. On the Linux system, and downloading the ThingsBoard platform on this system for the purpose of reviewing all the variables and operations that the customer performs, and they occur at the packing station immediately after logging into the server by entering a fixed IP address in any web browser such as Chrome, Firefox or others. Or dealing with cloud ThingsBoard Server for the purpose of accessing station information from anywhere in the world via the Internet. For more security this server can be accessed using a username and password to view data in the application layer.
