Product Introduction #
UV Sensor is a test of the best amount of ultraviolet sensor, can use the photosensitive element by photovoltaic mode and light guide mode converted ultraviolet signal into measurable electrical signal, it does not need to use the wavelength filter, only sensitive to ultraviolet, direct output corresponding ultraviolet index (UV INDEX) linear voltage, output voltage range about 0 ~ 1100 mV.
Application reference: UV tester, UV lamp monitoring, sterilization lamp equipment, etc.
Parameter Specification #
Parameter | Value/Description |
Operating voltage | 3.3V-5V |
Output voltage | 0~5V (corresponding to UV index 0~10) |
Test accuracy | ±1 UV Index |
Wavelength of response | 200~370nm |
Output signal | Analog signal |
Operating temperature | -20°C~+85°C |
Size | 3.2cm*2.4cm |
Wiring Diagram #
Attention: Expansion board is attached to esp32 controller board.
UV Sensor | ESP32 |
S | 39 |
VCC | 5V |
GND | GND |
Sample Code #
#include <ACB_Ultraviolet.h>//Import UV library
ACB_Ultraviolet uv;
void setup() {
Serial.begin(115200);//Set serial port
uv.setpin(39);//Set the pin of the UV sensor
}
void loop() {
int uv_Value = uv.read(“analogValue”);//Uv analog value
int uv_level = uv.read(“level”);//Uv Level
Serial.print(“uv value: “);
Serial.println(uv_Value);
Serial.print(“uv level: “);
Serial.println(uv_level);
Serial.println(“———————“);
delay(100);
}
Note:If you are using an Arduino board, upload the program below and connect the hardware to PIN A0
Arduino code #
int level;
void setup() {
Serial.begin(9600);//Set serial port
pinMode(A0, INPUT);//Set pin A0 to input mode
}
void loop() {
int uv_value = analogRead(A0);
if (uv_value < 86)
{
level = 0;
} else if (uv_value < 171)
{
level = 1;
} else if (uv_value < 248)
{
level = 2;
} else if (uv_value < 330)
{
level = 3;
} else if (uv_value < 413)
{
level = 4;
} else if (uv_value < 495)
{
level = 5;
} else if (uv_value < 578)
{
level = 6;
} else if (uv_value < 660)
{
level = 7;
} else if (uv_value < 743)
{
level = 8;
} else if (uv_value < 825)
{
level = 9;
} else if (uv_value < 908) { level = 10; } else if (uv_value >= 990)
{
level = 11;
}
Serial.print("uv value: ");
Serial.println(uv_value);
Serial.print("uv level: ");
Serial.println(level);
Serial.println("---------------------");
delay(1000);
}
Test Result #
After you successfully connect the line according to the wiring diagram and successfully upload the correct program, when you irradiate the UV sensor with the UV lamp or put the UV sensor in the outdoor sunlight, the serial port monitor will output the current analog value of UV and the corresponding level.
Ultraviolet grade index | Range of UV analog values |
0 | <372 |
1 | 372~743 |
2 | 744~1115 |
3 | 1116~1487 |
4 | 1488~1859 |
5 | 1860~2231 |
6 | 2232~2603 |
7 | 2604~2975 |
8 | 2976~3347 |
9 | 3348~3719 |
10 | 3720~4094 |
11 | ≥4095 |
Related Resources #
Get One Now #
B2B Business: info@acebott.com