User Tools

Site Tools


amc:ss2023:group-u:start

This is an old revision of the document!


Portable Weather Station Documentation

Autors: Daniel Jose Centeno Gonzalez & Lorena Garcia Plaza

Introducction

A portable weather station offers portability, accurate data, and enhanced safety. It can be easily transported to different locations, providing precise and localized forecasts. This helps in decision-making for various activities and sectors. The station's portability enables monitoring of essential parameters, alerting users to potential weather hazards in advance. With measurements of temperature, humidity, thermal sensation, wind speed, wind direction, UV index, rain fall and then you can process the data and analyze it. In this documentation, you will find everything about this project.

Fig.: HSRW Portable Weather Station
Fig.: Portable Weather Station Data Visualization

Weather Station Sensors

Measurement Sensor Measurement unit Datasheet
Temperature DHT22 ºC DHT22
Humidity DHT22 RH DHT22
Thermal sensation DHT22 ºC DHT22
Wind Direction Sparkfun Weather station kit (SEN-08942) Cardinal Points SEN-08942
Wind Speed Sparkfun Weather station kit (SEN-08942) m/s SEN-08942
Rain Gauge Sparkfun Weather station kit (SEN-08942) mm SEN-08942
UV index sensor P1918 UV sensor 1-11 P1918 UV sensor

Electric diagram

Fig.: HSRW Portable Weather Station Electric diagram, You can download the pdf diagram Here

Real Time Data Visualization

Fig.: HSRW Web Server Portable Weather Station

Logic Code

The logic of the program is divided into 5 important functions of which 4 of them are in charge of carrying out the measurement and calculation of the different values of each sensor and the last remaining one in the storage of the data in the MicroSD. Separating each function in this way we can create a multiprogramming environment which is extremely important in this type of project that uses many resources at the same time. This will also create a list and proper times of each component. For example, data can be stored in the SD while a user connects to the server. These processes will never be interrupted thanks to the task manager created with the millis() function.

Sensor Readings:

read_Temp_Humi(): This function is responsible for measuring temperature and humidity using the DHT22 sensor. First, the humidity and temperature are read in degrees Celsius. If the reading from any of the sensors is invalid, an error message is displayed on the serial port. In addition to obtaining the measurements, the thermal sensation (heat index) is also calculated using the Steadman formula, which takes humidity into account to estimate how the human body perceives temperature.

getRainfall(): The getRainfall() function takes care of measuring the amount of rain that has fallen. For this, a rain gauge is used, which records the number of times the rain causes a mechanism to activate (in this case, the countRain() function). Each time the mechanism is activated, a counter representing the number of times it has rained is incremented. The getRainfall() function takes the value of the counter and converts it to a rain measurement in millimeters, considering a relationship between the activations and the amount of rain.

UV_WindDir(): This function is responsible for obtaining the intensity of ultraviolet (UV) radiation and the direction of the wind. The ADS1115 module is used to read the analog value of the UV radiation sensor and then this value is mapped to a scale of 0 to 11 to represent the percentage of UV intensity. In addition, the ADS1115 module is also used to measure the analog value of the wind direction sensor. The UV_WindDir() function interprets the read value and determines the wind direction based on predefined ranges for different cardinal directions.

countPulse(): The countPulse() function is responsible for measuring the wind speed using an anemometer. The anemometer is designed to generate pulses when driven by the wind. Each time a pulse is detected, a counter representing the number of pulses generated by the anemometer in a specified time interval is incremented. The loop() function then calculates the wind speed from the number of pulses and a scale factor based on the anemometer's calibration.

Data Logging: Every five minutes, the sensor readings are saved to a CSV file on the SD card. The data includes the timestamp, temperature, humidity, thermal sensation, total rainfall, wind speed, wind direction, and UV intensity.

Raw Code

amc/ss2023/group-u/start.1690142772.txt.gz · Last modified: 2023/07/23 22:06 by daniel-jose.centeno-gonzalez