Go Down

### Topic: Pull up or down ? (Read 3663 times)previous topic - next topic

#### DaveO

##### Apr 05, 2011, 07:00 am
Hi all.

Complete newbee. little electronics experience. programmer. new Arduino Mega on its way to me.

I understand the logic of a pull up or pull down resistor, and what happens if I don't use one.

Have browed the 20 pages of topics under the 'General Electronics' forum, but can't seem to find the answers to 2 simple question :

1. what is the correct value resistor to use ?

2. why ( is there a calculation for determining the correct value ) ?

Also, is it best to use the built-in pull-up, or add an external resistor ?

#### frank26080115

#1
##### Apr 05, 2011, 07:40 amLast Edit: Apr 05, 2011, 07:42 am by frank26080115 Reason: 1
http://www.sparkfun.com/tutorials/218

built-in resistors are obviously for convenience, if you don't have a reason not to use them, then use them

#### DaveO

#2
##### Apr 05, 2011, 07:55 am
Many Thanks.

I believe I now understand this.

#### Grumpy_Mike

#3
##### Apr 05, 2011, 01:02 pm
Quote
1. what is the correct value resistor to use ?

There is no "right answer". It is a compromise between current wasted, noise immunity and drive capacity of the device feeding into the input.

Quote
is there a calculation for determining the correct value

It's just ohms law, the trick is knowing how much current you want at the correct voltage.
If you only pull up to the exact voltage of the logic threshold then any noise will trigger the input. So pull up further gives you immunity against picked up noise.

However the up shot is that you can use between 1K to 10K on an arduino quite happily.

Using LS TTL circuits this is the same for a pull up but TTL inputs require you to sink 2mA for a pull down so then the biggest pull down you could have was a lot lower.

#### marzetti

#4
##### Apr 06, 2011, 12:41 am
So, is there a down-side to using the internal pullups?

#### retrolefty

#5
##### Apr 06, 2011, 01:05 am

So, is there a down-side to using the internal pullups?

Not for interfacing with simple switch contacts. No external components or board space taken up, what's not to like about that.

Lefty

#### frank26080115

#6
##### Apr 06, 2011, 01:29 am

So, is there a down-side to using the internal pullups?

They are only pull-up, they can't be pull-down

You don't choose the resistance

You don't choose the voltage to pull to

#### retrolefty

#7
##### Apr 06, 2011, 01:39 am
Quote
You don't choose the voltage to pull to

What choice do you have other then the chip's Vcc voltage with active sink and source output pins?

Lefty

#8
##### Apr 06, 2011, 05:26 am
Quote
What choice do you have other then the chip's Vcc voltage with active sink...

Uh oh.  I've been working on an idea that relies on sinking a lower voltage than VCC.  I was hoping I could...

- Have a connection between two processors.  One processor running at 5 volts the other running at 3 volts.

- Connect a pull-up to the shared line to hold it at 3 volts.

- Signal from the high-voltage processor to the low-voltage processor by sinking the line on the high-voltage processor.  The high-voltage pin would either be an input (high-impedance; line pulled-up to 3 volts) or a low output (sink).

Is that a problem?

#### retrolefty

#9
##### Apr 06, 2011, 05:46 am
Quote
The high-voltage pin would either be an input (high-impedance; line pulled-up to 3 volts) or a low output (sink).
Is that a problem?

That sounds like it should be OK. The potential problem is if the high voltage pin was made an output and made high, then the low voltage pin would see the high voltage.

Lefty

#10
##### Apr 06, 2011, 06:05 am
Got it.  Thanks.  (My apologies for the sidebar)

#### frank26080115

#11
##### Apr 06, 2011, 07:09 am

Quote
You don't choose the voltage to pull to

What choice do you have other then the chip's Vcc voltage with active sink and source output pins?

Lefty

That was my point

But with external resistors, you can pull to whatever voltage you want

#### retrolefty

#12
##### Apr 06, 2011, 02:31 pm
Quote
That was my point

But with external resistors, you can pull to whatever voltage you want

But you missed my point. When would it be proper to ever pull-up a arduino digital output pin to a voltage higher or lower then the Vcc voltage of the chip? Arduino output pins are not open collector type output pins.

Lefty

#### frank26080115

#13
##### Apr 06, 2011, 04:29 pm

Quote
That was my point

But with external resistors, you can pull to whatever voltage you want

But you missed my point. When would it be proper to ever pull-up a arduino digital output pin to a voltage higher or lower then the Vcc voltage of the chip? Arduino output pins are not open collector type output pins.

Lefty

An ATmega running at 5V with an I2C bus interface to a 3.3V device would require external pull-up resistors connected to 3.3V

#### Grumpy_Mike

#14
##### Apr 06, 2011, 04:45 pm
Quote
would require external pull-up resistors connected to 3.3V

Yes and a hack to the I2C library to not enable the internal pullups.

Go Up