It is critically important to know the correct resistor color value and its watts while designing an electrical circuit for Arduino projects
Here is why
Because if you apply high voltage to led it will burn out similarly, while designing an electrical circuit, if the resistor values are incorrect then, in that case, the resistor will also burn out
For example, if you apply a 5mm led to a 9V battery then, at that instant, it can instantly burn out the led
Basics of leds
Led is a light-emitting diode that usually, comes with different colors and features such as 5mm LEDs, 10mm LEDs, and 3mm LEDs
You can easily figure out the polarity of a led by seeing its pin size, normally, a led will have two pins in which the larger pin is called the anode(+) and the smaller pin is called the cathode(-)
Important led factors
During the circuit design, it is crucial to know three factors of led and you can find this information in the datasheet of the led or the website where you have purchased it
- Polarity
- Forward voltage(Vf)
- Max current (IF)
5mm led forward voltage and current
Identify the right resistor for the circuit
Suppose we are having an Arduino due that has an output voltage of 5V and we have a 5mm red led which have a forward voltage(Vf) as 0.2v and current(IF) as 20MA from its datasheet
We can figure out the right resistor for the above circuit
Current= 20MA= 0.02A
Voltage drop= 5v-2v=3v
Required resistance R= V/I=3/0.02=150
Watt= amp x volt =IXV=0.02X3=0.06W
OR
Watt(p)=/R =
/150=0.06w
So, you can use a resistor of 150 with 0.06w(approximately 1/8w)
Test your circuit

void setup() {
pinMode(2, OUTPUT); // sets the digital pin 2 as output
}
void loop() {
digitalWrite(2, HIGH); // digital pin 2 is on
delay(1000); // waits for a second
digitalWrite(2, LOW); // digital pin 2 is off
delay(1000); // waits for a second
}
Leave a Reply