A review of Arduino and salesforce for data collection and storage designed for mi-croclimate monitoring

This paper discusses the creation of a prototype station for monitoring microclimate and other variables such as carbon dioxide air concentration level and globe temperature through components that gather, process and store data from low-cost sensors. Its general purpose is to provide data on climate and other more granular features, such as microclimate. The specific objective was to seek solutions for the issue of securely storing microclimate data collected by the prototype using an Arduino open-source hardware board. The proposal to use Salesforce's PaaS computational cloud for data storage allows for the existence, with the current state of technology, of several tools capable of assisting both in collecting data as well as in securely storing them for later analysis. The study and the creation of such a prototype station for monitoring microclimate and other variables were carried out in the city of Campinas/SP. In the end, it was concluded that the station was efficient due to the accuracy of the data obtained by most sensors interfaced with Arduino and recorded on Salesforce's platform with the use of the NodeMCU Wi-Fi module. Some objectives were not met as one of the sensors was faulty and the integration between Arduino and NodeMCU could not be completed due to time constraints.


The importance of microclimate monitoring
Microclimate monitoring is of great relevance for societies and urbanistic development, as well as for verifying environmental balance and sustainability. Monitoring data from the air and other natural resources also contributes to academic studies in these fields (SANTOS et al., 2014). In addition to these contributions, microclimate monitoring can also assist bioclimatic architecture with thermal comfort verification.
The main form through which human beings organize themselves to live in society are the cities (LOPES, 1998). As a consequence of the evolution of urban centers, phenomena such as deforestation or the removal of native vegetation, soil sealing, river canalization and the construction of buildings and traffic lanes for fuel-burning vehicles are taking place in cities. All of these practices contribute to the formation of Urban Heat Islands (UHI). UHIs become more hazardous in places that have higher urban density, entailing the use of artificial resources such as HVAC systems to control thermal comfort for people (ROMERO, 2013;ROMERO, M. A. B. et al., 2019).
According to Lamberts, Dutra and Pereira (2014), "the microclimate can be designed and changed by the architect". With this statement, it is understood that the architect can play a very important role in the microclimate of urban areas by designing buildings that contribute to thermal comfort. Therefore, for the development of architecture, it is important for the architect to conduct studies on the microclimate in order to mitigate or avoid the bad effects of heat islands.
Technologies and their tools can assist in microclimate studies and research. Together with architecture professionals, the technology sectors can contribute to the development and progress of bioclimatic architecture in sustainable environmental rehabilitation of urban environments.

Climate and microclimate monitoring
In Brazil, the Instituto Nacional de Meteorologia [National Institute of Meteorology] (INMET) -currently under the management of the Ministério da Agricultura, Pecuária e Abastecimento [Ministry of Agriculture, Livestock and Supply] (MAPA) -is responsible for providing free meteorological information to the population. INMET collects weather-related data on temperature, relative humidity, wind direction and speed, atmospheric pressure and precipitation, among others, through Upper Air Sounding Systems (UASS), Surface Weather Observation Stations (ASOS/AWOS) and an Automatic Weather Station (AWS) Network (INMET, 2020). While it is possible to use those data to carry out studies on climate, INMET does not provide the more specific information that characterizes the microclimate. INMET's usage stations are fixed and do not capture microclimate in its granularity. Thus, as an alternative for studying and monitoring climate, some researchers use the general data provided by INMET, resorting to maneuvers such as increasing or decreasing degrees according to other parameters.
In a particular experiment, according to Romero and Vavallo (2015), the INMET database was used, but with an adjustment to correct the difference in altitude between the exact location of analysis and the location of the Institute's meteorological station. With the use of a sensor at a different location from the analysis site, it is understood that microclimate values may change. Therefore, using a portable, wireless microclimate measurement tool can be more accurate for on-site data collection.
Another downside of relying solely on the INMET database is that, in addition to the issues related to the lack of precision in results, there is also the human factor and the fact that reading occurs on a sparse schedule.
INMET's conventional method of climate monitoring also has flaws in data integrity. In this sense, Torres et al. (2015) point out: For many years, the assessment of these data was done through conventional weather stations run by INMET, which installed them, while the responsible technicians collected the data generated by these stations only three times a day. This is a very low frequency of collections, and there is also the human factor in measurements -that generates errors of systematic or random nature -which can lead to large disparities in relation to the real value (TORRES et al., 2015).
Thus, the pursuit for better ways of monitoring microclimate points towards the need for greater accuracy and reliability of data. However, there is also a need to optimize the costs of monitoring by creating cheaper stations.
In order to perform the collection and analysis of meteorological data, it is necessary to use instruments and equipment to measure these characteristics. The equipment available on the market is usually expensive, hence the importance of the implementation and prototyping of low-cost weather stations (TORRES et al., 2015;VIEIRA, 2018). The purpose of these climate monitoring stations is to measure physical attributes, such as temperature, relative humidity, atmospheric pressure, wind speed, among others (ELIAS et al., 2014;VIEIRA, 2018). Contemporarily, with the use of technologies, several tools, devices and equipment have been developed to assist in the collection, measurement, monitoring, analysis and storage of these data.
This study aims to review and contribute to the work that has been developed on microclimate monitoring with the use of technological innovations, in order to obtain greater data accuracy and cost reduction in the creation of monitoring stations. In this sense, it will cover similar research addressing the usage of sensors and microcontrollers to gather climate data, as well as of Salesforce platform's cloud technology to store them.
These are factors that can and should be considered for an efficient climate data monitoring experiment, by means of a low-cost, portable micro station that has the advantage of performing the collection at a desired location, with the desired reading frequency and period.
In this work, these reviews were conducted alongside the creation of a prototype station for monitoring microclimate and other parameters such as sound intensity level, carbon dioxide air concentration level and globe temperature through components that capture, process and store sensor data.
To that end, effort was made to provide data on microclimate and some other variables more influential and suitable for thinking comfort at a human scale, since these more specific microclimate data are not made available to the population by public agencies such as INMET, which only provides general data on climate.
Furthermore, the study sought to work out the difficulties in the storage of data collected by sensors on the Arduino board using the Salesforce platform.

Use of Arduino for monitoring
The creation of a prototype station for monitoring microclimate and other variables requires the use of sensors to capture data as well as a device capable of supplying them with electrical power while simultaneously controlling and processing the signals picked up by the sensors. This device can be a programmable microcontroller, which, by the use of code and mathematical formulas (cf. Appendix B), fulfills that intent.
In Vieira (2018) and in Müller (2019), studies in the areas of technology and computing were reviewed to develop comfortmeter prototypes with the aim of measuring the internal microclimate for bioclimatic architecture. They used Arduino 1 microcontrollers, as they are open-source hardware compatible with a wide range of low-cost sensors. Air and globe temperature, relative humidity, wind speed and atmospheric pressure sensors were used to assess climate data in these authors' research on architecture and urbanism.
Arduino is an open-source hardware tool, which is programmable and can be connected to sensors, actuators and various modules, including those intended for Wi-Fi internet connection. Microcontrollers such as Arduino have been used in several works, such as: Schmidt et al., (2020), Torres et al. (2015, Brito et al. (2017), Kusriyanto and Putra (2018), Üçgün and Kaplan (2017) and Simões (2017). These authors have conducted research using Arduino to collect climate data. Schmidt et al. (2020) and Torres et al. (2015) used memory card modules adapted for Arduino to store the collected data. Brito et al. (2017) used a Raspberry PI 2 microcomputer connected to Arduino to establish a connection with a database server in order to store the records and host a website for accessing them. Simões (2017) also used a database server on his research.
Kusriyanto and Putra (2018) used Arduino in combination with both a memory card and a Wi-Fi module (ESP8266), the latter being responsible for sending the collected data to be stored in the cloud at dweet.io 3 along with freeboard.io 4 , where graphs and dashboards can be generated on the collected data.

Cloud computing
Cloud computing provides space for storing and accessing data in files via software systems on a server connected to the internet with access security. As a result, it can be accessed by devices that connect to the internet, such as computers, smartphones, tablets and Wi-Fi modules for microcontrollers (SALESFORCE PAAS, 2020).
These clouds are provided in 3 different standard service models: a) SaaS: Software as a Servicethe system is already developed and ready for the end user, without customization flexibility; b) PaaS: Platform as a Servicethe system is partially developed and can be customized to meet the user's needs; and c) IaaS: Infrastructure as a Servicethe system is developed by the consumer and the cloud only provides the server and access security. (VIEIRA, 2017 (2019), wherein a prototype comfortmeter was produced using a microcontroller with sensors connected to a web server in order to store climate data.
In this work, other comfortmeter prototypes were also compared, whereof 4 out of the 6 models studied  In this environment, it was possible to create a cloud and begin the present work's first tests. The Salesforce Cloud is a Platform as a Service (PaaS). What is interesting about this choice is the ability to create an individual, secure platform with a pre-existing Salesforce system, which allows for object programming in a codeless, functional way; it also allows for customization through automation codes for receiving data via other systems' interface.

METHODS
As stated, the creation of a prototype station for monitoring microclimate and other variables requires the use of sensors that gather these data from the study site. A device that controls and processes the signals captured by these sensors must be added to the station thereafter. Once that is done, it is also necessary to choose a safe storage practice for these data. Subsequently, to illustrate the broad process of building this Internet of Things (IoT) system, a diagram was made delineating the communication relationship between the four tools used, as shown in Figure 2. In the first stage, the sensors and the microcontroller were wired up together. A network connection between the Wi-Fi module and the cloud was thereupon established in the second stage. Ultimately, the only remaining step to be accomplished so that the general purpose of this work could be attained and an IoT system for microclimate monitoring could be built was a hookup between the micropocessor and the Wi-fi module. Like so, this experiment took place in stages: i) The first consisted of attaching the components to the breadboard, programming the Arduino Mega microcontroller and reading sensor data using Arduino Integrated Development Interface (IDE) on a computer; ii) The second encompassed the preparation of the environment in a Salesforce development cloud and the programming of the NodeMCU Wi-Fi module with Arduino IDE, as well as the connection of this module to Salesforce over Wi-fi network; and

iii)
A third stage, wherein Arduino Mega was to be connected to the NodeMCU module, was planned at first but was not fulfilled due to this article's deadline.
As a result, it was not possible to completely transfer the data collected by the prototype to the cloud, in order to securely store those records.

First stage
The first stage carried out in this experiment covered data collection, whereat 4 breadboarded sensors were connected to Arduino Mega, which in turn was connected to a computer via USB cable, whereupon data received from the sensors was stored in the Serial Monitor with Arduino IDE. This stage is represented in Figure 2. Details on how the sensors were placed on the breadboard in connection with Arduino can be found in Appendix A of this paper. In order to analyze the variables carbon dioxide air concentration level, globe temperature, sound intensity level, relative humidity, and air temperature, the following sensors were selected:

MQ135 -gas sensor for air quality
The MQ135 sensor detects toxic substances in the air in a range from 10ppm to 200ppm, including carbon dioxide. The sensor is interfaceable with Arduino and can be calibrated (MQ135, 2020; SAI et al.,

DS18B20 -globe thermometer
Globe thermometers are typically used to obtain the Mean Radiant Temperature (MRT), an important unit of measurement for the calculation of thermal comfort indexes. To this end, the DS18B20, a low-cost digital temperature sensor compatible with Arduino, was inserted into a ping-pong ball painted in black paint (THORSSON et al., 2007;VIEIRA et al., 2017;VIEIRA, 2018);

KY-038 -sound sensor module
KY-038 is a sound intensity sensor capable of picking up sound variations in its proximity. It is possible to adjust its sensitivity by rotating the built-in potentiometer (SALLES, 2017); and

DHT11 -relative air humidity and temperature sensor
The DHT11 is a temperature and relative humidity sensor; it is compatible and performs well with Arduino, whilst capable of being connected to both analog or digital ports. However, this sensor may produce readings inaccurate by ±2.0ºC (plus or minus two degrees Celsius) as well as ±5% (plus or minus five percent) in the perception of relative humidity (VIEIRA, 2018).
The total amount spent on prototype components, not factoring in the computer, the breadboard and wires used for the assembly of the monitoring station, tallied 220.00 BRL (two hundred and twenty reais). As can be seen in table 3, all the components, including the microcontroller, are low-cost and therefore make monitoring studies quite feasible.

Second stage
The second step was based on Wickramasinghe's tutorial available on MANELSOFT's 6 website, wherein a NodeMCU Wi-Fi module was used to send data collected by a temperature sensor to Salesforce.
The choice of a NodeMCU Wi-Fi module for this study, as well as of the procedures and methods for connecting it to the Salesforce cloud, was made in accordance with this tutorial. 6 Available at: http://www.manelsoft.com/projects/nodemcu\_sfdc\_temperature_service.aspx. Accessed on: 6/23/2020  NodeMCU could not be completed, the data collected by the sensors could not be sent to Salesforce's testing environment. That being said, the same Figure 3 exclusively shows the logs created from these tests, meaning that no realistic value captured by a temperature sensor was used in the code (Appendix C), wherein an arbitrary temperature value was used instead. The code used to connect NodeMCU to this work's test environments's website is included in Appendix C, whilst other configuration and programming procedures necessary for Salesforce's development cloud are contained in MANELSOFT's tutorial.
As noted in relation to the effort made to store the data gathered by the sensors in the cloud, all stages were concluded except for the connection between Arduino Mega and NodeMCU, which remained unattended in virtue of schedule.

RESULTS
The totality of developments and technical trials of this work (including monitoring and data collection) were carried out indoor, in a residential setting, in the city of Campinas, in the interior of the state of São Paulo, during a period of social isolation resulting from the covid-19 pandemic (BRASIL, 2020).   (2016), the climate zone of this region is classified as LCZ31, as it is a residential neighborhood with low-rise, red-roofed houses and little vegetation. Based on Weather Spark's 7 "average weather conditions for Campinas and region", it is known that Campinas usually has a mild climate, with temperatures that typically vary from 13°C to 29°C, with higher average relative humidity in the period from October to April (during spring and summer) and lower from April to October (during autumn and winter).
Data collection took place in winter, on June 6, 2020, over a period of nearly 6 hours of reading from 5:17:59 pm to 11:11:23 pm. A total of 10,310 lines of sensor readings were registered for each of the 5 discrete variables in Table 3, amounting to 51,550 records, in this order: carbon dioxide PPM; relative humidity percentage; air temperature in degrees Celsius; globe temperature, also in degrees Celsius; and sound pressure level in decibels. The data collected in this experiment were recorded in the Arduino IDE's Serial Monitor. These data remain on the computer's cache memory, therefore being prone to permanent data loss if the program is closed.
To prevent this from happening, these readings were copied to a text file and saved locally on the computer's hard drive as soon as the experiment was over. With this text file, it was possible to generate charts on each of the variables by time in seconds. As can be seen in Figure 5, a flammable element was burned just before the experiment so as to release a larger than normal amount of carbon dioxide into the environment, thereby making it possible to verify that the CO2 ppm rates were higher at first and dropped over time. The DHT11 sensor is able to measure the variables of air temperature and relative humidity. From Figure 6, it can be seen that the relative humidity increased over time, after it started to rain during the experiment. Along with relative humidity, the DHT11 sensor also measured air temperature, but, as shown in Figure   7, it is worth noting that this sensor's temperature measurement averaged aout to around 25.5°C, which is considerably less accurate in terms of temperature variations, when compared to the DS18B20 globe temperature sensor. In the analysis of the globe temperature sensor data in Figure 8, it was possible to observe that the temperature varied around 24°C, while presenting three outliers. These discrepant readings occurred due to changes in the microclimate of the test environment attributable to the purposeful flick of a lighter, in an effort to detect brief and transient changes in the experiment. This provides insight into the importance of high frequency in data reading to model both the analog and the continuous variants of reality. In order to read the analog and digital outputs from the sound sensor and convert them to decibels, a logarithmic formula had to be obtained and applied. Nevertheless, a small constant variation was detected, which was not proportional to ambient sound. The KY-038 sensor, though successfully used by Salles (2017), did not achieve a satisfactory result in this work.

FINAL THOUGHTS
After the present study, it was verified that microclimate monitoring can contribute significantly to the observation of heat islands in urban centers and to the monitoring of climate change in the world. It was also found that there are already several researches using Arduino interfaced with sensors for the measurement of climate and microclimate features, whether these prototypes are connected to the internet or to the cloud, or to a data storage module such as an SD memory card, with no connection to the internet. But since the cost of implementing such a prototype connected to the cloud is low, its use is relevant, because nothing else makes remote and continuous monitoring possible.
It can be argued that the combination of Arduino and Salesforce expands storage capacity and improves data security as well, but both an increase in collection time and the installation of a microcontroller with a Wi-Fi module in the station are advised. It was also found that remote and continuous monitoring is made possible by cloud computing.
The prototype station built for this study proved to be efficient in terms of correctly gathering data from sensors other than KY-038, which presented a manufacturing defect. The procedures of the second stage of the experiment, i. e., to connect the NodeMCU Wi-Fi module to a local wireless network and to send the command for the creation of records in Salesforce's cloud computing environment, based on Wickramasinghe's tutorial, were also succesfully accomplished. Finally, only the integration between Arduino and NodeMCU was left unattended, due to time constraints.