This one is all setup. Nothing is soldered, nothing can break, and by the end you will have made an LED on the board flash. That matters more than it sounds: it proves your laptop, your cable, your board and the software all talk to each other. Every problem after this is a problem with your code, not your kit.
| You need | Notes |
|---|---|
| An Arduino Uno R3 or a clone | Clones are fine and much cheaper. They may need an extra driver, see step 1. |
| A USB cable that carries data | Uno R3 uses the big square USB-B plug. Some cables only carry power, and that is the usual reason a board never shows up. |
| A laptop | Windows, macOS or Linux. A school laptop may block installing software, see the note below. |
| About twenty minutes | Most of it waiting for the download. |
The Arduino Cloud Editor runs in a browser at app.arduino.cc and needs only a small plugin to reach the USB port. Everything in these tutorials works there too. If even that is blocked, ask whoever runs IT for the desktop IDE by name: it is free, open source and widely used in schools.
Step by step
From nothing to a blinking LED
Install the Arduino IDE
Download it from arduino.cc/en/software. Take version 2.x, the current desktop one. Install it and open it.
If your board is a clone, it probably uses a CH340 or CH9102 USB chip instead of the original. Windows usually finds the driver itself now. If it does not, search for
CH340 driverplus your operating system. On macOS and Linux it normally works with no driver at all.Plug the board in
Connect the USB cable. A green LED marked
ONshould light and stay lit. If nothing lights up, try a different cable before you try anything else.Tell the IDE what you have plugged in
The IDE has no way of knowing. Two menus to set:
Tools › Board › Arduino AVR Boards › Arduino Uno, then Tools › Port and pick the one that appeared when you plugged in. On Windows it looks like
COM3, on macOS/dev/cu.usbmodem1101, on Linux/dev/ttyACM0or/dev/ttyUSB0. Unplug the board and look at the list again if you are not sure which is which: the one that disappears is yours.Open an example that already works
File › Examples › 01.Basics › Blink. Do not type anything yet. Starting from code that is known to work means that if it fails, the fault is in your setup and not in your typing.
Verify, then upload
The tick button (Verify) compiles the sketch on your laptop and tells you about mistakes. The arrow button (Upload) compiles it and then sends it to the board. Press the arrow.
Two small LEDs marked
TXandRXwill flicker while it transfers. Then the LED markedLnext to pin 13 starts blinking: one second on, one second off.
Under the bonnet
What actually happened when you pressed upload
Pressing Upload starts a chain of four things. When an upload fails, it fails at one of them, so it helps to know what they are.
| Stage | What happens |
|---|---|
| Compile | Your laptop turns the sketch into machine code for the ATmega328P chip on the Uno. Spelling mistakes and missing semicolons stop here, and you get a red error. |
| Reset | The IDE pulses the board's reset line over USB. The board restarts into a small program called the bootloader. |
| Transfer | The bootloader listens on the serial port and writes the machine code into the chip's flash memory. That is the TX and RX flicker. |
| Run | The board restarts and runs your code. It keeps it until you upload something else. |
The program lives on the board, not on your laptop. Once uploaded, the board runs it every time it gets power, with no computer attached. That is why a microcontroller can be sealed inside a can, fired to 400 metres, and still know what to do on the way down.
The tools
The five parts of the IDE you will actually use
You will use five things in the IDE and ignore the rest for now.
| Control | Where | What it does |
|---|---|---|
| Verify | Tick, top left | Compiles without uploading. Fast way to check for typing mistakes. |
| Upload | Arrow, top left | Compiles and sends to the board. Ctrl/Cmd + U. |
| Serial Monitor | Magnifier, top right | A window showing text the board sends back. Tutorial 3 lives here. |
| Board and port | Dropdown, top centre | What you set in step 3. Check it every time you plug in. |
| Library Manager | Books, left sidebar | Installs code other people wrote, such as the sensor driver in tutorial 7. |
Your sketches are saved in a folder called Arduino inside your documents folder, one folder per sketch. Give them names with no spaces, and keep the old version when you change something that works: descent_log_v1, descent_log_v2. You will want to go back at some point, and your CanSat report will want to show how the software developed.
Troubleshooting
If it does not work
Almost every first time problem is in this table.
| What you see | What to check |
|---|---|
| No port in the Tools › Port menu | The cable is charge only, the board is not powered, or the clone's USB driver is missing. Try another cable first. |
avrdude: stk500_recv(): programmer is not responding | Wrong board or wrong port selected. Also caused by anything wired to pins 0 or 1, which the USB link uses. |
Permission denied on the port, Linux | Your user is not in the dialout group. Add it, then log out and back in. |
| Upload succeeds but nothing blinks | Look for the LED marked L, not the one marked ON. On a few clones the built-in LED is on a different pin, so try an external LED on pin 13. |
| The board keeps resetting | Usually a power problem: a sensor or motor drawing more current than the USB port will give. Unplug everything except the board. |
| Red text mentioning a missing library | You opened a sketch that needs something installed. Library Manager, search, install. |
Compiler errors look unfriendly, but they almost always name the file and the line number. Fix the top one first, then press Verify again. The errors below it are often just knock-on effects, and they disappear on their own.
Now change it
Change one thing at a time, upload, and watch what the board does.
- Change both
1000values to200and upload. Then50. Then5. At what point does it stop looking like blinking? - Make the LED spend longer off than on. Which number did you change, and does the pattern tell you which line does what?
- Upload the sketch, then unplug the USB cable and power the board from a USB phone charger or a power bank. What does that tell you about where your program is stored?
- Find the Blink sketch folder on your laptop. Save a copy under your own name, change something, and keep both.
- Make the LED blink the letter S in Morse code: three short flashes. Then try S O S.