Professional Documents
Culture Documents
General Concepts-Pullup & Led Connection
General Concepts-Pullup & Led Connection
PULL UP RESISTORS
Well, it's not really a black art, but pull-up resistors are one of those concepts that seem to
get glossed over in college. It is important to know when to use pull-up resistors in a
design and why. That is what I will talk about in this node.
Before I continue, I want to define the symbol below as a switch. It can either be open or
closed.
/
____/ -----
SWITCH
It is helpful to understand what happens in a design when there are no pull-up resistors.
Shown below is a small chip connected to a switch. When the switch is closed, the first
pin of the chip is connected to ground.
/ -------
_____/ -------| |---
| ---| |---
| ---| |---
\ / -------
GND
However, when the switch is open, the signal is not connected to anything and is left
floating. The signal is now in an unknown state. It would be reasonable to say that the
signal would be zero most of the time. It would also be reasonable to say when you play
Russian roulette, most of the time you'll be ok. But engineers would rather have the
signal to be in a known state all of the time. To accomplish this, we pull the signal up to
VCC when the switch is open, as shown below.
VCC
/ \
|
|
/ | -------
_____/ -------| |---
| ---| |---
| ---| |---
\ / -------
GND
Now when the switch is open, the signal is connected directly to VCC and has a known
state. But notice what happens when the switch is closed. VCC and GND are connected
creating a short. And this is very bad. Not only could you fry most (if not all) of the chips
on your board and damage the power supply, you'd never be able to live it down. To
avoid such a situation, place a resistor right below VCC and the short is eliminated. This
resistor is called a pull-up resistor.
VCC
/ \
|
|
\
/ Pull-up resistor
\
|
|
/ | -------
_____/ -------| |---
| ---| |---
| ---| |---
\ / -------
GND
A common value for a pull-up resistor is 10k. But this does not mean a 10K ohm resistor
should be chosen in every case. The value is dependent on how "hard" or fast the voltage
is pulled up and how much current the chip can sink. If we make VCC 5V, using the
equation V = I*R, the current would be around .5mA, which is small enough for a chip to
dissipate just fine. However, if the resistor were 10 ohms, the chip would have to sink
half an amp, which is not impossible. But you have to study the datasheet ahead of time,
otherwise your chip could take in too much current and go bye-bye.
Pull-down resistors work almost the same way as pull-up resistors, except pull-down
resistors pull the signal down to ground instead of up to VCC.
VCC
/ \
|
| / -------
|_____/ --------| |---
| ---| |---
| ---| |---
| -------
|
\
/ Pull-down resistor
\
|
|
\ /
GND
The Pull-up Resistor - 2
This time in Very Basic Circuits, I would like to talk about pull-up resistors. The basic
function of a pull-up resistor is to insure that given no other input, a circuit assumes a
default value. Actually, there are two flavors of this circuit. A pull-up and a pull-down.
Their function is the same, to create a default value for a circuit, but one pulls the line
high, the other pulls it low.
I=V/R
I = .0005A (.5mA)
A variation on this them is a pull-down resistor.
Just like the pull-up resistor, it is used to limit the
current that can flow between Vcc and ground.
Though less often used, it is still a valid thing to do.
In Summary
If you have just read the above article, you hopefully understand how a resistor limits the
amount of current that can flow through a circuit. In the above example, we were dealing
with input pins. Expanding on that idea, I would like to present a simple circuit that use
limiting resistors with output pins and also with an LED.
There are times when you connect the output of a gate to a device that isn't the input of
another device. For example, driving an LED, is an example.
Most logic parts are capable of handling around 20mA of current per pin. This means that
you need to consider carefully the device being attached.
How to make an LED work
Most LED's have a current rating, which determines the size of the
resistor you will need. The current rating tells you what the
maximum allowable current for the part is. In general, the higher
the current, the brighter the LED.
Most LED's seem to handle at least 15mA. If you are using a 5 volt
circuit, then Ohms law tells you what resistor value to use. R = V /
I, so R = 5v / .015A = 333 ohms.
Now let us consider what happens when using the
output of a chip, such as the 74HC04, to operate an
external device. For example, the circuit on the
right drives an LED. When the gate is HIGH, then
there is no path to GND for cathode of the LED L1.
When the gate is LOW, then output pin 2 is
connected to ground, and current flows.