Known problem since Bitx40. The Arduino takes? more current to make its change, creating a current spike on the power rail. The cure is to absorb some of the power drop in the Raduino's 5V regulator leaving it some 'headroom' to actually do its job (it's typically run close to its maximum power rating). Typically a 5 (4.7 or 5.6) ohm resistor does the trick: it needs a 3-watt rating. Put that in series with the Raduino's 12V supply, with a 100uF 16V electrolytic capacitor to Earth (0V) across it at the Raduino. That way the 100uF Cap supplies the energy rather than the whole supply, so that main supply is not drained for that brief instant. (Theory for the advanced: a 500uS RC filter).