How to Implement a Suntan Monitor Design

GreenPAK Blog
5 min readMay 2, 2024

A suntan is important for the human body as it facilitates the production of vitamin D. Additionally, sunlight has an antibacterial effect. But it can also harm the body when someone stays in the sunlight for a long period of time.

Introduction

This article explains how to use SLG47513 to implement a suntan monitor to control ultraviolet radiation and prevent its negative effect.

We created this project in Go Configure™ Software Hub. The complete design file can be found at AN-CM-343 Suntan Monitor.gp6. More application notes here.

Sunbeams are electromagnetic oscillations of different wavelengths. On the electromagnetic spectrum, UV light has shorter wavelengths than visible light, so the eyes can’t see UV, but the skin can feel it (see Figure 1).

Figure 1. Ultraviolet Light Spectrum

Image Source: Khan, Sulaiman, et al. “Gas Detection Using Portable Deep-UV Absorption Spectrophotometry: A Review.” Sensors, vol. 19, no. 23, 28 Nov. 2019, p. 5210, 10.3390/s19235210. Accessed 18 May 2020.

UVA — the most common UV ray from the sun and the most dangerous; UVA can penetrate the skin down to the middle layer.

UVB — a shorter wavelength than UVA that can only penetrate the skin to the top layer. Some UVB rays are stopped by the Earth’s ozone layer; also, they can be stopped by the treated glass.

UVC — all UVC rays from the sun are stopped by the ozone layer; therefore, the only exposure humans get to UVC is from artificial sources such as lasers or welding torches.

It follows that to minimize the risk of ultraviolet light, there is a need to limit the exposure of UVB and UVA radiation to the body. A UV photodiode with a respective spectral detection range can be used to measure the degree of exposure.

In this application a cheap UV Photodiode GUVA-S12SD with short-circuit current Isc=125 ns was used. Please note that for good performance a photodiode with a large photocell area and high photocurrent must be used. This eliminates the effect of leakage current.

The task is to inform a sunbather when to turn over (or to go home) after having received the desired accumulated dose of sunlight, using a photodiode’s current (which is proportional to suntanning intensity) as an input.

GreenPAK Design

In this project the SLG47513 was used. Its main feature is a low operation voltage (from 1.0 V to 1.65 V) that allows to power a project from a 1.5 V battery or even a solar cell. Furthermore, the measured current consumption of the device is maximum 30 μA, which ensures the long-term operation from the battery.

The idea is to use the photocurrent to ramp the voltage on a capacitor, then use an analog comparator to trigger a short discharge pulse on an open-drain digital output pin. This generates a sawtooth, which frequency is proportional to the light intensity. A counter integrates this by simply counting cycles and causing the sounding of the buzzer when the counter reaches its counter data.

Figure 2 shows the basic idea of that design on the SLG47513 and Figure 3 shows an internal design of the project in GreenPAK Designer software.

Figure 2. Basic Design of Suntan Monitor Based on SLG47513
Figure 3 GreenPAK Designer Schematic

The ACMP0 output signal is too short (around 80 ns) and it causes an unstable response. To eliminate this a One Shot with an inverting output was used to form a signal with a duration of 1 μs and a correct polarity. A DFF is designed to latch the One Shot’s output signal. The DFF output signal has twice the input signal frequency.

After debugging, a capacitor value of C = 220 pF was selected. Please note that a capacitor with low leakage (film capacitor or NP0 ceramic capacitor) must be used.

The measured positive-going ramp signal is V = 0.2 V and the sawtooth frequency at maximum photodiode current is:

CNT0 and CNT1 are designed to set 30 min full-sunlight equivalent dose. When a person is in the sun for 30 minutes at maximum light intensity a piezo buzzer beeps. It follows that the counters should count to (2840/2) * 30 *60 = 2556000. Counter blocks can be chained together for a longer counted time. In this case, 16-bit CNT0 data was set to its maximum value of 65535, and 8-bit CNT1 data should be equal to:

CNT1 data = 2556000/65535 = 39

The second One Shot provides a signal sound for a minute as a short beep may be missed. A short beep sounds when the device wakes from sleep mode (after pressing a button).

Waveforms for the suntan monitor are shown in Figure 4 and Figure 5 (at temperate climate and around June solstice).

Figure 4. Suntan Monitor Waveforms in Hazy Sunlight
Figure 5. Suntan Monitor Waveforms in Intense Sunlight

To turn on the device, instead of dimensional toggle switches, a miniature button was used. The button allows to switch between two modes: working mode and sleep mode. In the second mode, all analog blocks are disabled and the device consumes little power. However, OSC0 couldn’t be disabled because it must be used as a clock signal for debounce delay. But it is not an issue because OSC0 consumes only about 1 μA.

Project Simulation

The project was simulated in GreenPAK Designer Software Simulation Tool. 10 nA current source was used instead of UV photodiode because there is no photodiode model in the software. Figure 6 shows waveforms for the sawtooth generator part of the project. The current source eliminates the distortion caused by some features of photodiodes.

Figure 6. Simulation Waveforms of Sawtooth Generator Part of the Project (with 10 nA Current Source)

Conclusions

The SLG47513 is a low voltage GreenPAK IC. Low voltage operation allows supplying a project from just one 1.5 V battery and a sufficient number of digital and analog macrocells allows the implementation of myriad useful applications. In this article, these qualities were demonstrated in the example of the suntan monitor, where a combination of analog and digital blocks allowed to evaluate the level of ultraviolet exposure and prevent its negative effect on the skin. Low supply voltage makes it possible to power a device even from a solar battery, which makes the device even more energy efficient.

--

--