Confused on 1st hurdle. >>>Warning Noobie

Hey Folks,

Appreciate any help :slight_smile:

I'm new to electronics and currently a mature student, trying to take it up (just started).

I am bit confused by the microcontroller pins, I have the Uno Rev.3 and bought a 4 pin Superflux Diode to begin with. just to practice ohms law and stuff.

I can power the LED no problem using the 5v and Ground and manually move the ground test the 3 cathode's to change the colour, but I am confused about grounding and flow(I understand conventional and electron flow).

If I following the blink tutorial and connect pin 13 and ground, it lights and blinks (so do all pins output power)?

Also I connected the common anode to the 5v and 3 cathodes to pins 11,12,13 and wrote a bit of code to flick between the colours.

what I can't understand where is it grounded?? with 1 led pin to 5v and the other 3 to the 11 ,12, 13 if they output power?.... the above works but I can understand \ or see why. I know it probably basics apologies.

Thanks :slight_smile:

Pins can source current, pins can sink current.
When they sink current they are acting as ground. When they source current they are acting as 5v.
Make sure you use a current limit resistor or you will burn out the LED or you will burn out the pin.
When an LED turns on, it will conduct all the current you throw at it - there is nothing limiting the current going of an IO pin or going into an IO pin - and if you go past 40mA for "too long" you will fry the pin.

First you need to understand the reason that one should always use a series current limiting resistor when powering leds. Leds once they are forward biased by application of a voltage equal to greater then there forward voltage drop rating (Vf) they are 'turned fully on' and have no internal means to keep the current flowing at or less then the safe maximum rated current specifications. Appling just +5vdc and ground to an led is a quick way to destroy it, use a resistor in series.

So if you are powering a typical led (one say a red one with a 1.5vdc Vf rating) you would compute the required series current limiting resistor as ohms = (5 vdc - 1.5 vdc) / .02 amps = 175 ohms minimum. Then you can wire the series resistor/led network between an arduino output pin and ground with the cathode closest to the ground connection. Doesn't matter what order the resistor/led or led/resistor is in.

Good luck;
Lefty

Thanks Folks,

sorry forget to mention I have the resistors connected the each cathode on the pin side.

so it goes... 5v > common anode > x 3 cathode > individual resistor to each of one of the 3 pins.

that makes sense that the pins are ground(sink) , but how does that work? how does it know, when to sink of apply current?
or changing the PIN mode output to LOW or High, if they are acting are ground what does this setting change, I see why LOW\HIGH would work when they are supply E\I.

sorry just really like to understand how the MC pins work, I read the specs, but slighty confused.

Thanks for you patience.

:slight_smile:

electrofunkdaddy:
that makes sense that the pins are ground(sink) , but how does that work? how does it know, when to sink of apply current?
or changing the PIN mode output to LOW or High, if they are acting are ground what does this setting change, I see why LOW\HIGH would work when they are supply E\I.

When the pin is LOW there's a transistor that connects it to ground. Any current arriving at the pin will go through the transistor to ground.

When it's HIGH, that transistor is switched off and a different transistor connects 5V to the pin.

nb. The transistors have a 40mA limit to the current they can handle.

Thanks, think I'm getting there. :slight_smile:
Apologies for sounding a bit thick.

so in my really simple circuit. as above to switch the pin (say 13) output to HIGH and this switch's the LED on but wouldn't that apply another 5V to the diode, as well as the fixed 5v pin connected to the common diode?,

Thanks

electrofunkdaddy:
so in my really simple circuit. as above to switch the pin (say 13) output to HIGH and this switch's the LED on but wouldn't that apply another 5V to the diode, as well as the fixed 5v pin connected to the common diode?,

Yes. You'll have 5V on both legs of the LED.

Thanks for the info :slight_smile:

I also seen this post in the forum and that cleared up my confusing , I was just testing it and I thought HIGH switched them on...doh,

http://arduino.cc/forum/index.php/topic,22413.0.html