Shop OBEX P1 Docs P2 Docs Learn Events
A question on actual application of those LED's: — Parallax Forums

A question on actual application of those LED's:

IceFireProIceFirePro Posts: 86
edited 2010-06-18 16:46 in BASIC Stamp
Today I bought the following three LED's and I would like to know a simple way to make them just turn on/off thru P0-P15 in order to learn some basics (I am afraid to try before asking).

So, the first says:
FW current: 20mA
FW supply: 3.5V (typical), 4.0V (max)

Does it mean I can use it directly with the output pins, since they support up to 20mA and probably I need a 470 ohm resistor?

The second is the same, but FW voltage is 3.2 to 3.8 V.

And the third is interesting and more complicated : it says "7-Color Blinking LED" (I was interested what that is)

On the back it reads

Single color, color-changing or flashing modes

FW current: 35mA
FW supply: 3.2V (Typical), 3.5V (max)

Does it mean that if I connect it at less volts, it will consume less mA? Or; can I connect it via a resistor?

The HomeWork board's data sheet reads that it can deliver up to 50mA total. But it's not clear whether this includes Vdd, or is only for P0 to P15! How can i know? If it's for Vdd too, probably I might want to connect my higher drain LED's to Vin (which is 9V from battery) and regulate them via resistors and turn them on/off with the transistor?

Please, shed some light for actual experiments. Thanks!

Thanks!

Comments

  • metron9metron9 Posts: 1,100
    edited 2010-06-18 06:58
    http://www.daycounter.com/Calculators/LED-Tutorial-Calculator.phtml

    You may want to start with higher value resistors and 10 to 15 mA . Remember RED LED's have a much lower forward voltage than do white or blue so larger value resistors are needed. (use calculator link above and it has some basic information you need to get started.

    When I use an LED for an indicator for a pin, typically I just use a 1Kohm resistor since that is bright enough to see and only takes a couple of mA.
    If you want them for light output then you should use a transistor or mosfet or lots of other options instead of directly from a pin.

    Typically using the PIN to sink current is better than driving the led from a HIGH pin. So LOW PIN would turn it on and HIGH pin would keep it off.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Think Inside the box first and if that doesn't work..
    Re-arrange what's inside the box then...
    Think outside the BOX!
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-18 07:55
    Ok, in my book it says that following Kirchoff's Voltage Law, "If you supply a circuit with 5 V, the number of volts all the parts use had better add up to 5V.

    Following this, in order to calculate the current through a resistor connected to LED and Vdd/Vss, they say you calculate

    Vdd (5v) - LED (1.6v) = 3.4 volts = and that's the volts passing through the resistor. From there they calculate the current through the resistor.

    But what if I use a 5V LED, connected to a resistor and Vdd/Vdd (again 5V) - then 0V will be left for the resistor, so how can I calculate the current passing through it using this law?
  • IceFireProIceFirePro Posts: 86
    edited 2010-06-18 08:14
    And one more question! The led has a "Typical" FW voltage and "Maximm" FW voltage.In order to choose the right resistor so not to burn out the IO pins, I need to know the voltage in the LED so that I can know the voltage through the resistor. How can I actually know if this diode will use 3.5 or 4 Volts?
  • Mike GreenMike Green Posts: 23,101
    edited 2010-06-18 14:04
    If you use a 5V LED (theoretically ... There aren't any 5V single LEDs at this time) with a 5V supply, you can't calculate the current through a resistor with 0V left across it. The 5V LED will allow an infinite amount of current to flow through it (or whatever the power supply will provide). Boundary conditions and asymtotic cases are all very interesting, but they're not very practical.

    Work through the "What's a Microcontroller?" projects. They'll give you a good feel for how things work.

    Re: whether the LED will use 3.5 or 4 volts ... Look at the graphs for a similar LED for forward voltage vs. current. You can also design your circuits for "worst case". What resistor do you need to limit the current to something that will not damage the LED or the I/O pin under the worst possible conditions. What if the LED uses the least possible voltage? What resistor would be safe? Once you get the circuit working, you can measure the actual current and actual voltage and adjust the parts values for optimal performance understanding that components do age and their values vary slightly with time and, if you ever have to replace a part, the new part may have different values. That's why resistors and capacitors have a tolerance. Carbon resistors come in 20%, 10%, and 5% tolerances and their values can vary by as much. You have to design for that.
  • sumdawgysumdawgy Posts: 167
    edited 2010-06-18 16:46
    IceFirePro said...
    Ok, in my book it says that following Kirchoff's Voltage Law, "If you supply a circuit with 5 V, the number of volts all the parts use had better add up to 5V.
    .

    But what if I use a 5V LED, connected to a resistor and Vdd/Vdd (again 5V) - then 0V will be left for the resistor, so how can I calculate the current passing through it using this law?
    ahh...
    But what happens to this LED, (more likely 4.5v that's taking 5v but heating up.)· if you use a variable resistor instead of a fixed one and turn the resistance up and down?

    Does it stay 1>stay on?· 2> stay on & go off at a certain point 3>go dim at a certain point? or 4>go dim & then off ata certain point?
    cool.gif·after all, it IS an LED not an incandescent bulb.....Hook up a little·test circuit and see!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Before you criticize someone, walk a mile in his shoes. That way if he gets angry, he'll be a mile away and barefoot. - unknown
Sign In or Register to comment.