









| Pin Number | Pin Name | Description |
|---|---|---|
| 1 | Anode (+) | Positive terminal; connect to the positive side of the power supply. |
| 2 | Cathode (-) | Negative terminal; connect to the ground or negative side of the power supply. |
Below is an example of how to control a UV-C LED using an Arduino UNO and a transistor as a switch.
Arduino Pin 9 ----> 1 kΩ Resistor ----> Transistor Base
Transistor Collector ----> UV-C LED Anode (+)
UV-C LED Cathode (-) ----> Current-Limiting Resistor ----> Ground
Transistor Emitter ----> Ground
// UV-C LED Control with Arduino UNO
// This code turns the UV-C LED on for 5 seconds and off for 5 seconds in a loop.
const int ledPin = 9; // Pin connected to the transistor base
void setup() {
pinMode(ledPin, OUTPUT); // Set pin as output
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn on the UV-C LED
delay(5000); // Keep it on for 5 seconds
digitalWrite(ledPin, LOW); // Turn off the UV-C LED
delay(5000); // Keep it off for 5 seconds
}
LED Does Not Light Up:
LED Flickers or Turns Off Unexpectedly:
Low UV-C Output:
Arduino Does Not Control the LED:
Q: Can I power a UV-C LED directly from an Arduino pin?
A: No, Arduino pins cannot supply enough current to drive a UV-C LED. Use a transistor or MOSFET as a switch and an external power supply.
Q: How do I calculate the resistor value for my UV-C LED?
A: Use the formula (R = \frac{V_{supply} - V_{forward}}{I_{forward}}). For example, if (V_{supply} = 12V), (V_{forward} = 6V), and (I_{forward} = 100mA), then (R = \frac{12 - 6}{0.1} = 60 , \Omega).
Q: Is UV-C light safe?
A: No, UV-C light is harmful to skin and eyes. Always use protective measures, such as shielding or enclosures, when operating UV-C LEDs.
Q: Can I use a UV-C LED for general lighting?
A: No, UV-C LEDs are not suitable for general lighting as they emit ultraviolet light, which is invisible and harmful to humans. They are designed specifically for sterilization and disinfection purposes.