Arduino Nano: avrdude: ser_open(): can't open device "\\.\COM5": Access is denied

It is my first time using arduino nano, im just making a simple project about ir sensors that when they detect an object, 2 buzzers activates, and when I uploaded my sketch, it was first stuck on "uploading". After a pc restart and a few com port switches, this error appeared: `avrdude: Version 6.3-20190619
Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
Copyright (c) 2007-2014 Joerg Wunsch

     System wide configuration file is "C:\Users\Exceed\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17/etc/avrdude.conf"

     Using Port                    : COM5
     Using Programmer              : arduino
     Overriding Baud Rate          : 115200

avrdude: ser_open(): can't open device "\.\COM5": Access is denied.`

Need help pls

Do you use the serial monitor?

If yes, please close it when uploading code.

Regards
Stefan

1 Like

i changed the code to a simpler one. Just blink the built-in led of the arduino nano,

void setup() {
  pinMode(13, OUTPUT);  // Set digital pin 13 as an output
}

void loop() {
  digitalWrite(13, HIGH);  // Turn on the LED
  delay(1000);             // Wait for 1 second
  digitalWrite(13, LOW);   // Turn off the LED
  delay(1000);             // Wait for 1 second
}

and i removed all the components, it is only the nano connected to the port of my pc.
this is the result:

also i just noticed that the IDE does not recognize the board, i think? because usually it says in Tools > Port: "COM5" > COM5 (whatever arduino it is), but in my case it just says the COM5 port:

The Nano uses a generic TTL-to-USB adapter; hence you don't see the word Nano next to the port.

1 Like

Hi @shidou-san. Are you using the Arduino IDE's "Serial Plotter" feature? If you are not sure what I'm referring to, this feature is accessed either by clicking the plot icon near the top right corner of the Arduino IDE menu or by select Tools > Serial Plotter from the Arduino IDE menus.

i just tried the serial plotter, i can somewhat understand it in here: https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-serial-plotter

but i dont know how to interpret mine:

My previous reply wasn't intended to instruct you to use Serial Plotter (though of course I encourage you to use this tool if you find it useful). The reason I asked whether you were using it is because, as with Serial Monitor, it is possible for Serial Plotter to interfere with the IDE's ability to open the port of the Nano to upload a sketch, producing the "Access is denied" error under some specific conditions.

You just solved my problem. Tho this was the first time i used the serial plotter, the nano is somehow working after i closed the feature.

Thanks!

I'm glad it is working now. Thanks for taking the time to post an update.

The Arduino IDE developers are tracking the bug of Arduino IDE's Serial Monitor and Serial Plotter interfering with the upload process here:

If you have a GitHub account, you can subscribe to that issue to get notifications of any new developments related to this subject.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.