How to Upload Code in Arduino UNO: Step-by-Step Guide for Beginners
What does “uploading code” mean?
Uploading code means sending the program (called a “sketch”) from your computer into your Arduino board, so the board runs it on its own — even after you unplug it from the computer.
Before you start, Arduino IDE must be installed on your computer. If you have not installed it yet, follow our first guide: How to Download Arduino IDE: Step-by-Step Guide for Students in Pakistan.
Before you start: what you need
- Arduino IDE installed on your computer
- An Arduino board, for example the Arduino UNO R3 DIP with USB Cable
- A data USB cable (not a charge-only cable — charge-only cables cannot upload code)
- A computer (Windows, Mac or Linux)
New to Arduino? The Arduino Starter Kit UNO DIP includes the board plus the components most student projects need.
Step 1: Connect your Arduino UNO to the computer

- Connect your Arduino UNO to the computer with the USB cable.
- The green power LED (marked ON) on the board should light up. If no LED lights up, try another USB port or another cable.
Step 2: Select the board and the port

- Open Arduino IDE.
- At the top of the IDE window, click the board selector dropdown (it says Select Board if nothing is selected yet).
- Select Arduino Uno and the port your board is connected to (on Windows it looks like COM3, COM4, etc.), then click OK.
- Alternatively, use the menus: Tools > Board > Arduino AVR Boards > Arduino Uno, then Tools > Port and select your board’s port.
No port showing in the list? This is the most common problem for students in Pakistan, because many UNO boards use the CH340 USB chip. In that case you need the CH340 USB driver first — see our guide on the NodeMCU ESP8266 CH340 WiFi Board for the driver setup. After installing the driver, unplug the board, plug it back in, and the port will appear. Also check that your cable is a data cable, not charge-only.
Step 3: Open a sketch (example: Blink)

- In Arduino IDE, go to File > Examples > 01.Basics > Blink.
- A ready-made sketch will open. It turns the small built-in LED (marked L) on the board on for one second, then off for one second, again and again.
- You can also write your own sketch in the editor — but for your first upload, Blink is the perfect test.
Step 4: Verify your sketch (compile check)

- Click the Verify button (the checkmark icon at the top left of the IDE).
- The IDE will compile your sketch. At the bottom you will see “Compiling sketch…” and then a message that it finished without errors.
- If there is an error, it will be shown in red at the bottom — read it, fix the mistake in your code, and click Verify again. Never skip this step: verifying first saves you from confusing upload errors later.
Step 5: Upload the sketch to the board

- Click the Upload button (the right-arrow icon next to Verify).
- The IDE will compile the sketch again and then upload it. During upload, the TX and RX LEDs on the board will blink rapidly — that is normal.
- Wait for “Done uploading” at the bottom of the IDE. Do not unplug the board while uploading is in progress.
Step 6: Check the result

- After “Done uploading”, the small orange LED (marked L) on your UNO will start blinking — one second on, one second off.
- That blinking LED is your proof: the code is now inside the board, and the board will keep running it even if you unplug it and power it separately.
- Optional check: open Tools > Serial Monitor (or the magnifier icon at the top right). If your sketch prints messages with
Serial.println(), they will appear here. Make sure the baud rate in the Serial Monitor matches the rate in your sketch (usually 9600).
Common upload errors (and quick fixes)
- No port in the list: Install the CH340 driver (see Step 2), try another USB port, and make sure your cable is a data cable.
- “Not in sync” / timeout error during upload: Wrong board or wrong port selected — re-check Step 2. Also press the reset button on the board once and try uploading again.
- “Access denied” on the port (Windows): Close any other program using the serial port, including the Serial Monitor in another IDE window, and try again.
- Compilation error before upload: There is a mistake in your code. Click Verify first and read the red error message at the bottom — it usually points to the exact line.
- Upload starts but never finishes: Unplug the board, plug it back in, select the port again, and upload once more.
Get your Arduino parts in Lahore
Everything students need — Arduino UNO boards, USB data cables, sensors, motors and complete starter kits — is available at QKZEE Technologies, Shop #20, 1st Floor, AL-KHALIL Center, Hall Road, Lahore. You can also order online with Cash on Delivery across Pakistan, or ask on WhatsApp at +92-302-8577025.
Still stuck? We are here to help
If any step is unclear, message us on WhatsApp and we will guide you — or watch our YouTube channel for video guides and project tutorials.
FAQs
Do I need Arduino IDE installed before uploading code?
Yes. Uploading is done from inside Arduino IDE. If you have not installed it yet, follow our guide: How to Download Arduino IDE.
Which board should I select for my UNO?
Arduino Uno (under Arduino AVR Boards). Selecting the wrong board is the most common cause of upload errors.
My board is connected but no port appears — what do I do?
Install the CH340 USB driver (many boards sold in Pakistan use the CH340 chip), try another USB port, and confirm your cable is a data cable, not charge-only.
How do I know the upload worked?
The IDE shows “Done uploading” and your board starts running the new code — with the Blink example, the built-in LED starts blinking.
Can I upload code to Arduino Nano or ESP32 the same way?
The steps are the same, but you must select the correct board in Step 2. ESP32 boards also need their board package installed once from Tools > Board > Boards Manager.
What is the difference between Verify and Upload?
Verify only compiles your code on the computer and checks it for errors. Upload compiles it and then sends it into the board. Always Verify first, then Upload.






