Why arduino due are so fragile ? Power and pin protection good practice

I ll try to connect the pwm with optocoupleur.
Also I ll protect the rxtx from the due to the mega because it is not the same voltage.
I hope this would be enough.

While I’m here … it’s worth having a look around at how to make a tidy reliable installation - which will also help you identify faults .
Bring all your power supplies to a connection strip in one position , and use colour coded wiring from then on - say black for 0v, red for 5v , orange for 3.3v - whatever you like to each or your circuits . Look at fusing all power supplies .Secure wires to the back board or sides and keep signal wires away from heavy current carrying cables , and record the circuits , as you go on paper .

You can get terminal strips and bits of trunking very cheaply off eBay

Wow, an original C-T UniBomb! Complete with bus powered fire starters at the bottom of the panel mounted on the red glastic standoffs.

Nice one Hammy. Thanks for memories!I haven’t had to touch one of those nasty drives for about 15 years.