How to use in C# serialPort.Open() without doing an Arduino reset?

the question is in the title:
i want to use a C# console which send a string to the Arduino.
The console connect the computer to the arduino by serial port and then, send the string to the Arduino.
My problem is that when the console use serialPort.Open(), the Arduino is automatically reset. i would not reset the arduino when i'm connecting the computer with it.
Do you have any ideas?

Hello and welcome,

Yes, Serial will reset, it’s a feature that allow to reprogram your arduino without having to press the reset button manually.

Edit: Use SerialPort.DtrEnable = false;. I’ve just tested and it works.

Ok, thanks for your answer.
But my question is: can we choose to not reset the Arduino when we are using Open() ?
I would create an interface like the Serial monitor available in visual studio. With this monitor, we can connect the computer with the Arduino without doing an Arduino reset.
Do you think that kind of interface is possible?

Yes, you can choose by setting DtrEnable to true or false.

Basically this was my test:

serialPort1.PortName = "COM5";
serialPort1.BaudRate = 115200;
serialPort1.DtrEnable = false;


There is a small problem, it's that if the Dtr was enabled before you disconnect from the serial port, then disable Dtr, then reconnect, the arduino will still reset once. But once this happened, you can disconnect/reconnect serial port and the arduino won't reset anymore. And vice versa.

Thank you very much!! it works very well now :slight_smile:
serialPort1.DtrEnable = false; was the code i was looking for !

There are also hardware methods of disabling the Arduino automatic reset feature. Google should be able to find them for you.


Don't need Google for that.
On the Uno for example, just cut the RESET EN jumper between the 2 solder pads.
It's located next to the big crystal.

I prefer keep my uno like it was at the beginning, i wont cut anything from it :smiley:

There are also hardware options that do not involve cutting.