This is only a preview of the May 2023 issue of Silicon Chip. You can view 57 of the 112 pages in the full issue, including the advertisments. For full access, purchase the issue for $10.00 or subscribe for access to the latest issues. Articles in this series:
Items relevant to "Dual RF Amplifier":
Items relevant to "UVM-30A UV Light Sensor":
Articles in this series:
Items relevant to "GPS-Disciplined Oscillator":
Items relevant to "Wideband Fuel Mixture Display, Pt2":
Items relevant to "Songbird":
Purchase a printed copy of this issue for $11.50. |
Using Electronic Modules with Jim Rowe
UVM-30A Module
Ultraviolet Light Sensor
This ultraviolet (UV) light-sensing ‘breakout’ module detects the intensity
of UV solar radiation and hence the degree of protection you may
need to prevent skin damage. If you connect it to an Arduino or other
microcontroller, it can even indicate the current ‘UV Index’.
P
rotection is critical if you
spend a lot of time outdoors
during daylight hours (sunscreen, hat
etc) to avoid sunburn and to lower your
chances of developing skin cancer.
The UVM-30A analog UV light sensing module is ideal for detecting harmful UV rays and can be used to build
your own UV sensor. It easily connects
to an Arduino or other microcontroller unit (MCU) and with the right firmware, it will indicate the current UV
Index or ‘UVI’. If you’re unsure what
this is, please see the “UV Radiation
and the UV Index” panel.
Sunburn and skin damage are
caused by the UV wavelengths in solar
radiation, which can still be quite
strong even when the sky is overcast.
So checking the UV radiation level is
still important.
UV radiation varies in strength
during the day, just like visible light
and infrared (IR) heat radiation. As
with these other wavelengths, its
intensity tends to follow a bell-shaped
curve, with the peak at the middle of
the day or soon thereafter. So it can
be worthwhile to keep tabs on the UV
radiation level if you are going to be
outdoors, even in the early morning
or late afternoon.
At the heart of the UVM-30A module is a miniature UV sensor called
the GUVA-S12SD. This is in an SMD
package measuring 3.5 × 2.8 × 1.8mm
and is made by Genicom Co Ltd in
South Korea.
Genicom describes it as a schottky-
type gallium nitride photodiode
designed to respond to UV radiation with wavelengths between 240
and 370nm (nanometres). It is also
described as being ‘blind’ to visible
light.
The response curve of the GUVAS12SD sensor is shown in Fig.1. Its
sensitivity is very low at wavelengths
below 240nm, rising steadily to a peak
at 350nm before dropping sharply
between 360nm and around 375nm. So
it has good sensitivity over the UV-B
range from 280nm to 315nm and even
better sensitivity over slightly more
than half of the UV-A range, from
315nm to 365nm.
The vertical units in Fig.1 are microamps per milliwatt of UV radiation.
The Genicom data sheet for the GUVAS12SD lists the typical peak response
of the device as 0.14A/W at 350nm,
equivalent to the peak of the curve
in Fig.1.
The UVM30A module
is comprised
of a larger
PCB (28 ×
12.5mm) and
a smaller PCB
(3.5 × 2.8mm).
The smaller
PCB hosts the
GUVA-S12SD
UV sensor in
a white SMD
package.
Fig.1: the sensitivity of the GUVA-S12SD sensor to light within the UV spectrum.
The x-axis is the light wavelength in nanometres, while the y-axis shows the
microamps conducted per milliwatt of incident radiation at that wavelength.
This indicates that it’s most sensitive to UV-A but will also pick up much of the
UV-B spectrum and some UV-C, at reduced sensitivity.
siliconchip.com.au
Australia's electronics magazine
This image
is shown at
250% actual
size.
May 2023 43
Inside the module
Fig.2: the circuit of the UV sensor module is pretty straightforward. A bias
voltage is applied to the photodiode from the op amp output via a resistor,
converting the current into a voltage that’s fed to the OUT pin. The yellow
box surrounds the components on the sub-PCB; the main PCB just adds a
bypass capacitor and the 3-pin SIL header with two power pins (+ and −)
and the analog output.
As shown in the circuit diagram,
Fig.2, there’s very little in the UVM30A module apart from the GUVAS12SD sensor (PD1), and a small
SGM8521 op amp (IC1) used to convert its output current into a voltage.
The conversion performed by op
amp IC1 conforms to the expression
Vo = 4.3 × 106 × Ipd, where Ipd is the
current passed by PD1 in amps. So a
PD1 current of 280nA should result in
an output of 1.2V.
Most of the circuitry in Fig.2 is
inside a pale yellow rectangle with
a dashed red border because that
part of the module is on a small subPCB mounted on the larger PCB. The
smaller PCB measures only 3.5 ×
2.7mm square, while the larger module
PCB is 28 × 12.5mm. The only components on the larger PCB are a 10μF
supply bypass capacitor and a 3-pin
SIL header.
Connecting it to an MCU
Fig.3: wiring up the module to an Arduino Uno couldn’t be much simpler.
Just connect the module’s + supply pin to its +5V, the module’s – supply pin
to its GND and the module’s output to one of its analog inputs (in this case,
A0, to suit our example sketch).
Fig.4: connecting the UV sensor
module to an Arduino Nano isn’t
much different than the Uno shown
in Fig.3. Once again, the module is
supplied with 5V from the Nano’s
+5V and GND pins while the
module’s analog output signal goes
to the Nano’s A0 analog input.
44
Silicon Chip
Australia's electronics magazine
Since the module has an analog
voltage output and operates from a DC
supply voltage of 3.3V to 5V, it is quite
easy to connect to a microcontroller
such as an Arduino Uno or Nano. You
just need to connect the + and − power
pins to the +5V and GND pins on the
MCU board, while the “OUT” pin goes
to an analog input on the MCU, such
as the A0 analog input, as shown in
Figs.3 & 4.
All that’s needed then is suitable
firmware. After searching the internet,
I found a website with a graph showing the output voltage of the UVM30A
module plotted against the equivalent
UV Index (see siliconchip.au/link/
abi0). I’ve redrawn this as Fig.5.
On the same website, I also found
an Arduino sketch for a UVI sensor,
although this sketch was designed to
display the calculated UVI level using
a Nokia 5110 LCD module.
I adapted this sketch into one that
displays both the module’s output
voltage and the equivalent UVI figure
on a low-cost 16×2 LCD module with
an I2C serial interface (eg, Silicon Chip
Online Shop Cat SC4198).
Fig.6 shows how an Arduino Uno
connects to both the UVM30A module and the LCD with the I2C interface
attached.
The resulting sketch file is called
“Arduino_UVI_meter_sketch.ino” and
is available for download from the Silicon Chip website. When you upload
siliconchip.com.au
Fig.5: the mapping of the output of
the UV sensor to the UV index is
primarily linear, except below a UV
index of one. Therefore, the formula
to convert its output voltage to the
UV index is pretty simple. The sketch
source code (available for download)
shows exactly how it’s down.
Shown at right is the Adafruit version of the UV sensor. It uses the same GUVA-S12SD sensor IC as the Altronics version.
it to the Arduino, it first gives you this
opening display:
Silicon Chip
UVI Meter
Then, after pausing for two seconds,
it starts measuring the output voltage
from the UVM30A module. It converts the reading into the equivalent
UV Index and displays both, like this:
UV Index = 2
Vout = 350mV
It repeats this every 1.5 seconds.
The sketch also sends this data back
to your computer via the Serial Monitor (if you have it connected).
So it is easy to hook the UVM30A
UV sensing module up to an MCU
like the Arduino and make yourself
a handy UVI meter. The sketch could
also be adapted to MMBasic code for
use on a Micromite or Maximite; any
microcontroller with an analog input
should do.
One morning in late October, I took
this arrangement outdoors and got UVI
readings of 1-2 when the Sun was only
about 30° above the horizon.
The readings steadily rose as the
morning wore on (although they
dropped back when clouds obscured
the Sun). When the Sun was directly
overhead and the clouds were not
obscuring it, the UVI readings reached
a level of 8 or 9.
So it appears to be doing its job and
should be helpful for those who spend
a lot of time outdoors. By the way, the
Australian Bureau of Meteorology also
publishes UV Index predictions in
their forecasts.
Of course, they only give a rough
idea of what to expect, whereas this
module provides a reading of the
immediate conditions.
Cost and availability
I obtained the module shown in the
photos from Altronics (catalog code
Z6397) for around $40. But I also discovered a smaller version of the module available from several other suppliers.
This version has the same circuit,
but everything is mounted on a single
PCB measuring only 19 × 10 × 2mm
and seems to originate from the US
firm Adafruit (www.adafruit.com).
Adafruit has it (ID 1918) available
for US$6.50 plus shipping. But it’s
also available from Australian firms
such as Pakronics (www.pakronics.
com.au) for just under $15 plus shipping, or from Digi-Key in the USA for
around the same price.
There is yet another smaller version
available from various suppliers on AliExpress. This one measures 19.8 × 10
× 2mm and is available for around $6
with free shipping. So you have quite
a good range to choose from, all with
the same UV sensor and its surrounding circuit, in various sizes and prices.
continued on page 46
Fig.6: to make a
practical device,
I added a serial
(I2C) 16×2 LCD
module to the basic
circuit, wired as
shown here. That
allows the Arduino
to display both
the raw UV sensor
output voltage and
the equivalent UV
index in a handy
portable package
if the Arduino is
battery-powered.
siliconchip.com.au
May 2023 45
UV Radiation and the UV Index
Ultraviolet or UV radiation is electromagnetic radiation with
wavelengths between 10nm (nanometres) and 400nm –
shorter wavelengths than the light that is visible to humans
but longer than the wavelength of X-rays.
UV radiation constitutes about 10% of the total radiation from our Sun. Still, this radiation is the primary
cause of suntan, sunburn and skin damage resulting in
skin cancers.
The section of the solar UV radiation spectrum primarily
of interest regarding human skin safety is between 100nm
and 400nm. This is subdivided into three main divisions:
UV-A (315nm to 400nm; ‘long wave UV’), UV-B (280nm to
315nm; ‘medium wave UV’) and UV-C (100nm to 280nm;
‘short wave UV’).
Although photons of UV-C radiation carry more energy
than those of UV-B or UV-A and are therefore more capable of skin damage, the good news is that virtually none
of the Sun’s UV-C radiation ever reaches the surface of the
Earth. These photons are absorbed by oxygen and ozone
in our upper atmosphere.
Most of the UV-B radiation from the Sun suffers the same
fate, especially when there is heavy cloud cover.
When there is cloud cover, more than 95% of the solar
UV radiation reaching the surface of the Earth consists
of the longer UV-A wavelength. And these wavelengths
are of concern when it comes to protecting our skin. So
clouds tend to reduce the amount of UV reaching the surface but do not eliminate it; you can still get sunburn on
a cloudy day.
The UV Index is an international measurement scale used
to indicate the intensity of UV radiation in easily understood
terms for the ‘general public’. It uses a scale of 11 or more
steps, with each step corresponding to an increase of UV
radiation intensity of 25mW/m2 (milliwatts per square
metre). A UVI of one indicates a UV intensity of 25mW/m2,
two indicates an intensity of 50mW/m2 and so on.
Fig.7 shows the UV Index on the right and the corresponding UV radiation intensity on the left. The coloured bands
indicate the five categories into which the UVI levels are
grouped in terms of their ‘risk of harm’ to our skin.
SC
Fig.7: this shows
the five ranges of
UV index values
that provide some
guidance as to
the danger of skin
exposure under
those conditions.
It will depend
somewhat on your
skin pigmentation,
but it’s still a good
idea to ‘cover up’
at the upper end of
the risk spectrum.
Raspberry Pi Pico W BackPack
The new Raspberry Pi Pico W provides WiFi functionality, adding
to the long list of features. This easy-to-build device includes a
3.5-inch touchscreen LCD and is programmable in BASIC, C or
MicroPython, making it a good general-purpose controller.
This kit comes with everything needed to build a Pico W BackPack module, including
components for the optional microSD card, IR receiver and stereo audio output.
$85 + Postage ∎ Complete Kit (SC6625)
siliconchip.com.au/Shop/20/6625
The circuit and assembly instructions were published in the January 2023 issue: siliconchip.au/Article/15616
46
Silicon Chip
Australia's electronics magazine
siliconchip.com.au
|