Connecting two uno digital pins

can I connect a digital pin from one uno to another (one INPUT the other OUTPUT) without damage?

Please give more info on why and how.

If both Arduinos have the same supply voltage, it should be ok. 1k R between them to limit any current would make it safer.


You also need to connect the ground wires between the two Arduinos as well.

1k R between them to limit any current would make it safer.

This is an old chestnut. It is only safer if you screw up two other things at the same time.

Specifically you need to either:

  1. ensure that both Uno's are always powered up or powered down together
  2. add a resistor so that you don't back-power the receiving end from the other if it is powered
    and the receiver isn't. 4k7 might be a safer value than 1k as protection diodes aren't designed for
    continuous currents.

3) use open-collector drive and a pull-up resistor at the receviing end. Then it doesn't matter if
the transmitter is powered and the receiver isn't or vice versa.

For the Arduino open-collector (well, technically open-drain) drive is done thus:

void setup ()
  pinMode (pin, OUTPUT) ;  // output is LOW when OUTPUT, floating in INPUT - ie open-drain

void openCollectorWrite (byte pin, boolean value)
  pinMode (pin, value ? INPUT : OUTPUT) ;

The receiving end uses pinMode (pin, INPUT_PULLUP);.
If the transmitting end is powered down it will pull the signal LOW (due to protection diodes).

Thanks for you quick, excellent advice. My idea here is for a simple interface to be able to read status from one Uno to the other by periodically polling.

OK, use the 1k resistor then.