Development of A Station for The Measurement of Environmental Conditions in The Unidades Tecnologicas De Santander (UTS), Using Telemetry and Database Management with Raspberry Pi

This article focuses on the development of an electronic remote data acquisition system which will have the following sensors adapted: thermometer, hygrometer and barometer. From the measurements of these will be obtained data of temperature, relative humidity, atmospheric pressure, which will be stored in the form of records in a data recorder using Raspberry Pi and through wireless communication the data will be transmitted when the software requires it to a module Central of visualization, which according to some parameters will automatically update the histories according to the defined times, or at the request of the user. It will be implemented following a process of research, planning, execution and validation. It implies the necessary information for the implementation, in the planning process the different systems to be used will be divided into 3 groups, measurement and registration system, communication system and a control system composed of the software, and then the acquisition will proceed of the equipment and accessories necessary to execute the assembly. In the execution process, the physical implementation of all the systems will be carried out and the programming of the data acquisition, communication and data storage systems will be developed.


Introduction
In order to carry out measurements of environmental conditions in places that are difficult to access and to view these data remotely in order to study and analyse them, it is necessary to have a data acquisition system, storage and remote data transmission to a viewing station, This system called SCADA by its acronym in English Supervisory Control and Data Acquisition. (Rodríguez, 2007) SCADA systems are diverse using devices based on Arduino, Raspberry Pi or RTU designed with analogue or digital inputs to connect all kinds of sensors and equipped with communication devices either by radio frequency, GPRS, or even with connection. to internet through WIFI. However, RTUbased systems are too powerful and expensive and are generally used in the industry for robust SCADA systems with a large number of sensors and control devices.

Materials and Method
An investigation was carried out that according to promote the use of renewable energies in the consumption of electrical energy in the institution, a meteorological monitoring system is necessary to determine the behavior of the climatological variables to optimize the viability and design for a project self-generation through solar panels.

Sensor Selection Temperature Sensor Selection
For the selection of the temperature sensor, the accuracy of the sensor, the practicality to install and its electrical output were taken into account. For this, the DHT 22 and LM35 sensors were taken into account The RTD PT100 is selected since according to its characteristics it allows us a greater range, greater accuracy, if necessary a better resolution can be configured, the RTDs have a linearity in a fairly wide range and their architecture is much more resistant for outdoor environments Unlike the other sensors compared, since it is not an electronic circuit, it is not affected by humidity nor does it require the use of bakelites for its connections and the connection cable is already protected from the elements. But this, having a resistance output, it is necessary to use an analog to digital input converter since the inputs of the Raspberry Pi card where the sensors are connected are digital.

Atmospheric Pressure Sensor Selection
For the atmospheric pressure sensor, as in the temperature sensor, the range, the accuracy and its electrical output were taken into account to be able to be connected to the Raspberry Pi. Among the options you have the BMP180 BMP280 and BME280. According to the comparison, the highest accuracy and shortest response time are obtained with the BME 280 sensor, they all handle the same output interface and the BME280 also includes a relative humidity sensor. In the BMP280 sensor the resolution is better, the disadvantage is that it does not include the relative humidity sensor, because of this the BME280 sensor is selected, which allows the space of the sensors to be as compact.

Relative Humidity Sensor Selection
According to the specifications in the table below, the DHT22 sensor was selected since its specifications are better in terms of response time and accuracy compared to the other sensors, in the same way the cost of the sensor is very low.

Raspberry Module Selection
When selecting the controller for data acquisition and storage, the characteristics of each of the Raspberry Pi models on the market are taken into account. A comparison is made of the Raspberry Pi 3 B and the Raspberry Pi 2 B models, as they are the last ones released by the manufacturer, they present the best hardware specifications, and thanks to the comparison, the following is easily observed: • QUAD Core Broadcom BCB2837 64 bit ARMv7 processor.
• Processor speed has increased from 900MHz on Pi 2 to 1.25 Ghz on RPi 3 B.
• Up to 2.5 amps upgraded switching power supply, meaning you can now power even more powerful devices via USB ports.
The main differences are the 64-bit quad-core CPU, Wi-Fi, and Bluetooth. However, the improved power management should mean where the Broadcom's Pi3 provides better support. In terms of size it is identical, all the connectors and mounting holes are in the same place. Also, the Pi3's performance is roughly 50-60% faster than the Pi2. (Foundation RP, 2017) Knowing this data, the Raspberry Pi 3 B is chosen for its performance and provides a better operation of the devices to be used.

Results And Discusion
In the selection of the necessary teams for the station of measurement with telemetry and management of database selected two Raspberrys Pi 3, one of these with internal memory of 16 gb, connected like system of measurement composed of a controller TTGO Arduino One SX1278 which receives the signals of measurement of a sensor of temperature RTD, sensor of atmospheric pressure and relative humidity selected according to the specifications of these, the system had of this form in union of a Raspberry Pi with Arduino, being able to this last make work only with the sensors and system of storage, but wanted that the project in the station of measurement had a system of control more powerful as it is it his operating system Rasbian for the work with files, between other advantages explained in his technical index card. The system of measurement has a solar signpost like feeding with battery to give the autonomy in hours of no solar generation. The station of visualizations has the Raspberry Pi 3 with internal memory of 32 gb connected to a screen led of 7 in with source of feeding of 110v and regulation to 5v.
For the autonomy of feeding obtained a length of 6 hours without solar light, using a solar signpost of 20 W for proofs with which explained , but the results of autonomy did not allow an operation of 24 hours because of the way in programmed the communication between both Raspberry since these keep lit with the communication established still in the moments in that it does not send information, to reduce the consumption because of this needed of modifications in the operation of the station of measurement as in the solar signpost that installed for the Raspberry PI 3, by this was necessary deactivate true services of the system to consume less energy and attain with a solar signpost of 40 W an autonomy 24/7 while the battery find in good conditions. With more time of improvement of the programming in a future project where add more sensors could improve the communication to be able to sleep the Raspberry in the moments in that it do not send information.
It determined diminish the active functions of the Raspberry in the station of measurement of form to consume less improves having the following resulted before and after the changes made in east, show the initial data and finals because of the big quantity of data taken. The following services of the system to consume less energy and attain with a solar signpost of 40 W an autonomy 24/7 while the battery find in good conditions. Service of LAN/WIFI Service of VNC Service of SSH. Service of audio The only services that always have to be activated in the Raspberry Pi of the station of measurement are I2C, SPI and serial. The proofs of measurement of distance of the modules of communication make in the sector of Girón in the neighborhood Banks of the Rio taking like reference the spaces of proofs in inner (indoor) and in outsides on line of sight between the two modules (outdoor).

Proofs of Distance Modules of Communication Arduino Lora Sx1278
The proofs look for to find the maximum scope with which can obtain the best results of communication so much on line of sight as in inner spaces. All the proofs make in the same geographic space taking into account the characteristics of the terrain regarding elevation  In the table 16 observe the parameters of configuration by software that take part in the modification of the chip of communication and that has to take into account to the hour to make the proofs.
Said parameters take part directly in the maximum distance of communication of the modules and that have to configure of such form that fulfil the requirements of design and the possible maximum distance that can obtain . According to the data observed in the table 16 establish the data configurables by software the following: SF (Factor of spectrum widened or of scope) = 12 BW (Bandwidth) = 41.7 CR (Tax of coding of errors) = 4/5 The configuration selected ensures the maximum effectiveness in the transmission of the data, but involves that it spends more time in the process of coding of the same, which does not affect in the process due to the fact that the time of reading of the sensors is of 60 seconds.
It selects this configuration because it is the one who presents the best values of current and power of transmission and reception without that they have lost of packages of data sent to comparison of the configuration of the line 10 (Table 16) that presents the best values of power of transmission but the stability of the signal is not very good since they lose packages of data in the transmission and reception of the same. By such reason selects the configuration posed to the start.

Proofs with obstacles (indoor)
The proofs make carrying the module of visualizations connected to a battery and in state of operation displaces by the streets expecting obtain the greater distance of communication between the two modules.
For this proof connects the modulate to the PC to verify the tax of sent of data between the modules and verify the maximum distance to which receive said data. To obtain the maximum distance indoor takes the measure that launches the application maps and decompose the planes x-and with the measure of the maximum height to which finds the station of measurement. The maximum distance between the modules obtain it using the theorem of Pitágoras (1). In it formulates it we enter the values of the height of the building and the maximum distance of plant that obtained in the measurement. (2) 1 = √(9.5 2 + 145.8 2 ) (3) 1 = 146.11 (4) The maximum distance obtained for applications of communication (indoor) with the modules Arduino LoRa SX1278 TTGO is of 146.11 meters. After this distance the packages of data begin to lose or take much more time of the expected what indicates us that this is the recommended distance to use said modules of communication. The proofs of maximum scope on line of sight limit to the distance that observes in the figure since it was not possible to situate a zone cleared to greater distance and of easy access, due to the fact that the majority of the terrains neighboring are of private property and in the directions in where it can observe the main roads of access are hindering the principal condition of the proof that is to line of sight between the devices.

Proofs with line of sight (outdoor)
The data that obtain to this distance fulfil in the whole with the parameters established by software for the configuration of each one of the modules and is possible that can reach a bigger distance with the same parameters without that there is loss of data, which leaves posed for future essays and proofs of laboratory. (2) 2 = √(15 2 + 585.8 2 ) (3) 2 = 586 (4)

Proofs of Measurement With Regard To Team Of Reference
It treated to obtain the data of the environmental stations surrounding of entities of the state to the places of the proofs, but was not possible. The environmental stations that have the public information did not find near to the places of the proofs, even to heights very distant what did that the error of comparison was very big and was not a conclusive proof. Because of this used a team certified by laboratory accredited by the National Organism of Accreditation of Colombia (ONAC) like reference for the proofs of comparison what ensures a traceability to national and international patterns in each variable. Although it does not treat of a calibration since for this requires of some environmental conditions uniforms for the proof if it obtained an error of the proofs what allowed an adjust in the measurement of the team to approach us to the measurement that obtained of the team of reference.
The team used is a mini environmental station mark Kestrel Instruments reference 5000 serial 2355316 of the which did proofs in temperature, relative humidity and atmospheric pressure, the 3 variables find calibrated and certificates by the laboratory accredited Conamet with the following respective reports CLT 151120, CLH40820, CLP 67620. The respective accreditation of the laboratory can be consulted in the page of the ONAC in the section of laboratories of calibration accredited in the following link: http://onac.org.co/certificados/09-lac-008.pdf

Resulted Errors Comparison Measurement Of the measurements
Obtained calculated a minute-by-minute error between each variable measured by the team Kestrel 5000 and the environmental station, and these 61 errors calculations for each variable took out an average, to obtain the results of measurement.

Source: Authors in Excel
As it observes in the figure obtain an error in temperature of 0.5°C, 1.267 % in Relative Humidity and 0.002 hPa in Atmospheric Pressure, which are data quite near to the station of reference, by what the station of Measurement guarantees some correct measurements, these data even can be improved with an adjust finer that for the request of the station is not necessary.

Conclusion
It developed a system of measurement of 3 different sensors for the measurement of environmental conditions, temperature, relative humidity and atmospheric pressure. Composed by electronic systems of control Raspberry Pi and Arduino adapted to the system and in a setting of tripod in which they had all the systems, with an autonomous feeding by means of a solar signpost and a battery of backrest, this establishes communication by radiofrequencies by means of modules Lora that allowed us a communication of 586 m stable without obstacles with the station of visualization in which they can be observed the minute-by-minute measurements by means of a table and charts in an included screen in the system, all made in language Python.
With the setting made of the solar signpost of 40 W according to the calculations of feeding obtained an autonomy 24/7 that requires for the operation and communication of the sensors during all the time of operation as long as the battery find in good conditions so that it allow the complete load of this.
The communication remained stable in a distance of 146 m with obstacles with a low percentage of stray of data, this because of the big quantity of buildings and possible interferences of signal what hampers to follow increasing the distance without having effects in the stable communication. Even so, the quantity of stray data are very low with regard to the big quantity of data that transmits since this transmits each min registered and is the sufficient functional mind for a station of measurement since for these allows a register of each 5 min.
The programming transmits each data measured taken of a database stored in the station of visualization and handled like independent variables what allows to keep the value of each measurement without affectation or changes and without limit of characters of the values measured, something that in a principle presented inconvenient of limit of quantity of characters when transmitting all the measurements of an hour specifies stored what forced to make operations of divisions affecting the values of the measurements transmitted to reduce characters.
The costs were a bit higher of the initially budgeted as it had to consider purchase the modules lora with his systems of antennas and include a regulator of solar signpost of equal form increased the power of the solar signpost by what the value of east increased, however, in spite of this the cost of the complete team keeps on being much more economic that a commercial environmental station.