Shop OBEX P1 Docs P2 Docs Learn Events
Do I really need a resistor here? — Parallax Forums

Do I really need a resistor here?

HimszyHimszy Posts: 28
edited 2005-01-19 02:57 in BASIC Stamp
Hi,
In the "What is a Microcontroller?"(I think)·book it says to use a resistor when using a LED. I tried this and I couldn't see it light up. Do I need to use the resistor?
Thanks Michael

Comments

  • NewzedNewzed Posts: 2,503
    edited 2005-01-16 23:54
    If you are using a standard 5V LED you need a 240 ohm resistor in series.· If you are using a "resistorized" LED then you don't need the resistor.

    If you are using a 12V LED you won't see it no matter what.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    Do you have a Stamp Tester?

    http://hometown.aol.com/newzed/index.html
    ·
  • BeanBean Posts: 8,129
    edited 2005-01-17 00:28
    Make sure you have the LED connected correctly. If you connect it backwords it won't light.
    Bean.
  • edited 2005-01-17 00:38
    In general, it's best to stick with the schematics and wiring diagrams provided by What's a Microcontroller when doing the activities in the book.

    If you are using one of the What's a Microcontroller kits, those LEDs are standard. They do not have resistors built-in, and you will need a resistor to protect both the BASIC Stamp and the LED.

    If your LED isn't emitting light, it may be plugged in backwards, or there may be some other circuit or programming error. Also, try a different LED. Defects are pretty few and far between, but if you are using LEDs that have unknown history, definitely try some others.

    Take a closer look at the What's a Microcontroller text, it explains how current limiting resistors work and why they are used. It also explains how to determine which pin is connected to the LED's cathode and anode, which is crucial information for making the LED work on the first try.

    The BASIC Stamp HomeWork board does have 220 ohm resistors between each pin on the microcontroller and the I/O pin socket you use. If you have a BASIC Stamp HomeWork Board, it's true that you can get away with a couple of LEDs with no resistors. Any more than two LEDs, and you will have to check the BASIC Stamp manual for maximum allowed current. Each LED with a resistor in series draws this much current: I = 3.4 V / R.

    The BASIC Stamp Manual Version 2.1 is available for free download from www.parallax.com -> Downloads.

    Post Edited (Andy Lindsay (Parallax)) : 1/17/2005 12:41:13 AM GMT
  • HimszyHimszy Posts: 28
    edited 2005-01-17 19:17
    I did remove the resitor and it worked fine. Whats the maximum number I can use·then? I don't have the homework or the other board that's mentioned·in the book.
  • BorisBoris Posts: 81
    edited 2005-01-17 20:08
    You should not remove the resistor ! It serves to limit the current. Higher current can damage the LED and/or the Basic Stamp. What do you mean by "Whats the maximum number I can use?" Highest resistance value?
    Himszy said...
    I did remove the resitor and it worked fine. Whats the maximum number I can use·then? I don't have the homework or the other board that's mentioned·in the book.
  • HimszyHimszy Posts: 28
    edited 2005-01-17 20:24
    LEDS
  • BorisBoris Posts: 81
    edited 2005-01-17 20:32
    According to http://www.parallax.com/dl/docs/prod/stamps/stampscomparison.pdf
    The sink/source current per I/O is 20mA or 30mA·depending on the Stamp you have. As long as your LEDs draw less than that you'll be ok.
  • HimszyHimszy Posts: 28
    edited 2005-01-17 20:39
    Ok, I think now I might have used the wrong resitor. (Oops). Some of my resistors have 5 bands on them, how do I work out the value? Is it just the same as 4 bands, but with an extra digit?
  • BorisBoris Posts: 81
    edited 2005-01-17 20:41
    Here are some usefull links i found doing a quick Google search:
    http://home.cogeco.ca/~rpaisley4/LEDcalc.html
    http://samengstrom.com/elec/resistor/5band.html
  • HimszyHimszy Posts: 28
    edited 2005-01-17 20:56
    Thanks Boris. I used it but not too sure about this one.
    Green Gold Black Black Brown.
    Any ideas?
  • BorisBoris Posts: 81
    edited 2005-01-17 21:01
    What if you flip it over and make it:
    Brown-Black-Black-Gold-Green [noparse]:)[/noparse]
    10ohm, 0.5% according to the link
  • ErnieErnie Posts: 20
    edited 2005-01-17 22:00
    Color code in a nutshell:

    Black = 0
    Brown = 1
    Red = 2
    Orange = 3
    Yellow = 4
    Green =·5
    Blue = 6
    Violet = 7
    Grey = 8
    White = 9

    Gold = 5% tollerance
    Silver = 10% tollerance
    None·= 20% tollerance

    First two numbers are leading digits, last number is power of 10 (or number of zeros). (For newer precision resistors you might get 4 color bands, 3 digits and power of 10).

    Example: Yellow Violet Red··= 4· 7· * 10 ^ 2· = 4 7 * 1 0 0 = 4,700

    How to remember? Use the politically incorrect catch phrase "Bad Boys Rape Our Young Girls, But Violet Gives Willingly. Get Some Now" That gives the 1st leters in order.


    Now then, Brown Black Black is 10 ohms, that is too small for a LED.

    The 220 ohms (Red Red Brown) previously suggested is a good value. If you don't have one, any distributer should have them, Radio Shack has em if you want them fast.

    ·
  • HimszyHimszy Posts: 28
    edited 2005-01-17 22:14
    Thanks Ernie.

    Boris I thought about swapping it over but the the big gap is in the wrong place. Also my multimeter gave me 0.675 on the 2K setting, Is this 675 ohms then?
  • Russ61Russ61 Posts: 11
    edited 2005-01-17 23:11
    Guys,

    Here is the way I was taught to remember it.

    BAD······· ·Black = 0
    BOYS·······Brown = 1
    RACE······· Red = 2
    OUR········ Orange = 3
    YOUNG···· Yellow = 4
    GIRLS······ Green =·5
    BEHIND···· Blue = 6
    VICTORY·· Violet = 7
    GARDEN···· Grey = 8
    WALLS····· White = 9

    GET········· Gold = 5% tollerance
    STARTED·· Silver = 10% tollerance
    NOW········ None·= 20% tollerance

    I learned this in the Navy 25 years ago and still remember it!

    RWC

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Russell Crow

    Project Manager
    Cohesive Automation Inc.
    ·
  • JTBJTB Posts: 9
    edited 2005-01-19 02:57
    Speaking of Resistors--·I am getting·a confusing voltage mesurement in the "What's A Microcontroller"·manual (page 79)·in the activity using the circuit set-up for "Readpushbutton State.bs2" program.··The Circuit is set-up with a pushbutton for the "active low" mode.· There is a 10k Ohm resistor (pull-up) connected between Vdd and the pole 4 of the normally open button.··This connection is shared with a220 Ohm resistor which is connected to P3

    Here is the confusing part.· When the circuit is turned on I should be able to measure a voltage drop across the pull-up resistor.· Instead, I get zero volts across the resistor and 5 volts measured·between the top·and the bottom of the resistor·and ·Vss respectively.·· Its like the resistor is not even in the circuit.· I've checked to make sure connections a tight and even moved to alternate connection sites on the breadboard.· The resistor measures the correct resistance.· What am I missing?

    Julian
Sign In or Register to comment.