Why use an external pull-up resistor?

Hi guys,

I’ve seen a lot or great Arduino projects in which external pull-up resistors are used. I’ve also read that the Arduino has internal pull-up resistors which can be activated by the digitalwrite function.

Why are external pull-up resistors used if it can be set up in software?

Ciao!,

Richard

sometimes you need to pull up to a different voltage than 5 volts, or you might need a stronger pull-up resistor for faster rise times. just a couple thoughts, there’s probably more reasons.

The internal pull up is only about 30K. For better noise immunity you need a lower value, between 1K and 4K7 is normal.

sometimes you need to pull up to a different voltage than 5 volts,

Never never never never do this. Pulling up to more than 5V will damage the arduino.

Heh, go over to the eevblog and in one of the videos, Dave explains why you never let voltages applied to the pins exceed the rail voltages. Latchup ensues (essentially converts the chip to a triac that's been tripped on) and smoke gets released.

Oops, there goes another chip...

Never never never never do this. Pulling up to more than 5V will damage the arduino.

He never said "more", just different. Like 3v3. Another reason is some 1-wire devices need a lot more current than will go through a 30k resistor @5v.

Also, where can I find the video on why not to apply more than rail voltage to a micro? I've looked all over eevblog.

Like 3v3.

Even worse. The arduino doesn't have open collector outputs so if you try and pull up to 3V3 you will pull current out of the chip and possibly disturb the 3V3 rail or even exceed the current output of the pin if the resistor is too low.

I'm 99% sure you can put a voltage divider across the pin to pull it to 3v3.

I don't know how this thread seemed to have morphed into output pin applications, the OP asked about pull-up and pull-down methods that only apply to digital input pins?

Pull-ups and pull-down methods don't apply to Arduino output pins because they are already a active current source (when HIGH) and sink (when LOW) already.

I'm 99% sure you can put a voltage divider across the pin to pull it to 3v3.

That would not be a 'pull-up', but rather just a simple divider sized to decrease the +5vdc HIGH voltage to +3.3vdc by simple voltage drop across the resistors. Again pull-up and pull-down is a method to establishing a valid logic voltage for a digital input that would otherwise be just 'floating'.

Lefty

The arduino doesn't have open collector outputs so if you try and pull up to 3V3 you will pull current out of the chip

According to the Atmega documentation, the hardware SCL and SDA pins are open-drain when the 2-wire serial interface is enabled. You would use pull-ups to 3.3v to communicate with a 3.3v device over I2C.

According to the Atmega documentation, the hardware SCL and SDA pins are open-drain when the 2-wire serial interface is enabled. You would use pull-ups to 3.3v to communicate with a 3.3v device over I2C.

I thought someone on this forum mentioned that the Arduino TWI library enables the internal 5v pull-ups for the I2C clock and data pins? Too lazy to search through the code tonignt however. ;)

Lefty

I thought someone on this forum mentioned that the Arduino TWI library enables the internal 5v pull-ups for the I2C clock and data pins? Too lazy to search through the code tonignt however.

Yes, it does. But you can comment out those lines in the Wire library if you want the pullups off.

While we're on the subject, isn't the notion that "You can't expose a pin to a voltage greater than VCC + 0.5v" a relative one?

I know that's what the datasheet says, but doesn't damage to the device depend on the current? Would you really damage a pin if you connected it to a 10v source through a 100M resistor?

yeah, I've been wondering this. I think with your resistor example there might be some sort of voltage divider effect but why would overvolting a pin at low current damage it? I still can't find that video someone talked about.

While we're on the subject, isn't the notion that "You can't expose a pin to a voltage greater than VCC + 0.5v" a relative one?

It is relative in that the pins have clamping diodes with no internal current limiting provided. So one or the other clamping diode will conduct if over Vcc +.5 or under ground -.5.

I know that's what the datasheet says, but doesn't damage to the device depend on the current? Would you really damage a pin if you connected it to a 10v source through a 100M resistor?

The point is that there is no internal current limiting and it's up to the user to provide such current limiting if the clamping diodes are indeed activated. So indeed you are correct, I read of one PIC (I think) official application sheet showing how one can actually wire 120vac to a input pin for say as a timing signal, however there was a many megohm resistor in series to limit the current when above and below the clamping diodes values. The maximum allowable clamping current is specified somewhere in the datasheet.

Lefty

but why would overvolting a pin at low current damage it?

Go back to school.

Solid state physics:- PN junctions have a break down voltage, if this is exceeded damage is done. It's not just over current that damages semiconductors.

I can't go "back" to that class, I have not been there yet. Anyway, why is the breakdown voltage a magic 5v (or in some cases 3.3v)?

I have not been there yet.

it shows.

why is the breakdown voltage a magic 5v

making it bigger costs, cutting cost = more profit so they only design it to what they need it to be.

The answer is less straightforward than I expected but I got the point. Thanks guys!

@wyager

Why you don't exceed the rail voltages -> Dave Explains SCR Latchup http://www.eevblog.com/2009/07/04/eevblog-16-all-about-cmos-scr-latchup/

This video might be a little bit confusing to some people. Dave never mentioned that clamping diodes (at least at the input) are standard in the majority of CMOS chips today (and in all chips we hobbyists are working with.)

We have now the situation to live with those diodes. There are no latch-up issues any longer, rather we have to avoid stressing those diodes.

I read from time to time here in this forum, that one assumes they could bear 1mA. That is not the case. It will do for pulses, but for permanent over- oder under-voltage (which is NOT an issue!) the limit should be designed to some 100uA.

E.g. for the notorious AC mains that would mean 1 MOhms , for 12 volts 47k to 100k and for things around 2 volts (the difference between 5 and 3) 10k to 22k.