Output Pin protection when connecting two boards

Hi guys, I'd really appreciate some advice about something I am trying to achieve. I have got an Arduino Mega and an ESP32. What I am looking to do is connect both of them to two ULN2003 stepper driver boards however only one microcontroller board would be powered and driving the stepper boards at any one time. The idea is that I can drive the steppers from either microcontroller board. I have attached a diagram to try and explain what I am looking to achieve.... the boards are just for representation. Wires are not connected to the pins shown) hopefully it makes sense.

So my question is, do I need to protect the outputs pins on each Arduino board to prevent any damage / strange effects by having it connected (albeit powered down) while the other board is operating? Or is this just a bad idea from the start and I need to approach the problem in a different way?

I have very basic understanding of electronics and that's why I wanted to check with people who'd be able to advise me.

Many thanks in advance

M

You'll need wired-OR connections.

Each output pin connects through a diode (anode to the output pin, cathode to the driver board input).
Add a 4k7 resistor to ground from the driver board input too perhaps (this might be superfluous, the
chip on the board may already provide this).

1N4148 signal diodes are just the ticket for this sort of application.

Thank you so much, I really appreciate your help :slight_smile:

MarkT:
Add a 4k7 resistor to ground from the driver board input too perhaps (this might be superfluous, the
chip on the board may already provide this).

An indeed it does. :grinning:

Thanks for the additional information Paul. Much appreciated

One motor requires only one driver board.
Just switch the outputs of the powered Arduino
to the inputs of the driver.