For many years there has been a growing concern that anthropogenic damage to the Earth's stratospheric ozone layer will lead to an increase of solar ultraviolet (UV) radiation reaching the Earth's surface, with a consequent adverse impact on human health. UV-related diseases, especially skin cancer, are causing problems on public well-being around the world, as well as resulting in high and increasing healthcare costs. Ozone depletion and climate change are aggravating this situation, Temperature changes and an increasing number of cloudless, sunny days not only result in heatwaves and droughts but are also exposing humans to higher levels of solar UV radiation. The risk of developing skin cancer is increasing.
The solution implements an UV radiation exposure monitoring system to assist in the prevention of diseases caused by over exposition to solar UV radiation through warning messages with preventive regarding the monitored exposure level.
It can act either as a remote sensor unit or as personal dosimeter, continuously measuring the UV index and other environmental parameters (humidity, temperature) which also may influence/enhance the injurious effect of ultraviolet radiation. It can calculate the actual individual risk for individuals in the monitored area or for the person wearing it. The resulting data can be used to issue categorized advisory messages for preventive measures (e.g., apply sunscreen, wearing protective clothes, limit exposure time etc.).
The Wio Terminal connected to the appropriate sensors (UV radiation, temperature, humidity, etc.) can be used to collect and process the regarded environmental data. The display can be used to show the aggregated data, risk analysis and protection advice to the user. Additionally, obtained and aggregated data could be transmitted (e.g., via Wi-Fi, LoRaWAN etc.) to an edge gateway device or a cloud service for long time data recording, evaluation and visualization.
This project describes a simple prototype to
- measure and visualize UV radiation, temperature, humidity,
- calculate and display the actual risk category derived from the measurement and to
- upload the collected data to an IoT cloud platform (e.g., ThingSpeak or Ubidots) either via Wi-Fi or LoRaWAN.
Cheap devices based on this prototype, enhanced by appropriate casing, a battery and solar powered, could be placed at public places (e.g. cities, hotels, beaches) to inform people of the local risk of UV radiation exposure and to collect more data for web based public warning systems and/or environmental research.
Bill of materialsHardware- Seeed Studio Wio Terminal
- Grove - I2C UV Sensor (VEML6070)
- BME280 (humidity sensor measuring relative humidity, barometric pressure and ambient temperature) breakout (e.g., Grove - Barometer Sensor(BME280))
- Grove - I2C Hub
- Grove - Wio-E5
The Wio Terminal is a SAMD51-based microcontroller with Wireless Connectivity powered by Realtek RTL8720DN that’s compatible with Arduino and MicroPython. Currently, wireless connectivity is only supported by Arduino. It runs at 120MHz (Boost up to 200MHz), 4MB External Flash and 192KB RAM. It supports both Bluetooth and Wi-Fi providing backbone for IoT projects. The Wio Terminal itself is equipped with a 2.4” LCD Screen, onboard IMU(LIS3DHTR), Microphone, Buzzer, microSD card slot, Light sensor, and Infrared Emitter(IR 940nm). On top of that, it also has two multifunctional Grove ports for Grove Ecosystem and 40 Raspberry pi compatible pin GPIO for more add-ons.
Features:
- Highly Integrated Design: MCU, LCD, WIFI, BT, IMU, Microphone, Speaker, microSD Card, Light Sensor, 5-Way Switch, Infrared Emitter (IR 940nm), Crypto-authentication Ready
- Powered by Microchip ATSAMD51P19: ARM Cortex-M4F core running at 120MHz(Boost up to 200MHz) and 4 MB External Flash, 192 KB RAM
- Comprehensive Protocol Support: SPI, I2C, I2S, ADC, DAC, PWM, UART(Serial)
- Powerful Wireless Connectivity (supported only by Arduino) powered by Realtek RTL8720DN: Dual Band 2.4Ghz / 5Ghz Wi-Fi (802.11 a/b/g/n) and BLE / BLE 5.0
- USB OTG Support: USB Host /USB Client
- Grove Ecosystem
- Software Support: Arduino, MicroPython, ArduPy and AT Firmware
For more details see the "Get Started with Wio Terminal" guide.
Grove - I2C UV Sensor (VEML6070)The Grove - I2C UV Sensor(VEML6070) is an advanced ultraviolet (UV) light sensor with I2C protocol interface. Ultraviolet (UV) is electromagnetic radiation with a wavelength from 10 nm to 400 nm, shorter than that of visible light but longer than X-rays, this sensor detects 320-410nm light most effectively, and will converts solar UV light intensity to digital data. See wiki article "Grove - I2C UV Sensor (VEML6070)" for more details.
BME280The BME280 is an integrated environmental sensor by Bosch especially developed for mobile applications and wearables that measures humidity, pressure and temperature providing a comprehensive and holistic measurement of the environment.
An easy choice for using this sensor with the Wio Terminal would be the Grove - Temp&Humi&Barometer Sensor (BME280) (see wiki article "Grove - Barometer Sensor(BME280)" for more details). For this project prototype another breakout board with a Grove-to-female-jumper cable has been used.
Grove - Wio-E5The Wio-E5 is a low-cost, ultra-low power, extremely compact, and high-performance LoRaWAN® Module designed by Seeed Technology Co., Ltd. It contains ST system-level package chip STM32WLE5JC, which is the world first SoC integrated with the combo of LoRa® RF and MCU chip. This module is also embedded with ARM Cortex M4 ultra-low-power MCU and LoRa® SX126X, and therefore supports (G)FSK mode and LoRa®. 62.5kHz, 125kHz, 250kHz, and 500kHz bandwidth can be used in LoRa® mode, making it suitable for the design of various IoT nodes, supporting EU868 and US915.
The Grove Wio-E5 board is equipped with a Grove connector.
See the Seed wiki entries for the Grove Wio-E5 board and for the Wio-E5 STM32WLE5JC Module for more details.
Software / Libraries / Services- Arduino IDE
- LvGL Graphics Library for Wio Terminal
- Adafruit VEML6070 Library
- Adafruit BME280 Library
- Seed Arduino rpcWiFi (and the dependencies Seed Arduino rpcUnified, Seed Arduino mbedtls, Seed Arduino FS & Seed Arduino SFUD) for Wi-Fi connectivity
- Disk91 - LoRaE5 library for LoRaWAN connectivity
- ThingSpeak
- Helium Console
- Ubidots
The LvGL (Light and Versatile Graphics Library) is an open-source graphics library providing everything you need to create embedded GUI with easy-to-use graphical elements, beautiful visual effects and low memory footprint. For instructions on how to use LvGL for Wio Terminal refer to this guide.
Disk91 - LoRaE5 libraryThis Arduino library is making LoRa-E5 development much easier.
ThingSpeak"ThingSpeak is an IoT analytics platform service that allows you to aggregate, visualize and analyze live data streams in the cloud. ThingSpeak provides instant visualizations of data posted by your devices to ThingSpeak. With the ability to execute MATLAB® code in ThingSpeak you can perform online analysis and processing of the data as it comes in. ThingSpeak is often used for prototyping and proof of concept IoT systems that require analytics."
Helium"Helium is a global, distributed network of Hotspots that create public, long-range wireless coverage for LoRaWAN-enabled IoT devices. Hotspots produce and are compensated in HNT, the native cryptocurrency of the Helium blockchain. The Helium blockchain is a new, open source, public blockchain created entirely to incentivize the creation of physical, decentralized wireless networks. Today, the Helium blockchain, and its hundreds of thousands of Hotspots, provide access to the largest LoRaWAN Network in the world."
The Helium Console is a web-based device management tool hosted by the Helium Foundation that allows developers to register, authenticate, and manage their devices on the Helium network. In addition to device management, Console provides prebuilt connections called Integrations to route device data via HTTPs or MQTT; or directly to cloud services like AWS IoT.
Console is available as a free to use hosted application for demo and educational purposes (up to 10 devices) at console.helium.com."
For more details see the documentation.
UbidotsUbidots is an IoT application development platform that automates the process of IoT application creation allowing developers to rapidly assemble and launch those applications without code writing or software development. Sign-up is free of charge and Ubidots offers a free plan - Ubidots STEM - with limited features and capacity for non-commercial use only (personal education, IoT research, or DIY projects).
Ubidots and Helium have partnered to create a pre-built integration allowing users to easily forward sensor data from Helium Console to Ubidots using Plugins.
Additional components- Wires
For implementing this projects the following prerequisites need to be fulfilled:
- All hardware components as listed above are available and at hand. (Grove Wio-5 is only needed if telemetry via LoRa/LoRaWAN is used.)
- The Arduino IDE has been installed and configured for the Wio Terminal as described here.
- All of the libraries listed above have been added to the Arduino IDE (Sketch -> Include Library -> Manage Libraries / Add.ZIP Library)
- User accounts for all services to be used are available or have been created.
For Grove sensor boards, just connect both sensor (via hub) to the Grove I2C Port on Wio Terminal, for other sensor boards connect VIN, GND, SCL and SDA accordingly, see wiring diagram for details.
Ultraviolet (UV) "light" is a form of electromagnetic radiation with wavelength from 200 nm to 400 nm, shorter than that of visible light (400 nm to 750 nm), but longer than X-rays. UV radiation is present in sunlight and constitutes about 10% of the total electromagnetic radiation output from the Sun. Short-wave ultraviolet light can damage DNA and sterilize surfaces with which it comes into contact. For humans, suntan and sunburn are familiar effects of exposure of the skin to UV light, along with an increased risk of skin cancer. UV radiation is divided into three bands of wavelength:
- UVA (315-400 nm)
- UVB (280-315 nm)
- UVC (100-280 nm).
Through absorption of the earth's atmosphere in the ozone layer, the UVC spectrum is completely blocked and the solar radiation in the UVB spectrum does barely reach the earth's surface. The less dangerous UVA radiation is far less absorbed by the atmosphere. UVA radiation is less powerful than UVB radiation, but highly penetrating. It can reach the skin and is responsible for photoaging and the onset of different forms of skin cancer
UV radiation intensity is measured in micro-watts per square-centimeter (μW / cm²). The VEML6070 sensor measures radiation in a spectrum from 300 nm to 400 nm, so it can only detect UVA radiation.
In order to estimate the energy behind UV radiation and the risk level associated with it, the UV Index was established. The UV Index describes the expected daily peak level of the erythemal UV irradiance at ground level.
Its an open-top linear scale - 0 to ≥ 11, giving guideline values for the UV irradiance. The higher the UV Index, the higher the UV irradiance and the faster / the more severe a sunburn can occur when skin is not protected.
The UV Index has been defined by the WHO and is uniform worldwide - e.g., a UV Index of 7 in Europe means exactly the same as the same value in Africa or North America.
Since deriving the UV index directly from the irradiance measured by the sensor requires a quite complex calculation, weighted according to a curve and integrated over the whole spectrum, the Designing the VEML6070 UV Light Sensor Into Applications guide by Vishay Semiconductors proposes to estimate the energy behind UV radiation and the risk level associated with it, by simply reading out the irradiance value from the VEML6070 sensor and comparing it with pre-defined values.
This leads to the following function to derive UV index and risk level from the VEML6070 readings: uv_index().
GUIThe environmental measurements obtained by the two sensors
- Temperature
- Humidity
- Pressure
- UV irradiance
- and the estimated UV index. are displayed as numerical values.
The derived risk level is displayed as a line meter, changing its background color accordingly matching the colors of the UV Index scale, and the risk category (low, moderate, high, very high and extreme) as text.
The measurements can be transferred to a cloud service for collecting, recording, visualization and/or further analysis.
Two example options are described in this project:
- Communication via Wi-Fi and transfer to ThingSpeak and
- communication via LoRaWAN and the Helium network to visualize the data with Ubidots.
In this example the measurement values are uploaded to a ThingSpeak channel via a simple HTTP GET request to the ThingSpeak API
GET https://api.thingspeak.com/update?api_key=<api key>&field1=<temperature>&field2=<humidity>&field3=<uv>&field4=<uv index>
using the Write API Key
for the channel.
Since the built-in Wi-Fi capabilities of the Wio Terminal are used no additional hardware is needed for this option. The topic Wi-Fi connectivity with the Wio Terminal is described in detail in the corresponding Seed Wiki page.
This option is activated by defining the two macros TELEMETRY
and TELEMETRY_WIFI_THINGSPEAK
in WioTerminalUvSmartMeter.ino
For more details refer to the source file Telemetry_WiFi_ThingSpeak.ino in the code section and the ThingSpeak documentation.
For using LoRa/LoRaWAN connectivity the Wio-E5 board has to be connected to the Wio Terminal: see wiring diagram.
The code in Telemetry_LoRaWAN_Helium.ino is adopted from the example/tutorial for sending data obtained from the Wio Terminal Light Sensor using the Grove - Wio-E5.
To "activate" this module the two macros TELEMETRY
and TELEMETRY_LORAWAN_HELIUM
have to be defined in WioTerminalUvSmartMeter.ino:
/* TELEMETRY
*/
#define TELEMETRY
#define TELEMETRY_LORAWAN_HELIUM
#define TELEMETRY_REPORT_UVI_CHANGES_ONLY
#define TELEMETRY_UPDATE_TIME 600
The macro TELEMETRY_UPDATE_CYCLE
controlling the send interval should be set to a reasonable value (in seconds) to avoid "burning" DCs unnecessarily. If only the UV index changes are of interest, setting the macro TELEMETRY_REPORT_UVI_CHANGES_ONLY
will cause the module to cease from sending data, if the UV index did not change since last transmission.
The network and integration setup of this option mainly follows the instructions in the Helium Introduction the Connecting to Helium guide in the Seed Studio wiki.
The main steps are:
- Register for a Helium account.
- Add / create a new device and configure the Telemetry_LoRaWAN_Helium.ino sketch accordingly (frequency appropriate for the region in which the device is used / device identification and key.
- Add a decoder function to transform and/or parse the raw payload.
- Add an integration for Ubidots using the Helium Ubidot plugin.
- Create a flow connecting the device via the decoder function to the integration.
The following device properties auto generated by the Helium Console a new device has been created -
- Device EUI - 64-bit end-device identifier, sometimes called Manufacturer EUI
- App EUI - 64-bit application identifier
- App Key - 128-bit AES key, used to secure communication between device and network
#define Frequency DSKLORAE5_ZONE_EU868
char deveui[] = "6081F97A6178DA10";
char appeui[] = "6081F96DD5894DAA";
char appkey[] = "77D92AAE47B8B686B41707A3E9301CA3";
Device data transmission can be verified using the debug view in the Helium Console
The decoder function matching the encoding implemented in Telemetry_LoRaWAN_Helium.ino can be defined as follows: function Decoder(bytes, port, uplink_info) {...}
After configuring the integration with the Helium Ubidots plugin
and creating the flow
data from the device
can be used in Ubidots to visualize the sensor readings in a dashboard:
On a very sunny (and warm) Sunday afternoon tests have been performed with the setting RSET = 270 kΩ; IT = 4T.
In the browser window the official readings (UV index 3) from a nearby public weather station published by the "Office for Radiation Protection" is shown.
The UV index shown on the devices was changing between 3 and 4:
Test and demo of telemetry option #2, indoors with an UV lamp (an uncovered halogen light bulb emitting UVA/UVB light, dimmable ):
Power consumptionPower consumption has been measured during tests for telemetry option #2 as follows:
- normal operation: 118 mA
- during transmission (LoRa/Helium): 138 mA
Comments