7 Reasons you should know why your Arduino Code Is Not Uploading – how to do it

Arduino connecting with the laptop trying to upload sketch

The feelings when you successfully upload your code in the Arduino is indescribable, but it can get reversed within no time because of the code you wrote it, not uploading on the board.

I know how frustrating it’s to be when your code doesn’t upload it on the board.

When I first started out I faced dozens of problems while uploading the sketch, but I made it in the end. Do you want to know what common problems I faced while uploading the code?

One of the foremost irritating mistakes I’ve confronted during my projects is when my Arduino code isn’t uploading. Numerous times the reason behind each blunder was distinctive. After investigating this blunder over and over, I thought of writing down my encounters and sharing them in an accommodating post.

So, here are six reasons your Arduino code is not uploading.

The foremost common reasons your Arduino code isn’t uploading are

  1. Errors within the connection
  2. Wrong port selection
  3. Incorrect Code
  4. Drivers not installed
  5. The board needs resetting
  6. Presence of a brief circuit.
  7. Check you have selected the right board

Reasons why Arduino code is not uploading on the board

1. Errors within the connection

One of the reasons why your Arduino code might not be working is because of blunders within the association between the Arduino board and your PC.

One can utilize a type A/B USB cable to put through the Arduino UNO and MEGA boards through the USB port of a computer, which is alright. But, since we use such cables for numerous other applications like charging our mobiles, they can effectively cause an error.

Moreover, another blunder in the connection may be due to your computer’s USB port. In case it’s not working, your computer won’t recognize the Arduino board; subsequently, you won’t be able to upload your Arduino code.

Similarly, a harmful Arduino USB port may cause the same problem.

Recommended Reading – I composed a step-by-step guide for uploading code to Arduino UNO board, which incorporates subtle elements on stopping within the right cables.

2. Check you have selected the right board

selecting the right board in Arduino IDE software

Source: Arduino.cc

Selecting the wrong board on the Arduino IDE software is a common problem, and students don’t really focus on that. It is extremely important that it should match with the board.

How to do it

  1. Check what board you are using if that’s a mega, or Genuino, or UNO then go to tools menu in the Arduino IDE.
  2. Check out the board on the tools.
  3. Select the right board you are using.

3. Wrong port selection

selecting the right COM port in Arduino IDE software

The port number through which Arduino IDE transfers the program to the board plays a critical part. Sometimes when uploading your code, make beyond any doubt that the port number chosen by your Arduino IDE matches the port number at which you interface your Arduino board. (both the ports should match at any cost, if it doesn’t match, go to settings and select the Arduino port)

To do so, interface your Arduino board to your PC and open the Arduino IDE. At that point, see the lower right side of the window to discover at which port the Arduino is associated. A case content composed on the blue stripe at the foot of the window may well be “Arduino UNO on COM17”.

This line demonstrates that your Arduino UNO board is interfacing through the serial port COM17, and that’s where the Arduino IDE ought to transfer the code.

How to check in the project that the Arduino IDE is selecting the proper port?

  1. Click on the “Tools” menu display on the beat cleared outside of the Arduino IDE window.
  2. In the drop-down menu, float over the “Ports” menu.
  3. Then select the port where your Arduino board is connected.

In the project that it is as of now chosen (you’ll take note of a little tick adjacent to it), which means this isn’t the reason why your Arduino code isn’t uploading. So, let’s move on to another conceivable issue.

4. Incorrect Code

The best lessons are the ones that you just learn from your botches. In case you’re unable to transfer your code, at that point you wish to check for mistakes in your program and adjust them. It’s totally Alright to form botches when composing an Arduino code, so in the event that you’re one of those individuals who concludes up with a list of mistakes after composing a program. Don’t worry! Arduino IDE comes with a built-in compiler a bit like many other programming stages.

This compiler is capable of checking mistakes and uploading an error-free program to your Arduino board. After the compiler checks your program, the list of mistakes will appear at the foot of the screen, which you’ll rapidly distinguish, and correct.

5. Drivers not installed

Arduino driver not installed, and updating from the windows

Each computer program on your computer needs a driver to run since it empowers the working framework to communicate with that particular computer program. So also, Arduino requires drivers to operate correctly. Your Arduino code might not be uploading since there are incongruent or obsolete drivers or straightforwardly no drivers introduced at all. To check whether you’ve got the right drivers introduced on Windows, open the gadget chief display within the control board of your PC. You’ll discover your Arduino board is recorded.

How to solve the Arduino driver problem

  1. To upgrade the Arduino driver to the most recent adaptation accessible, right-click on the title of your Arduino board and tap on “update driver.”
  2. After upgrading the Arduino drivers, go back to your Arduino IDE and check if the case presently recognizes your board through the “Tools” menu, as clarified previously.
  3. Installing the right drivers and keeping them overhauled ought to unravel this issue, and you’ll be able to transfer your code without any issues.

6. The Board Needs Resetting

Arduino UNO, a microcontroller with atmega2566
Arduino UNO board

Why your Arduino code isn’t uploading may be that your board has been running for too long and needs a break. All it needs could be a thrust on the little reset button embedded in it. In case the reset button on your Arduino board is blocked off (due to outside shields), at that point, you’ll attempt to interface a thrust button as a reset button.

7. Presence of A Brief Circuit

A brief circuit on your board can happen in the event that you’ve joined the 5V stick to the ground stick. This mistake more often than not happens when working on an extent that has as well numerous jumper wires going here and there, one can effortlessly make the botch of interfacing the control stick to the ground stick.

When this happens, your PC naturally disengages your Arduino board from the port, and thus, you won’t be able to transfer your code. If you were able to transfer your code sometime recently making those changes in your extended circuitry, then a brief circuit may well be the guilty party behind this transfer error.

Disconnect your Arduino board from the computer and check all the associations including the 5V and GND pins. In case you discover that the 5V and GND pin are incidentally shortened, amend the blame and attempt uploading your code once more.

On the off chance that you have got effectively overseen distinguishing the reason why your Arduino code isn’t uploading, at that point, you must move on to the best step; troubleshooting.

What should you do next?

It’s frustrating when you are at the urge of uploading your last sketch and you get an error while uploading. Don’t get stressed out, I even fried so many Arduinos while troubleshooting.

Troubleshooting is something that you need to master, and this would make your hard tasks easy. The most common problem is selecting the wrong port or using a cheap local USB Port. So you can buy a USB cable from the official website which is specially made for Arduino, and your ports need to be matched.

FUN TIP: Make sure you buy the exchangeable USB cable. So, in case of any inconvenience, you can replace it with the new one.

Frequently Asked Questions About The Code Not Uploading

1. Why can’t I upload my Arduino program?

Getting errors on uploading an Arduino Program is a bit complex, and I can’t conclude it with that one specific reason, but the most common problem is the wrong port selection.

2. How do I know if my Arduino is damaged?

There are so many reasons that your Arduino is fried or damaged, but the most common one is applying an excessive voltage to the recommended one. You can get an idea that your board is probably damaged, the light on the board would stop blinking.

Recommended Reading: 

If you are not sure why your project is not working, then there’s a detailed guide on why your Arduino is fried up. It will give you a reason why your Arduino is working, double-check everything, and make it work again.

Mataf Khan

An electronics enthusiasts from childhood became an electrical engineer, I've been playing with Arduino and other electronics gadgets like raspberry pi since when I was 14. and have a passion of troubleshooting Arduino problems.

Recent Posts