Labs / Electronic modules

GraftSense: An Open-Source UV Ultraviolet Sensor Module Based on GUVA-S12SD

Author: Li Zisheng · Source: FreakStudio open documentation, v1.4 · License: CC BY 4.0 · Driver code (sensors/guva_s12sd_driver): MIT License

Contents
GUVA-S12SD
GUVA-S12SD V1.0 U1 U2 R1 R7 C1 C4 LED1 LED2

I. Module Introduction

The UV ultraviolet sensor module based on GUVA-S12SD is a device that takes GUVA-S12SD ultraviolet sensor as the core, and is equipped with LM358 operational amplifier to realize signal amplification. It outputs a voltage signal linearly corresponding to the ultraviolet intensity through the analog output interface (AIN), and integrates circuits such as power indicator and filter capacitor, which can accurately collect and process ultraviolet intensity information. It is suitable for scenarios such as environmental monitoring and ultraviolet protection, and provides users with a reliable ultraviolet signal detection solution.

II. Introduction to Main Chips

The core chip of this module is from the South Korean GENUV company, which is the GUVA-S12SD ultraviolet photodiode.

2.1 Chip Overview

GUVA-S12SD

GUVA-S12SD is a Schottky-type ultraviolet photodiode based on gallium nitride material, which operates in photovoltaic mode and features excellent visible-blind characteristics, high responsivity and low dark current. It is suitable for scenarios including UV index monitoring and UV-A lamp monitoring, providing accurate photoelectric conversion solutions for ultraviolet detection applications.

2.2 Pin Definition

GUVA-S12SD

GUVA-S12SD ultraviolet photodiode has two pins, which are the anode (Anode) and the cathode (Cathode) respectively:

These two pins serve as the core connection terminals for realizing the photovoltaic mode operation and completing ultraviolet photoelectric detection, through which the photocurrent generated by ultraviolet irradiation can be converted into a measurable electrical signal.

2.3 Functional Block Diagram

None.

2.4 Performance Parameters

GUVA-S12SD 40 90 30 85 5V 1mA 0.1 100mW/cm 260

GUVA-S12SD ultraviolet photodiode has the following absolute maximum ratings:

GUVA-S12SD 25 1nA 101 125nA 0.08 0.14A/W 240 370nm 0.076mm

GUVA-S12SD The characteristic parameters at 25°C are as follows:

GUVA-S12SD 240 370nm

These three charts illustrate the performance characteristics of GUVA-S12SD from different perspectives:

2.5 Reference Circuit

None.

2.6 Chip Configuration

None.

None.

2.8 PCB Routing Notes

None.

III. Circuit Engineering

3.1 Circuit Source Engineering

To obtain the circuit source project, please follow the official account [Freak Embedded]

3.2 Module Usage Instructions

The schematic diagram of this module is shown below:

SCH_GUVA-S12SD-Based UV Sensor Module_v1.0_2025-10-24.pdf 2.1 MB

GUVA-S12SD LED1 LED2 R1 R7 C1 C4 U1 U2 LM358

This module provides an analog output interface AIN: The analog voltage signal output by this interface is generated by the photocurrent of the GUVA-S12SD ultraviolet photodiode after being amplified in two stages by the LM358 operational amplifier, and the voltage value is linearly correlated with the ultraviolet intensity. External devices (such as microcontrollers) can collect the signal of this interface via the ADC to realize quantitative detection of ultraviolet intensity or UV index, providing accurate analog feedback for scenarios such as environmental monitoring and ultraviolet protection.

V1.0.0 LED1 GUVA-S12SD 2 10M R1 1 100nF C1 LM358

The amplifier circuit we adopt LM358 dual operational amplifier to realize two-stage amplification:

Finally, it outputs an analog voltage linearly correlated with the ultraviolet intensity, which provides sufficient amplification capability and linear accuracy for subsequent signal acquisition.

3.3 Application Experiment

Here, we use the GraftPort-RP2040 development board for testing, and connect the GUVA-S12SD-based UV ultraviolet sensor module to communicate with the main controller via the AIN interface.

Here, we first use the HY2.0-4P connecting cable to connect the module to the GraftPort-RP2040 development board's AIN0 interface:

GraftPort-RP2040 GUVA-S12SD AIN0 HY2.0-4P 26

The module connections are shown in the following table:

Development Board Pins

Module Pins

Description

Pin 26

AIN

UV ultraviolet sensor analog output pin

Pin 19

NC

-

Here, we need to search for the relevant driver packages on uPyPI: https://upypi.net/zh/

106

Enter guva_s12sd_driver to search, and the following will be displayed:

guva_s12sd_driver 1.0.0 GUVA-S12SD

Click to copy the local installation command:

guva_s12sd_driver GUVA-S12SD 1.0.0

Here, we can use the mip tool to import module driver library code. Below are the usage commands for the mpremote tool:

mpremote mip install github:FreakStudioCN/GraftSense-Drivers-MicroPython/sensors/guva_s12sd_driver

Import the UV ultraviolet sensor module based on GUVA-S12SD - MicroPython driver code, then copy the following main.py code into our project:

# MicroPython v1.23.0
# -*- coding: utf-8 -*-
# @Time    : 2025/8/26 10:45 AM
# @Author  : 缪贵成
# @File    : main.py
# @Description : Test file for the UV ultraviolet light matrix module driver. It is recommended not to keep it fully on for long periods. If you need full brightness, replace the resistors, otherwise the board will heat up quickly and cause unexpected consequences

# ======================================== Import Modules =========================================

import time
from uv_matrix import UVMatrix

# ======================================== Global Variables ============================================

# ======================================== Functions ============================================

# ======================================== Custom Classes ============================================

# ======================================== Initialization configuration ===========================================

time.sleep(3)
print("Freak_studio:UV matrix test")
# Initialize UVMatrix, assuming control pin 26 and PWM frequency 1000Hz
uv = UVMatrix(pin=26, pwm_freq=1000)
print("status:", uv.get_state())

# ========================================  Main Program  ===========================================

# Turn on UVMatrix (full brightness)
uv.on()
print("UV is light full:", uv.get_state())
time.sleep(2)

# Half-brightness adjustment
uv.set_brightness(512)
print("UV PWM duty=512")
time.sleep(2)

# Turn off UVMatrix
uv.off()
print("UV status:", uv.get_state())
time.sleep(2)

# Test the toggle state switch
uv.toggle()
print("UV toggle:", uv.get_state())
time.sleep(2)
uv.toggle()
print("UV toggle:", uv.get_state())

Burn the code, open the terminal, and use the mpremote tool to connect to the main controller; the output is as follows:

GUVA-S12SD 0.034V 3.300V 0.00 11.00

Here we use an ultraviolet lamp to irradiate the module, and it can be seen that UV the value is detected under the change of light intensity and printed on the terminal.

IV. Drivers

guva_s12sd_driver.zip 10 KB

None.

VI. Revision History

Document Version

Date of Revision

Modifier

Modify Content

v1.0

2025.8.13

Zero Kōkō

Complete the initial version of the design and initialize the document

v1.1

2025.10.24

Li Zisheng

Added Section 2.8 PCB Routing Notes

Revised Section 3, Instructions for Circuit Source Engineering and Module Usage, and added a secondary heading:

3.1 Circuit Source Engineering, 3.2 Module Usage Instructions, 3.3 Application Experiments

The BOM sheet has not been finally checked, the driver has not been re-verified, and the 3.3 application experiment

Not yet specified.

v1.2

2025-12-29

Li Zisheng

Added application experiments and production files

v1.3

2025-12-31

Xin Ruili

Create an open version of the document based on the internal document version v1.2.

v1.4

2026-03-29

Xin Ruili

Modified the application experiment section

VII. Relevant Materials

7.1 Chip Datasheet

GUVA-S12SD Datasheet:

GUVA-S12SD.pdf 301 KB

LM358 Datasheet:

lm358.pdf 4.2 MB

7.2 Unique Icons for PCB Silk Screen

GraftSense: An Open-Source UV Ultraviolet Sensor Module Based on GUVA-S12SD