Fault-Tolerant output

I am building a small handheld tester for pixels using a nano, and I want the output to be fault-tolerant, so that if the pixel input is shorted to ground or +12v, it will not damage the tester. So I am looking for a simple little buffer circuit to connect between the nano’s output pin and the test lead going to the [possibly shorted] pixel. Suggestions?

(Alas, google and bing searches have failed me. No matter what other keywords I use and no matter how specific I get, neither search engine is giving me relevant results. They focus too much on the “fault tolerant” part and I am flooded with other results for protocols and software. Closest I could fine was fault-tolerant RS-485.)

Consider the Ruggeduino, or copy their input/output circuit.

This protection circuit means:

Every I/O pin can have up to 24V applied to it and will still not be damaged.
Every I/O pin can be short-circuited to ground and will still not be damaged
Every I/O pin can be short-circuited to another I/O pin and will still not be damaged

150 ohm resistor? By testing I presume you mean driving a standard logic signal?

The output pin should be limited to 30mA or less ideally, which 150 ohms will do without
much affect on an output logic signal.

The 12V issue requires something like a schottky-diode to the 5V rail (cathode to rail, anode
to Arduino pin), so that 12V on the line will be limited by the 150 ohm resistor to about 45mA
through the diode to the 5V rail.

Then a 5.1V zener between 5V and GND to prevent the 5V rail lifting up to 12V. You might find
a 5.1V conducts too much at 5V, in which case add a shottky in series to increase its effective
voltage a bit higher.

Raising the 150 ohm resistor higher will reduce fault currents more, but at the expense of slowing
down the logic edges a little - I wouldn't go higher than 1k for that reason.