The sun emits energy over a broad spectrum of wavelengths: visible light, infrared radiation generating heat, and UV (ultraviolet) radiation hidden from our senses. Although UV radiation affects our health positively in moderation, such as instigating the production of vitamin D, sun damage is mostly engendered by overexposure to UV radiation since it has a higher frequency and lower wavelength than visible light.
The UV region covers the wavelength range of 100-400 nm and is divided into three bands:
- UVA (315-400 nm)
- UVB (280-315 nm)
- UVC (100-280 nm)
After perusing recent research papers on UV radiation, I decided to utilize UV index (UVI), temperature, pressure, and altitude measurements denoting the amount of UV radiation from the sun so as to create a budget-friendly BLE smartwatch to forecast sun damage risk levels in the hope of prewarning the user, especially risk groups, of potential sun damage risk to avert severe health conditions related to excess sun exposure, such as immune system damage and melanoma (skin cancer).
The ultraviolet index (UV index) is an international standard measurement of the strength of the sunburn-producing UV (ultraviolet) radiation. In other words, the UV index forecasts the strength of the sun’s harmful rays. Since it is designed as an open-ended linear scale, directly proportional to the intensity of UV radiation, the higher the number, the greater the chance of sun damage. An increase in the UV index value corresponds to a constant decrease in time to sunburn. Therefore, higher values represent a greater risk of sunburn and excess UV radiation exposure.
Even though UV index, temperature, pressure, and altitude measurements provide insight into detecting sun damage, it is not possible to extrapolate and construe sun damage risk levels precisely by merely employing limited data without applying complex algorithms since sun damage risk levels fluctuate according to various phenomena, some of which are not fully fathomed yet. Hence, I decided to build and train an artificial neural network model by utilizing the empirically assigned sun damage risk classes to forecast sun damage risk levels based on UV index, temperature, pressure, and altitude measurements.
Since XIAO BLE (nRF52840) is an ultra-small size Bluetooth development board that can easily collect data and run my neural netwrok model after being trained to forecast sun damage risk levels, I decided to employ XIAO BLE in this wearable smartwatch project. To obtain the required measurements to train my model, I utilized a UV sensor (Grove) and a BMP180 precision sensor. Since the XIAO expansion board provides various prototyping options and built-in peripherals such as an SSD1306 OLED display and a MicroSD card module, I use the expansion board to make rigid connections between XIAO BLE and the sensors.
Since the expansion board supports reading and writing information from/to files on an SD card, I stored the collected data in a CSV file on the SD card to create a data set. In this regard, I was able to save data packets via XIAO BLE without requiring any additional procedures.
After completing my data set, I built my artificial neural network model (ANN) with Edge Impulse to make predictions on sun damage risk levels (classes) based on UV index, temperature, pressure, and altitude measurements. Since Edge Impulse is nearly compatible with all microcontrollers and development boards, I had not encountered any issues while uploading and running my model on XIAO BLE. As labels, I employed the empirically assigned sun damage risk classes for each data record while collecting data outdoors:
After training and testing my neural network model, I deployed and uploaded the model on XIAO BLE. Therefore, the smartwatch is capable of detecting precise sun damage risk levels (classes) by running the model independently. Also, after running the model successfully, I employed XIAO BLE to transmit (advertise)...Read more »