Ad Space — Top Banner

Sketch Not Running After Upload

Arduino Microcontroller Board

Severity:

What Does This Error Mean?

Arduino sketch uploaded successfully but not running usually means the sketch has no visible output in its current state, the wrong board was selected (sketch is uploaded to the wrong chip), or the board is not receiving stable power after upload. Add a blinking LED to setup() as a diagnostic.

Affected Models

  • Arduino Uno
  • Arduino Mega
  • Arduino Nano
  • Arduino Leonardo
  • Arduino Micro
  • All Arduino-compatible boards

Common Causes

  • Sketch has no output — if the code reads inputs and acts on conditions, nothing may happen with no input
  • Wrong board selected — sketch uploaded to wrong bootloader and runs incorrectly
  • Power cycle required — some boards need a manual reset after upload to run the sketch
  • Crystal or oscillator not stable — board runs but at incorrect speed causing erratic behavior
  • First setup() function call crashes — an early error in setup() prevents the rest from running

How to Fix It

  1. Add a visible LED blink to setup().

    Add: pinMode(LED_BUILTIN, OUTPUT); digitalWrite(LED_BUILTIN, HIGH); delay(1000); digitalWrite(LED_BUILTIN, LOW); to the very start of setup(). Upload and watch the built-in LED. If the LED blinks once, setup() is executing and the issue is later in your code. If nothing happens at all, the sketch is not running.

  2. Press reset immediately after upload.

    Some Arduino-compatible boards (especially CH340 clones) require a manual reset button press to start the sketch after upload. Press the RESET button on the board immediately after the 'Done uploading' message appears in the IDE.

  3. Verify the correct board is selected.

    In Arduino IDE, check Tools > Board and Tools > Processor match your actual hardware. A sketch uploaded to 'Arduino Uno' that targets an actual Nano with CH340 bootloader may upload but not run correctly. Also check Tools > Port is the correct COM port.

  4. Open Serial Monitor and check for output.

    Add Serial.begin(9600); and Serial.println("setup started"); to setup(). Open Serial Monitor at 9600 baud. If 'setup started' appears, setup() is running but the rest of your code has an issue. No output means setup() never starts.

  5. Upload a basic Blink sketch.

    From File > Examples > 01.Basics > Blink, upload the standard Blink example. If the built-in LED blinks once per second, the board and IDE are working correctly and the problem is in your original code. If Blink also fails, the bootloader or board may need service.

When to Call a Professional

If a verified simple blink sketch does not run on a brand-new Arduino, the chip may have a defective bootloader. Request a replacement from the supplier.