Portable Environmental Monitoring Device 1 Version

by Armando LeonardoS in Circuits > Gadgets

16 Views, 0 Favorites, 0 Comments

Portable Environmental Monitoring Device 1 Version

imagem1.png
Imagem (2).png

With increasing health concerns, especially regarding skin, outdoor activities increasingly require constant monitoring.

To help people who engage in this type of leisure, I designed a portable device that would monitor ultraviolet rays, ambient temperature, humidity, and atmospheric pressure, keeping the user aware of the conditions surrounding their enjoyable activity and using the necessary skin protection and hydration products.

Since these activities often take place in places where we don't have access to cell phone networks, I considered including a GPS, which displays the date, time, latitude, longitude, and altitude.

This makes the device useful for mountaineers, hikers, runners, hikers, and others.

The device has not been assembled, but all bench tests have been successfully completed.

The computing base is an ESP32. In my case, I used an ESP32-S.

Programming was done in the Arduino IDE.


Supplies

In addition to the ESP32, the following components were used:

a) GPS-NEO6MV2 - GPS module based on the NEO-6M module, capable of identifying global location via satellite (GPS) and reporting it via simple RS232 TTL (UART) communication. Operating voltage: 3.3 VDC; standard speed: 9600 Baud Rate; 50 channels; sensitivity: -146 dBm to -160 dBm; maximum altitude: 164,042 ft (50 km); maximum speed: 500 m/s.

b) Generic Ultraviolet Sensor - Developed for use with microcontroller systems, especially the Arduino and Raspberry Pi, demonstrating wide applicability and excellent results. It operates with voltages from 3.3V to 5V, sending analog signals to the microcontroller, varying its output voltage according to the level of UV rays detected. Output Voltage: DC 0-1 V; Accuracy: 1 UV INDEX; Response Wavelength: 200nm-370nm.

c) BME280 Pressure Sensor - Measures atmospheric pressure, humidity, and temperature, also known as a barometer. High-capacity and high-resolution digital module. Supply voltage: 1.8 - 3.3V DC. Interface: I2C (up to 3.4MHz), SPI (up to 10MHz). Measurement ranges: Temperature: -40 to +85°C. Humidity: 0-100%. Pressure: 300-1100 hPa. Accuracy: Temperature: +-1°C. Humidity: +-3%. Pressure: +-1Pa

d) 128x64 Pixel Blue OLED Display, 1.3 Inch, 4 I2C Pins.

e) 2 Push Buttons.

f) 1 CR2032 Battery Holder or 1 3.7V Rechargeable Lithium Battery.

g) TP4056 Lithium Battery Charger Module with Protection (If using a 3.7V rechargeable battery)

h) 1 10K resistor.

i) female-to-female jumper cables.

Circuit Assembly

esquema DPMAv1.jpg

As shown in the attached figure.

The UV module is connected to the Rx and Tx pins of the ESP32.

The BMe280 sensor and the OLED display are connected to pins IO21 for the SDA port and IO22 for the SCL port.

The UV sensor is connected to pin IO02.

The pushbuttons are connected to pins IO18 and IO19, as well as GND.

The positive output of the battery is connected to a 10K resistor, which in turn is connected to the VIN and IO34 pins of the ESP32.

The battery charger is connected directly to the battery.

Writing the Software.

Nova Imagem (8).png

As mentioned previously, the Arduino IDE was used.

The software structure is divided into six functions, in addition to the Setup and Loop functions: medUV (to measure the intensity of ultraviolet rays); GPS (for date, time, and geographic location information); medTPU (to measure temperature, humidity, and atmospheric pressure); DataHora (to indicate the local time and the day of the month and week); Menu (for navigating between functions); and gpsLoop (to check the GPS signal).

The loop() function calls the gpsLoop() function to check the GPS signal, the Menu() function to enable navigation, and a switch to access the functions.

The home screen is always the medUV() function.

I have attached the files for uploading to the ESP32.

Downloads

GpsLoop() and Menu() Functions.

The gpsLoop() function reads the GPS signal received by the antenna.

The Menu() function enables the navigation and selection buttons. The navigation button opens the other functions of the device, and the selection button returns the device to the home screen.

Downloads

MedUV() Function

DPMA1-UV.jpg
UVAlto.PNG
UVModerado.PNG
UVBaixo.PNG
UVExtremo.PNG
UVMAlto.PNG

The medUV function is the device's main screen, where it displays the intensity of ultraviolet rays.

As you know, the most well-known solar radiation is the visible range. However, two other very important ranges are ultraviolet (UV) and infrared (IR). The ultraviolet range is more energetic than light (it has a shorter wavelength) and therefore penetrates the skin more deeply, causing burns when exposed to solar radiation for too long. The Ultraviolet Index (UVI) is a measure of the intensity of ultraviolet (UV) radiation incident on the Earth's surface and relevant to its effects on human skin. The UVI represents the maximum daily value of ultraviolet radiation, that is, during the period corresponding to solar noon, the time of maximum solar radiation intensity. The UVI is always displayed for clear sky conditions, that is, for the absence of clouds, which, in most cases, represents the maximum radiation intensity. This index is presented as an integer. According to the World Health Organization (WHO), UVI is grouped according to its intensity and duration of sun exposure. The ultraviolet index (UVI) categories are: Low (<2), Moderate (3 to 5), High (6 to 7), Very High (8 to 10), and Extreme (>11).

The UV sensor used in this project measures a wavelength range from 200 to 370nm, with an analog output of 0 to 1V, or 0 to 1000mV. Therefore, comparing the distribution of values received by the sensor and the UVI scale, we obtain:

a) Values below 226mV, UVI=0;

b) Values between 227 and 317mV, UVI=1;

c) Values between 318 and 407mV, UVI=2;

d) Values between 408 and 502mV, UVI=3;

e) Values between 503 and 605 mV, UVI=4;

f) Values between 606 and 695 mV, UVI=5;

g) Values between 696 and 794 mV, UVI=6;

h) Values between 795 and 880 mV, UVI=7;

i) Values between 881 and 975 mV, UVI=8;

j) Values between 976 and 1078 mV, UVI=9;

k) Values above 1079 mV, UVI=10 and 11.

For the iconic characterization of the UVI, icons were established with the drawing of the sun, with various expressions, as shown in the attached figures, and the initial letters of the categories, in Portuguese.

Thus, on the main screen, we have the UVI classification by number, on the left, and the representation by icon on the right.

At the top we have the representation, from left to right, of the battery percentage, the battery icon and the number of Volts remaining.

The icons were made with the help of the website: https://javl.github.io/image2cpp/

Downloads

MedTPU() Function

DPMA1-TUP.jpg

This function measures temperature, humidity, and local atmospheric pressure. The information is displayed as shown in the attached image.

The Esp32 reads the information directly from the BME280 sensor.

It should be noted that using this information, the user can anticipate the arrival of rain or storms. A gradual drop in atmospheric pressure can be a sign that a cold front or storm is approaching. This, combined with rising temperatures, increases water evaporation, which can lead to higher humidity and an increased likelihood of rain. To accurately predict rain, it must be accompanied by other signals, such as cloud formation, wind, etc. However, the device is very useful, especially on trails in areas with dense vegetation.

Downloads

DateTime() Function

DPMA1-HoraData.jpg

The DateTime function provides information captured by the GPS module.

This information includes:

a) Greenwich Meridian Time, which is converted to a local date and the day of the week is also calculated. The calculations for the local date and days of the week are described in the .INO file, but basically, the longitude is divided by 15 degrees. Every 15 degrees from Greenwich Mean Time (GMT) is 1 hour ahead or behind. Leap years are also considered in the calculation. The days of the week depend on the date and are described in Portuguese.

b) Greenwich Meridian Time, converted to local time, is displayed in hours, minutes, and seconds. It is also calculated by observing the 15 degrees of longitude per hour.

c) The number of connected satellites is shown in the upper right corner by a satellite icon and a quantitative number. If there is no connection with at least 3 satellites, the message "No GPS Connection" will appear in Portuguese, or the information will be reset.

Downloads

GPS() Function

DPMA1-GPS.jpg

The GPS function provides the device's latitude, longitude, and altitude in meters.

The function takes the values directly from the GPS module and adds a negative sign if the latitude or longitude is west of the Greenwich meridian. The function then displays a letter representing the cardinal points.

The number of connected satellites is displayed in the upper right corner with a satellite icon and a quantitative number. If there is no connection to at least three satellites, the message "No GPS Connection" appears.

Downloads

Structure.

imagem1.png
Imagem (4).png
Imagem (5).png
Imagem (6).png
Imagem (7).png
Imagem (2).png
Imagem (3).png

The structure was designed in FreeCAD and strives for maximum portability.

It is a rectangular object measuring 13cm x 5cm. It is easy to handle and can be carried in a small waist bag.

The connections between the components are made using female-to-female jumper cables.

The electronic components must be glued directly to the structure, partly on the body and partly on the lid.

The structure is divided into a body and lid, and there are two versions of the body: one for those who want to use a CR2032 battery and another for those who want to use a rechargeable 3.7V lithium battery.

The parts are available for 3D printing in PLA.

The attached images show the arrangement of the components in the structure.