What constitutes a short circuit on an OUTPUT pin?

From the fine Digital Pins Tutorial we have this quote:

Short circuits on Arduino pins, or attempting to run high current devices from them, can damage or destroy the output transistors in the pin, or damage the entire Atmega chip. Often this will result in a "dead" pin in the microcontroller but the remaining chip will still function adequately. For this reason it is a good idea to connect OUTPUT pins to other devices with 470Ω or 1k resistors, unless maximum current draw from the pins is required for a particular application.

Does this mean that an OUTPUT pin should never be shorted directly to 0v or that an OUTPUT pin should never be shorted directly to 5v? I've seen both types of shorts in various tutorials, usually via a SPST switch.

dotancohen:
Does this mean that an OUTPUT pin should never be shorted directly to 0v or that an OUTPUT pin should never be shorted directly to 5v?

Absolutely!

dotancohen:
I've seen both types of shorts in various tutorials, usually via a SPST switch.

Really? Cite some? (Unless they are "instructables". :cold_sweat: )

Obviously input pins often go to switches; unless the code "accidentally" sets those pins to OUTPUT, it should not be a problem.

Paul__B:
Absolutely!

Absolutely what? Absolutely never directly to 0v?Absolutely never directly to 5v?

Really? Cite some? (Unless they are "instructables". :cold_sweat: )

Obviously input pins often go to switches; unless the code "accidentally" sets those pins to OUTPUT, it should not be a problem.

Off the top of my head, the Pushbutton Tutorial shorts to ground while the button is depressed.

int inPin = 7;   // choose the input pin (for a pushbutton)

The switch is connected to an input, not output. An input is a very high resistance to ground (10’s of meg Ohms at least) so virtually no current flows into or out of an input.

dotancohen:
Off the top of my head, the Pushbutton Tutorial shorts to ground while the button is depressed.

You have to be more detail oriented to read and write code, or you will confuse yourself like this.

That pin is set INPUT, not OUTPUT.

AVR pins can have 1 of 4 modes and can change mode in less than a microsecond.

OUTPUT LOW — tries to be 0V, can safely sink 25mA continuously, maybe even 30mA but may need cooling. Never connect directly to 5V or OUTPUT HIGH pin.

OUTPUT HIGH — tries to be 5V, can safely source 25mA continuously, maybe even 30mA but may need cooling. Never connect directly to GND or OUTPUT LOW pin.

INPUT LOW (or just INPUT, default is LOW) — when not being read is effectively electrically neutral, does not source or sink current. Each digital read will sink about 1 microAmp of charge, almost nothing.

INPUT HIGH — tries to be 5V through 20K to 50K Ohms resistance (very easy to drain LOW) always. Each digital read is the same as above. The internal resistance makes grounding the pin safe, mode is INPUT_PULLUP.

It is the OUTPUT pins that often need protection from too much current.

I had a problem testing an alarm system by shorting INPUT_PULLUP pins to ground. loud pops, reset the program

I started with 47 k resistors and worked my way down. I found that the system would trigger reliably at 47 ohms, without drama or damage

GoForSmoke:
You have to be more detail oriented to read and write code, or you will confuse yourself like this.

That pin is set INPUT, not OUTPUT.

Correct, thank you for being blunt. I appreciate honesty and frankness!

I will take care to ensure that OUTPUT pins are neither shorted to ground nor shorted to Vcc.

That is simply impossible on an Arduino that works correctly. "Shorting" an INPUT_PULLUP pin to ground is exactly what they were designed for. The resistance of these pull-ups is very high (> 30kΩ), so at the low voltages used by a microcontroller, only a very tiny current will flow.
The behavior you were seeing must have been caused by a different problem with your connections and/or code.

Pieter

dotancohen:
Does this mean that an OUTPUT pin should never be shorted directly to 0v or that an OUTPUT pin should never be shorted directly to 5v? I’ve seen both types of shorts in various tutorials, usually via a SPST switch.

It’s basically current that can damage the pin.
If the pin is set HIGH, and <120 ohm is connected between pin and ground, >40mA will flow (absolute max pin current).
A short is (almost) zero ohm…
Likewise if the pin is set LOW, and the load (short) is connected to 5volt.
In theory, no current will flow if an output pin is set LOW and connected to ground. Likewise for HIGH and 5volt.
Leo…

dotancohen:
Correct, thank you for being blunt. I appreciate honesty and frankness!

Then you won't get ground down by the compiler, a patch-worthy coding skill for sure!

Hi,

Wawa:
If the pin is set HIGH, and <120 ohm is connected between pin and ground, >40mA will flow (absolute max pin current).

I was poking around with a simple circuit, output pin to an Opto-Isolater input, other Opto pin to ground, and I forgot to include a current limiting resistor. Some hours later I saw what I’d done so I connected an AVO to measure the current, 78 mA.

This is on a cheap Uno clone and it doesn’t seem to be damaged.

I added a resistor to be ‘safe’ but was I just lucky or can some boards handle higher current?

Peter

Peterd51:
I was poking around with a simple circuit, output pin to an Opto-Isolater input, other Opto pin to ground, and I forgot to include a current limiting resistor. Some hours later I saw what I'd done so I connected an AVO to measure the current, 78 mA.

OK, the "Absolute maximum rating" is not telling you what the output can provide if you abuse it, it is telling you what is not safe to abuse and if you do, may damage it in some - unspecified - manner and extent.

The effective internal resistance of an Arduino pin is something like 45 Ohms. In your case, 5 V / 78 mA is in fact, 64 Ohms which is quite correct - I said "something like 45 Ohms" and it is non-linear so it actually changes with the current drawn. More like 45 Ohms if you are drawing a sensible current.

Peterd51:
This is on a cheap UNO clone and it doesn't seem to be damaged.

Well, you don't know, do you? It may fail tomorrow, or it may fail in 2025. (Channelling Grumpy Mike here. :grinning: ) Nothing to do with clone or genuine UNO.

Peterd51:
I added a resistor to be 'safe' but was I just lucky or can some boards handle higher current?

Depends what you mean by "handle", doesn't it? :astonished: See previous paragraph.

Hi,

thanks.

It’s working for now and at the current prices for these things it’s not a problem if I goes in the bin.

Peter

Uno clone board will have an AVR on it, they are not cloned.

I wouldn't expect an AVR pin to put out 60mA long enough for me to pull the jumper.

Hi,

all I can say is that I had one drawing 78mA for a few minutes at a time, spread over around 3 days, as I tested different timing sequences. Initially just flashing a LED and then sending pulses into my juke box.

I was using my mobile phone to record the sound of the stepper in the receiver as it clicked around, then I played that recording back through a sound to graph program on the PC to check that it had been sent the right numbers of pusles.

Peter

Oh, very short pulses of 78mA?

Is your board an Uno with the chip in socket? If so, you can bootload a new chip and when the current one quits, replace with the new one. The socket is there for that or remove one chip to go in a stand-alone project and put the new chip on the -development- board... Uno is not designed for end-products.

dotancohen:
From the fine Digital Pins Tutorial we have this quote:

Does this mean that an OUTPUT pin should never be shorted directly to 0v or that an OUTPUT pin should never be shorted directly to 5v? I've seen both types of shorts in various tutorials, usually via a SPST switch.

Both

dotancohen:
Off the top of my head, the Pushbutton Tutorial shorts to ground while the button is depressed.

A pushbutton connected to an Arduino pin is working with an INPUT. Connecting an input to ground or +5 is OK and will simply read back as LOW or HIGH, respectively. Connecting a pin set as an OUTPUT to ground or +5, however, will damage or destroy the pin or maybe the entire Arduino.

GoForSmoke:
Then you won't get ground down by the compiler, a patch-worthy coding skill for sure!

That even confused me.

As a response to

"Correct, thank you for being blunt. I appreciate honesty and frankness!"

are you still confused, assuming that you write or have written much compiled code?