Shop OBEX P1 Docs P2 Docs Learn Events
Current Limiting Resistor — Parallax Forums

Current Limiting Resistor

zamanizamani Posts: 4
edited 2004-11-10 20:59 in Learn with BlocklyProp
Hi Fellows,
The expriments outlined in the workbooks all use a resistor·between the pin and the rest of the circuit to limit the current and prevent damage to·STAMP. (am I correct?). Most experiments use 220 Ohm but some use 470 Ohm. How do we come up with these numbers? In order to get these numbers, we need the characteristics of the circuit. Is this what the author has done?

Thanks
Nader·smile.gif

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-10 15:45
    For general inputs (buttons, switches, etc.) we usually us 220 ohms. This limits the current to something a bit less that 25 mA in the event of a short. 470 is okay too, and will limit the current even more. That said, we use a small value when possible to limit the amount of interaction with the circuit under "normal" conditions.

    When using LEDs and other devices you may want to calculate the resistor value, the 470 is a good starting point for LEDs. Why? Well -- very generally speaking -- LEDs would like to get something between 5 - 10 mA. If a LED has a a forward voltage of 1.4 volts, we can calulate the resistor value like this:

    (5 - 1.4) / 0.1 = 360

    360 is not a very common value, but 470 is. By using 470 ohms we get about 7.6 mA through the LED, and that's usually just fine.

    Be sure to checkout our "What's A Microcontroller?" book -- it's a great resource and will get you going.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • allanlane5allanlane5 Posts: 3,815
    edited 2004-11-10 20:09
    What Jon said.

    I can add this though. The BS2 uses a Microchip PIC processor (16C54 I believe) as its processing unit. Thus, you need the I/O characteristics of this chip. Basically, it can source or sink 25 mA through each pin, or 50 mA for the chip as a whole.

    Most applications should use nowhere near this much current. The output is either +5 volts, or ground.

    For current limiting, if you've tied a +5 volt output directly to ground, the equation is:
    V = IR (Voltage = Current * Resistance -- Ohms law).

    5V = 25 mA * x Ohms. 5V / 25 mA = x, so x == 200 ohms. 220 ohms is the closest standard resistor value, so they recommend that. With a 220 ohm resistor in series, the pins won't burn out if you accidentally connect them to ground.

    Now, for an LED, a lit LED drops 1.4 volts no matter what current goes through it (that's a property of LED's). It will be fully lit with currents from 7 to 12 mA -- let's go for 10 mA. So we get:
    (5V - 1.4V) = 10mA * x ohms. 3.6 Volts / 10 mA = x, so x == 360 ohms. We pick a 470 standard value, and apply Ohms law again.
    (5V - 1.4V) = x mA * 470 Ohms. 3.6 Volts / 470 = x, so x == 7.6 mA, which is enough to light the LED.
  • zamanizamani Posts: 4
    edited 2004-11-10 20:59
    Thanks for the explanation.
    Nader
Sign In or Register to comment.