Shop OBEX P1 Docs P2 Docs Learn Events
Current Voltage and Resistance basic questions — Parallax Forums

Current Voltage and Resistance basic questions

whiteoxewhiteoxe Posts: 794
edited 2009-07-29 08:04 in Learn with BlocklyProp
Dear wizards,
······I have been building simple circuits following diagrams and getting things working without any real undersrtanding. I have just started reading WAM ,previously ·I buy parts, they come with instructions which are mostly simple to follow.

Now reading WAM and like to understand things.

Connecting up LED's and push button switches shows that the IO pins of the microcontroller are pulled low with a 10K resistor. So then you hit the button and open a path with only 470 ohmn resistor.

Thats all good and I get it. However then they show a diagram with LED's connected to Vdd+ and the IO Pins. No switch used. No Pull Down resistors used.
They say that Pull Down or Pull UP resistors are used to stop the Pins floating.
So you use code to tell processor PIN 1 HIGH or PIN 1 LOW. So If you are not using a switch then the PINS don't Float ?

Also with regard to I = V/R , If the voltage is 5V and the resistor is 470 Ohms
there is a LED drawing 1.4V
I = 3.6/470 = .007mA
So can you also say that the LED resistance is 244Ohms therefore ->
Is this ok ,·· R = 5/.007mA· so then R = 714Ohms ?
Just can't wait till I get onto voltage dividers !yeah.gif

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2009-07-25 13:56
    1) An I/O pin has 3 possible states. It can be an input where it detects whether the I/O pin is connected to a voltage above or below a particular threshold. As an input, it has a high impedance ... it's very sensitive to voltages including things like static electricity or other sources of noise in the physical neighborhood of the pin. You use a pullup or pulldown resistor to establish the default voltage/state of the pin so it doesn't respond to someone moving their hand nearby.

    As an output pin, it has two states ... high and low. There's a transistor (MOSFET) connected from the I/O pin to ground and another from the I/O pin to Vdd. One or the other is turned on to connect the I/O pin to ground or Vdd. There's a small voltage drop across the "on" transistor ... on the order of 0.3V. That sets the actual voltage on the I/O pin to roughly 4.7V or 0.3V. Note that in input mode, both transistors are turned "off" and effectively have infinite resistance. These output transistors are designed to conduct up to 20-30mA without overheating and the wiring on the chip can handle that amount of current.

    2) An LED doesn't obey Ohms Law (see en.wikipedia.org/wiki/Light-emitting_diode). It's a diode and, when a diode is conducting, it has a (roughly) fixed voltage drop across it that's determined by the materials used to make the diode and the specific construction used. The voltage depends a little on the current through the diode, but not much. A silicon diode for example, typically has a forward voltage (Vf) of 0.7V. A red LED typically has a forward voltage of 1.7V. A blue LED may have a forward voltage of 3.6V. Once the applied voltage exceeds the forward voltage, the LED will conduct as much current as is provided until the power source can't provide any more or until something melts. The series resistor limits the current through the LED to something the LED or power source can tolerate (or to what's needed for the amount of light output desired).

    3) When you're ready for voltage dividers, try looking it up in the Wikipedia.
  • whiteoxewhiteoxe Posts: 794
    edited 2009-07-29 08:04
    Thanks Mike,
    That covered everthing for me.
Sign In or Register to comment.