6
votes

My Arduino Uno was all set up and was working fine.

Project: Arduino controls a 9v motor depending on the command given. As the Arduino only provides 5v, I added a 9v battery to it through a transistor

I decided to add new code into the Arduino but when I tried it failed. I have uploaded code thousands of times before (successfully) all of a sudden the IDE keeps giving the following message

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

I have looked up for a lot of solutions on this forum and elsewhere. Here are the things I have tried so far:

  1. Changing the COM port
  2. Disabling all the other devices CONNECTED to COM
  3. Tightening the CONNECTIONS
  4. Re installing all the drivers and the IDE
  5. Rebooting the system
  6. Using another laptop to upload code

All the above have given me the same output for some reason. The built in LED light and the power LED switch on when the board is connected to a power source (my laptop). Could the board have been damaged by any chance? How can I check if the board is spoilt? Should I buy a new board?

4
Have you tried using a Linux laptop (no virtual machine - the serial timings won't be stable enough) ? Also try to upload the code using the command line, I've found this tool claiming to be able to do that, but I suggest you also search for other options (Google "arduino upload command line"). Good luck.user2629998
Are you only using the Arduino IDE to connect to the Uno? I've seen similar issues on Windows when I've tried to upload Arduino code using avrdude whilst the serial port is already being used by another process.Matthew Murdoch
@AndréDaniel thx a lot , still not workingm0bi5
@MatthewMurdoch Yes I am using Arduino IDEm0bi5

4 Answers

1
votes

this may help;

  1. remove the mcu from the board and connect the board to your PC.
  2. try to open the com port.
  3. if it opens, short TX pin to RX pin.
  4. send some data and check if you are getting the data back. this way you can make sure your usb-ttl is not damaged.
0
votes

With my verry limited experience with Arduino I've seen that the IDE sometimes resets the saved arduino on startup. Press extra -> Board -> yourboard and try again.

0
votes

make sure you have the right ports COM1 and COM1 activate it too in arduino

0
votes

Once it happened to me that a defective USB cable was the culprit. For one board it gave messages like

avrdude: stk500v2_ReceiveMessage(): timeout

But for another board I also got these messages "can't open device - access denied". It's always worth to try another cable.