Advance Projects

UV detection Sensor with Arduino, GY1145 or SI1145 digital UV Index

UV Detection Sensor Module

UV detection Sensor with Arduino, GY1145 or SI1145 digital UV Index- In this article, you will learn about two UV sensors, the UV Detection sensor itself and the GY1145 or the Adafruit SI1145 UV radiation sensor. First, I am going to start with the UV detection sensor. We will use both the UV sensors with the Arduino and display the values on the Oled display module. Ultraviolet light was discovered by Johann Wilhelm Ritter in 1801. The UV light is also called oxidizing rays. The UV light lies between X-rays and the visible light band on the spectrum. The UV light is divided into three sections which are:

  • UVA: 400 nm to 315 nm, which is used in black light and cannot be absorbed by the atmosphere.
  • UVB: 315 nm to 280 nm this UV light is used in tanning booths and is absorbed by the atmosphere.
  • UVC: 280 nm to 100 nm, which is used in germicidal lights. UVC light from the sun is blocked by the atmosphere. Its exposure is dangerous to human health.


The excess of UVA and UVB can damage the retina and dye optic nerve in your eyes. It can also damage the human skin. In the early 1900’s UV index was invented to measure UV light. The lower index will be dangerous to health and wearing simple sunglasses will be sufficient to prevent our eyes from the UV rays. 

This is a UV Detection Sensor Module that is used to detect the UV radiation emitted by the flame and is sensitive to a wide range of flammable fuels including hydrocarbons, sulfur, hydrazine, and ammonia.

UV detection

In this project, we have built a UV index meter through which we can get UV index, and then according to this, we will take the precautions to save ourselves from UV radiation by wearing sunglasses. This module is suitable for measuring the total amount of solar ultraviolet light intensity. This sensor converts UV light into voltage.



Uses of UV sensor:

UV sensors can be used in environmental control, labs, in earth science where we want to look the UV radiation.  It can be also used in sunglasses manufacturing in order to check how much UV radiation is blocked by the sunglass. We cannot see the UV light with the naked eye. UV light is useful in a number of applications. It has implications for human health. It can be used in the food-serving industries to prevent germs. UV light can also be used to detect fake currency notes. Water and air purification plants use UV light to kill bacteria. UV light has effects on human health some of these are positive and some are negative. But a lot of these effects are negative which can cause skin cancer and sunburns. The UV sensor is analogue voltage reader which gives us the analogue voltage at the output which is proportional to the amount of the UV light. All the UV sensors work on this principle.

Features:

  1. Suitable for measuring the total amount of solar ultraviolet light intensity
  2. Contrast the World Health Organization UV Index grading standards
  3. The detection wavelength of UV is between 200 nm to 370 nm
  4. Fast response, full interchangeability


UV index chart:

UV detection

Connection mode:

  • VCC- is the positive input port of power supply, access 3.3V-5V voltage
  • GND-GND is the negative input port of the power supply
  • OUT-OUT is the output port of analog signal, connected to the I / O port of MCU

Specifications:

  1. Operating voltage: DC 3.3-5V
  2. Output voltage: DC 0-1V
  3. Test accuracy: ±1UV INDEX
  4. Current: 0.06mA (typ), 0.1mA (max)
  5. Response wavelength: 200nm-370nm
  6. Response time: less than 0.5 seconds
  7. Work temperature: -20℃ ~85℃
  8. Detect UV wavelength: 200-370nm
  9. Size: 19.80 x 15mm


Amazon Links:

Arduino

SSD1306 Oled display Module

UV Detection Sensor

GY1145 Sensor or Adafruit Si1145 digital UV index

Other Tools and Components:

Top Arduino Sensors:

Super Starter kit for Beginners

Digital Oscilloscopes

Variable Supply

Digital Multimeter

Soldering iron kits

PCB small portable drill machines

*Please Note: These are affiliate links. I may make a commission if you buy the components through these links. I would appreciate your support in this way!


Interfacing UV sensor with Arduino Circuit diagram:

UV detection

In order to connect the UV sensor with the Arduino we will perform the following steps:

  • Connect the VCC of the UV sensor with the 5V of the Arduino
  • Connect the ground of the UV sensor with the ground of the Arduino
  • Connect the OUT of the sensor with the A6 of the Arduino.

Now we will connect the OLED

  • Connect the VCC of the OLED with 3.3V of the Arduino Nano
  • Connect the GND of the OLED with the GND of the Arduino Nano
  • Connect the SDA pin of the OLED with the A4 pin of the Arduino Nano
  • Connect the SCL pin of the OLED with the A5 pin of the Arduino Nano

To turn on the Arduino Nano we have designed a 5V regulator circuit that will convert 12V to 5V.



Required Libraries:

Download the following libraries for the Oled display module. I am using the SSD1306 i2c supported Oled display module.

Download: Adafruit_GFX.h

Download: Adafruit_SSD1306.h

UV Sensor Arduino code:

Now to measure the UV light we come up with an index which is called UV index. After uploading the code to Arduino, the UV index will be displayed on the OLED.


GY1145 or SI1145 UV Radiation Sensor

The SI1145 or GY1145 is a new sensor from SiLabs with a calibrated UV sensing element that can calculate UV Index. It is a digital sensor that works over I2C communication so we can connect any type of microcontroller with it. It is able to calculate the index of UV radiation (from 0 to 11+), approximating the incidence of both visible and infrared light emitted by the sun. It has an extremely compact dimension, consisting of the sensor, a few external components, and a 4-contact strip-line with a 2.54 mm pitch that makes it easily plugged into any breadboard and easy to connect with demo boards or development kits such as Arduino and Raspberry Pi.

TECHNICAL SPECIFICATION:

  • Supply voltage: 3-5 VCC
  • Output voltage available: 3.3V @ 100mA
  • Proximity sensor: 1 ⁓ 50 cm
  • Communication protocol: I2C
  • IR Sensor Spectrum: Wavelength: 550nm-1000nm (centered on 800)
  • Visible Light Sensor Spectrum: Wavelength: 400nm-800nm (centered on 530)
  • Operating Temperature: -40°C ~ 85°C

UV detection


GY1145 CONNECTION MODE:

Vin – This is the input to the voltage regulator which is 3-5VDC having reverse polarity protection.
GND – This is the ground pin for the signal and power supply, connected to the ground pin of the microcontroller.
SCL – This is the I2C clock pin that is connected to your I2C microcontroller clock main pin.
SDA – I2c data pin that is connected to the master data I2C pin of its microcontroller.

Interfacing GY-1145 sensor with Arduino:

Now in order to interface the GY-1145 sensor with Arduino, we will perform the following steps:

  • Connect the VCC of the GY-1145 with the 5V of the Arduino
  • Connect the Ground pin of the GY-1145 with the ground of the Arduino
  • Connect the SDA pin of the GY-1145 with the A4 pin of the Arduino
  • Connect the SCL pin of the GY-1145 with the A5 pin of the Arduino

Now we will connect the OLED

  • Connect the VCC of the OLED with 3.3V of the Arduino Nano
  • Connect the GND of the OLED with the GND of the Arduino Nano
  • Connect the SDA pin of the OLED with the A4 pin of the Arduino Nano
  • Connect the SCL pin of the OLED with the A5 pin of the Arduino Nano

To turn on the Arduino Nano we have designed a 5V regulator circuit that will convert 12V to 5V.

UV detection


Required library:

Now in order to write the code, we will first install the library for the UV sensor. Open the library manager and in the search bar write Adafruit SI1145.

UV detection

Now in the file menu open the examples and in examples select Adafruit Sl1145 library.

UV detection

In the example, we will make several changes to display the UV index on the OLED.



GY1145 Arduino Code:

 

Engr Fahad

My name is Shahzada Fahad and I am an Electrical Engineer. I have been doing Job in UAE as a site engineer in an Electrical Construction Company. Currently, I am running my own YouTube channel "Electronic Clinic", and managing this Website. My Hobbies are * Watching Movies * Music * Martial Arts * Photography * Travelling * Make Sketches and so on...

Leave a Reply

Back to top button
%d bloggers like this: