# Electronics 101, Ohm's law, Arduino and blue leds! Beginner here...

Hi everyone,

Apologizes for the very basic question. I am struggling to understand what kind of resistor to use for a specific LED. I have 10 blue LEDS and an arduino uno. The packaging on the led states, "3.0-3.3v @ 20mA". Possibly I am not understanding how to calculate this. I have been studying from this site. I tried to search the forums but I don't know if anyone has dared to ask a question as basic as this... XD

I want to blink this blue LED on a digital pin. Is this as simple as (5.0 - 3.3) / 0.02 = r ?

I want to blink this blue LED on a digital pin. Is this as simple as (5.0 - 3.3) / 0.02 = r ?

Yes

Is it erroneous for me to use a 100ohm resistor? Any troubleshooting tips on why I could not blink this blue LED?

100 ohms should be fine. Perhaps if you post your code?

-br

Sure. I am just using the basic blink example program.

``````/*
Turns on an LED on for one second, then off for one second, repeatedly.

This example code is in the public domain.
*/

// Pin 13 has an LED connected on most Arduino boards.
// give it a name:
int led = 13;

// the setup routine runs once when you press reset:
void setup() {
// initialize the digital pin as an output.
pinMode(led, OUTPUT);
}

// the loop routine runs over and over again forever:
void loop() {
digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
delay(1000);               // wait for a second
digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
delay(1000);               // wait for a second
}
``````

I checked the led polarity. Looks correct. I can send a pic later if needed.

crosson: Is it erroneous for me to use a 100ohm resistor? Any troubleshooting tips on why I could not blink this blue LED?

Have you got the LED wired up the right way round? Anode to Pin 13, cathode to resistor, other end of the resistor to ground.

I do believe so. Switching it around seems to do nothing but all my other LEDS work in the direction I have this blue one.

Ok newb mistake. I had been making my anode/cathode judgement based on what direction the diode parts faced assuming all LEDS were built the same. Turns out my reds and blues are opposite. I should have been paying attention to which leg was longest. Thanks for your time.

crosson: Ok newb mistake. I had been making my anode/cathode judgement based on what direction the diode parts faced assuming all LEDS were built the same. Turns out my reds and blues are opposite. I should have been paying attention to which leg was longest. Thanks for your time.

One forum member bought some leds from asia that had the longest lead backwards polarity of most others, so it always pays to test with your multimeter or with a quick test voltage when dealing with semiconductors. Measure twice cut once as the wise man said. ;)

Lefty

I have just discovered a trick with LEDs and a multimeter. If you set the meter to continuity, that it beeps when you make a circuit. When you test an LED it will glow faintly with the red lead on the anode and black on the cathode. It is great for those very small surface mount LEDs

I have some LEDs with the anodes marked, yet I've only seen LEDs with the cathodes marked.

My meter doesnt have the continuity checker, but it does have a diode marking, and it works as a polarity checker. It will light the LED if you have it the right way, but not the other.