Shop OBEX P1 Docs P2 Docs Learn Events
Analog Newbie — Parallax Forums

Analog Newbie

Nelson ChandlerNelson Chandler Posts: 2
edited 2009-05-24 03:59 in BASIC Stamp
I just got "What's a Microcontroller?" along with the BASIC Stamp HomeWork Board. I've been going through the exercises and I'm at the pushbutton section.

What I want to know is how does the circuit designer know which size resistors to use?

The resistor used in conjunction with the LEDs is 470 Ohms and I realize that has something to do with not burning out the LED. But where is the LED rating specified?

In the Push Button example, where does 10k Ohm and 220 Ohm come from? I realize the path to Vss has to have higher resistance than the microcontroller, otherwise it would just create a short circuit when the button is pushed (right?), but how do I know it's supposed to be 10k Ohm and not 1k Ohm or something else?

Basically, where's the best place to look for the "why"s when it comes to the analog portion of these circuits? I'd like to experiment, but I don't want to fry my spiffy new learning tool due to ignorance.

Comments

  • PrettybirdPrettybird Posts: 269
    edited 2009-05-24 02:54
    Google ohms law. It is a basic for electronics. 220 ohm is usually the lowest used for LEDs to supply full current. LED has a .6v voltage drom like mise silicon diodes. I am no concerned with full borer so usually use 330 to 1K to save barrery life. The 220 ohm resistor for inputs is to protect that stamp as mentioned in your text. Ohms law is a must for electronics all kinds. VSS is 5v. V in is 6 to 9v. Just follow the book.
  • SRLMSRLM Posts: 5,045
    edited 2009-05-24 02:59
    Here is a thread with lots of electronics book recommendations: http://forums.parallax.com/showthread.php?p=741483
  • Nelson ChandlerNelson Chandler Posts: 2
    edited 2009-05-24 03:14
    Prettybird, I read Appendix F: More about Electricity, including the part about Ohm's Law. It does say the LED has a 1.6v voltage drop, and I calculated the current based on the given resistor, but it doesn't say what the allowable ranges are. I did read the part about the 220 Ohm being to protect the circuit, I just want to know where those numbers come from. Especially the 10k one. Essentially I can follow the diagrams in the book easily enough, but I'd really like some deeper understanding so I can make my own circuit diagrams.

    Thanks for the link SRLM. I'll look into getting some of the books recommended.
  • Mike GreenMike Green Posts: 23,101
    edited 2009-05-24 03:55
    The LED resistor is usually figured on the basis of a 20mA current. This is a common maximum LED current for most LEDs. It's also a typical limit used for Stamp I/O pins. These can handle a little more current (25mA), but there are overall limits on groups of 8 I/O pins (50mA) and total Stamp current (100mA) that you also have to follow. If you don't need the brightness, I'd suggest using a lower current like 10mA.

    Using Ohm's Law: 5V / 220 Ohm = 23mA

    This limits short circuit current to under 25mA if an I/O pin set LOW is connected to +5V or an I/O pin set HIGH is connected to ground.

    The Stamps have protective diodes that conduct current to the Vdd buss on the chip for I/O pin voltages greater than 5.6V or conduct current to the Vss buss on the chip for I/O pin voltages below -0.6V. These diodes can handle current up to 500uA. A 10K resistor will protect these diodes for voltages up to around +10V or down to roughly -5V (try Ohm's Law).
  • SRLMSRLM Posts: 5,045
    edited 2009-05-24 03:59
    Mostly, there is one limit that you have to look for in a given circuit: maximum current. Assuming that the voltage level is set (5v, 3.3v), then you can choose a resistance value to get the right current that you want. Generally, it's better to be on the safe side and choose higher resistance (== lower current) when you can. You'll want to look at the various datasheets (LED, BS2, etc.) to find maximum current.
Sign In or Register to comment.