Shop OBEX P1 Docs P2 Docs Learn Events
How did they know what resistor to use? — Parallax Forums

How did they know what resistor to use?

woodturner550woodturner550 Posts: 5
edited 2010-01-19 04:29 in BASIC Stamp
What I'm Looking at is "What is a Microcontroller? Student Guide Version·2.2 page 47 - 55". What I need to understand is how·the value of the resistor was calculated. Are all LED's the same? Does the resistor change if I were working with 12 volts? What is important to look at when looking at the LED specs.
I know that to just follow along with book that the resistor is correct. But what about the how and why.

Thanks
woodturner550



Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-12 18:22
    Among other things, you should learn Ohm's Law. Start with the Wikipedia article on the subject.

    As with most electronics parts, the manufacturer's datasheet has the definitive data on the part including the "forward voltage" of the LED. Again, consult the Wikipedia ... look up LEDs.

    LEDs have different forward voltages depending on how they are made and the materials used. Most red LEDs have a forward voltage of around 1.7V. If you use a 5V supply, the amount of voltage left for the resistor to drop is 5V - 1.7V = 3.3V. If you consult most LED datasheets, you'll find that they're rated for a current up to about 20mA. Much more will probably damage the LED and less will produce less light. Let's assume you want 20mA. Ohm's Law says R = E / I = 3.3V / 0.02A = 330 Ohms. You can figure out other resistor values given different assumptions for supply voltage and LED current.
  • woodturner550woodturner550 Posts: 5
    edited 2010-01-12 18:33
    Thanks!
    Gave me the direction I need to go to understand the basics of the circut calculations.

    woodturner550
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-12 21:52
    Mike Green said...
    Ohm's Law says R = E / I = 3.3V / 0.02A = 330 Ohms.
    Hmm. That Ohm guy was pretty tricky. I'm missing something here, right in the math in that step.

    Granted, I went to school decades after Ohm did, and they might not have taught us the same math, but the way I learned it, 3.3/.02 = 165. Is there another step here I'm missing?
  • woodturner550woodturner550 Posts: 5
    edited 2010-01-13 02:52
    No you saw the same thing I did when I went back to use his values..........We all make mistakes. I'm just glad he pointed me in the right direction.

    Thanks again

    woodturner550

    P.S. It should be 165 ohms. I'll bet he did that to see if it would be caught.
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-13 04:16
    woodturner550 said...
    No you saw the same thing I did when I went back to use his values..........We all make mistakes.
    Not Mike. Until he comes back here himself and changes things, I'm going to believe that there's something I should know (but don't) that makes his answer correct.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-01-13 04:31
    I make mistakes too (I was distracted ... really I was). For 20mA, it is 165 Ohms. For 10mA, it is 330 Ohms. No magic, just Ohm's Law and math (and mistakes).
  • sylvie369sylvie369 Posts: 1,622
    edited 2010-01-13 05:07
    Okay, I'm relieved, and a bit shocked (but I guess distractions can get the best of even the best of us).

    It makes more sense now. Thanks, and thanks for asking the question, woodturner.
  • RoboticsProfessorRoboticsProfessor Posts: 54
    edited 2010-01-19 04:29
    ...and you often get a value where there is no exact resistor available.

    Say you come up with 98 ohms. Just go to the next highest available value, say 100 ohms, and use that.

    An LED circuit is very forgiving and "close" is good enough. Pick the next highest value to keep overall current below 20 mA (or the current value you want) instead of over the desired value as a general safety rule.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Richard Vannoy

    Programming and Electronics Instructor
    www.RichardVannoy.info
    ·
Sign In or Register to comment.