mathematica ruins serial interface???

Opening the Serial port in Mathematica can reset your Arduino (depends on how connected)

Can you post the Arduino part of your code?