ENVIRONMENTAL TEMPERATURE AND HUMIDITY MONITORING SYSTEM USING RASPBERRY PI 4 AND THINGSPEACK

In recent years, IoT platforms have become increasingly used due to their untapped potential. This paper aims to create an IoT system to monitor temperature and humidity in an enclosure The Raspberry Pi 4 SBC (Single-Board Computer) development board and ThingSpeak cloud platform will be used to make this system. Data from the DHT11 humidity and temperature sensor will be collected by the Raspberry PI 4 SBC development board, which will transmit it via the WiFi connection to the IoT ThingSpeak platform cloud for further analysis. The IoT ThingSpeak platform provides data storage, processing and visualization services.


INTRODUCTION
The Internet of Things allows the fusion of several things and uses the Internet as a communication system to establish an interaction between people and surrounding objects. Cloud IoT platforms have begun to become a crucial component in IoT applications. In recent years, several IoT platforms have emerged that can be used to store and process data from sensors in real time. Among the most used IoT platforms that can be used for device management and data visualization are: ThingSpeak, KAA, MainFlux, Things Board and DeviceHive [1].
ThingSpeak is an ioT platform, open source launched in 2010 by ioBridge, that can be used to design IoT applications without the need to configure additional servers. To retrieve data from IoT devices, the platform uses HTTP and MQTT protocols. ThingSpeak provides APIs for a range of programming languages, C, Python, Java as well as MATLAB and provides applications that allow more easy integration with web services, other APIs, as well as social networks [2][3][4][5].
By using the ThingSpeak cloud platform the data can be collected almost in real time, processed and then viewed. For analysis and visualization of Data ThingSpeak can run code written in MATLAB. To preserve the authenticity of the data, each user has a unique key through the API [5,6]. board 802.11ac Wi-Fi, Bluetooth 5, two USB 3.0 ports, two USB 2.0 ports and supports two monitors connected via micro ports HDMI (HDMI tip D) at a resolution of 4 K. The supply is made through a USB Type C port [7].
With the development of the IoT domain, temperature and humidity monitoring in an enclosure can be done more quickly through IoT platforms, which allow data to be sent to the cloud for storage or processing and then viewed. Users can view data from the IoT platform account, from any location where they have access to the Internet.

Description of method
The block scheme of the system used to monitor the temperature and humidity of an enclosure is shown in Figure1. Under the block scheme in Figure1, information collected from the temperature and humidity sensor is transmitted to the ThingSpeak Cloud server, connecting the Raspberry Pi 4 Model B development card via the Wi-Fi connection to an Internet-connected Wireless Router. The user can access the IoT platform from a Smartphone or PC.

Hardware architecture
The electrical wiring scheme of the IoT system carried out is shown in Figure 2. Within the electrical scheme, the temperature and humidity data of the ambient environment are transmitted by the DHT11 sensor to the Raspberry Pi 4 development plate via the GPIO 17 pin.

Software implementation
The program that allows the Raspberry Pi 4 SBC (Single Board Computers) to transmit data from the ThingSpeak platform's cloud about humidity and ambient temperature was developed in Python3. Within the source code for the purchase of data from the DHT11 sensor, the Adafruit_DHT library was used and the Thingpeak library was used to transmit data to the ThingSpeak platform cloud.
The following lines of code within the source code allow data to be purchased from the DHT11 sensor and transmitted to the ThingSpeak platform's cloud.
humidity_dht, temperature_dht = Adafruit_DHT.read(Adafruit_DHT.DHT11, 4) print("Temperature ={0:0.1f}C Humidity ={1:0.1f}%".format(temperature_dht, humidity_dht)) response = channel.update({'field1': temperature_dht, 'field2': humidity_dht }) The main element of the ThingSpeak platform is its channel, which stores data sent from different devices. A channel can be made public for other users to see, or it can be private. The private channel can only be shared with certain users via the API key [2]. The following line of code was used to initialize the connection to the ThingSpeak channel:

RESULTS AND DISCUSSION
In this papers the authors presented a system to monitor ambient temperature and humidity using the Raspberry Pi SGB and The ThingSpeak cloud platform. The IoT ThingSpeak platform supports data every 15 seconds so Raspberry Pi 4 has been programmed to send the data every 15 seconds. Variations in temperature and humidity relative to the time displayed by the IoT ThingSpeak platform can be viewed in Figure 3 and   Using MATLAB Visualizations in Figure 5 the histogram of the temperature-defining data set has been drawn.
The obtained graphs can be viewed both privately and publicly or published through the Apps section on the twitter social platform, ThingSpeak. Data collected by the ThingSpeak platform can be exported from the cloud in .csv format for further analysis through other software packages. For data analysis the ThingSpeak platform supports the source code written in MATLAB. MATLAB contains a number of powerful tools on the signal processing side. Through the code written in MATLAB the collected data can be processed and then displayed. This can design IoT systems that can make predictions over time.

CONCLUSIONS
The IoT ThingSpeak platform is the display of signals from opposites attached to IoT devices. Through this solution we can monitor the temperature and humidity of the environment from any location where we have access to the Internet by accessing the URL of the channel created. Thus, through diagrams we can visualize the temperature and humidity in relation to time.
ThingSpeak is one of the most used IoT platforms. The data transmitted by sensors to IoT platforms can be accessed via the Internet network. By using the ThingSpeak platform, data can be collected almost in real time, processed and displayed.
To transmit data to the platform's cloud, ThingSpeak requires a user account and a channel. Each channel has up to 8 data fields, status fields, and location fields. ThingSpeak does not have high security, data transmitted to the platform's cloud is not encrypted.