user136: If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.
A bare minimum sketch that shows this behaviour:
void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}

Tested with several boards and Mac and Windows versions of the IDE.
Example output - it goes back to "Setup" when I open the serial monitor:

Why is this?

user21030: This fixes the problem 
import os
import sys
import termios
import fcntl

        self.fd = sys.stdin.fileno()

        # Stop resetting the arduino on serial connect

        self.newattr = termios.tcgetattr(self.fd)
        self.newattr[2] = self.newattr[2] & ~termios.HUPCL
        termios.tcsetattr(self.fd, termios.TCSANOW, self.newattr)


user72479: Arduino uses the DTR line (data terminal ready)
So, with the Arduino Serial Monitor it is not possible to change the restart when established the rs232 connection.
But I'm using for example the freeware "HTerm" (under Windows). By default, it does not use the DTR signal.
Meanwhile I changed to the freeware "CoolTerm" (a bit more comfortable...): You have to deactivate "DTR Off" unter "Connection Options".
In Linux I'm using the "moserial". Under "PortSetup" you must deactivate the "handshake" ;-)
This way is more comfortable for me then adjusting the RESET pin. Also, its a nice benefit saving all the data in a log file for later analyzing…

user379: The truth is always in the datasheets, the schematics and the code:
The Arduino UNO actually uses the /DTR line to trigger a reset, as you can see on the following datasheet:


user11: The Arduino uses the RTS (Request To Send) (and I think DTR (Data Terminal Ready)) signals to auto-reset. If you get a serial terminal that allows you to change the flow control settings you can change this functionality.
The Arduino terminal doesn't give you a lot of options and that's the default. Others will allow you to configure a lot more. Setting the flow control to none will allow you to connect/disconnect from the serial without resetting your board. it's quite useful for debugging when you want to be able to just plug in the connector and see the output without having to start the sketch over.
Another way to disable the auto reset is to put a pull up resistor on the reset pin.
Disabling Auto Reset On Serial Connection

136: <p>If I upload any sketch that sends serial data, I immediately see the TX/RX LEDs flash once the sketch is uploaded. If I then start the serial monitor, the sketch appears to restart.</p>

<p>A bare minimum sketch that shows this behaviour:</p>

<pre><code>void setup()
{
    Serial.begin(9600);
    Serial.println("Setup");
}

void loop()
{
  Serial.println("Loop");
  delay(1000);
}
</code></pre>

<p>Tested with several boards and Mac and Windows versions of the IDE.</p>

<p>Example output - it goes back to "Setup" when I open the serial monitor:</p>

<p><img src="https://i.stack.imgur.com/mokWb.png" alt="Restart"></p>

<p>Why is this?</p>
 21030: <p>This fixes the problem </p>

<pre><code>import os
import sys
import termios
import fcntl

        self.fd = sys.stdin.fileno()

        # Stop resetting the arduino on serial connect

        self.newattr = termios.tcgetattr(self.fd)
        self.newattr[2] = self.newattr[2] &amp; ~termios.HUPCL
        termios.tcsetattr(self.fd, termios.TCSANOW, self.newattr)
</code></pre>
 72479: <p>Arduino uses the <strong>DTR line</strong> (data terminal ready)</p>
<p>So, with the Arduino Serial Monitor it is not possible to change the restart when established the rs232 connection.</p>
<p>But I'm using for example the freeware &quot;HTerm&quot; (under Windows). By default, it does not use the DTR signal.
Meanwhile I changed to the freeware &quot;<strong>CoolTerm</strong>&quot; (a bit more comfortable...): You have to deactivate &quot;DTR Off&quot; unter &quot;Connection Options&quot;.
In Linux I'm using the &quot;moserial&quot;. Under &quot;PortSetup&quot; you must deactivate the &quot;handshake&quot; ;-)</p>
<p>This way is more comfortable for me then adjusting the RESET pin. Also, its a nice benefit saving all the data in a log file for later analyzing…</p>
 379: <p>The truth is always in the datasheets, the schematics and the code:</p>

<p>The Arduino UNO actually uses the <code>/DTR</code> line to trigger a reset, as you can see on the following datasheet:</p>

<p><a href="https://i.stack.imgur.com/zWoHK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zWoHK.png" alt="reset schematic"></a></p>
 11: <p>The Arduino uses the <a href="http://en.wikipedia.org/wiki/RS-232_RTS/CTS#RTS.2FCTS_handshaking">RTS (Request To Send)</a> (and I think <a href="http://en.wikipedia.org/wiki/Data_Terminal_Ready">DTR (Data Terminal Ready)</a>) signals to auto-reset. If you get a serial terminal that allows you to change the flow control settings you can change this functionality.</p>

<p>The Arduino terminal doesn't give you a lot of options and that's the default. Others will allow you to configure a lot more. Setting the flow control to none will allow you to connect/disconnect from the serial without resetting your board. it's quite useful for debugging when you want to be able to just plug in the connector and see the output without having to start the sketch over.</p>

<p>Another way to disable the auto reset is to put a pull up resistor on the reset pin.</p>

<p><a href="http://playground.arduino.cc/Main/DisablingAutoResetOnSerialConnection">Disabling Auto Reset On Serial Connection</a></p>
