Before we can dive into programming we need to fulfill the prerequisites. This tutorial will show you how you can install the Arduino IDE and the required drivers.
Different Arduino Uno Boards
To program the Arduino Uno we will use the Arduino IDE. This tutorial will guide you step-by-step through the installation process.
As the Arduino is programmed via serial port and the on-board USB-to-Serial converter, you need to install a driver for this converter too. What might surprise you is, that there are different versions of the Arduino Uno. First there are SMD versions and versions using the ATmega328P microcontroller as a DIP package. More important for connecting it to your computer is the fact, that the original Arduino Uno uses an ATmega16U2 microcontroller as USB-to-Serial converter, while other boards use a cheaper CH340 converter chip.
The Arduino IDE setup only includes the driver for the original Arduino board. You can identify the chip your Arduino Uno uses using the picture below. If you have an Arduino Uno with the CH340 converter, it might not work out of the box. In this case just follow the optional step 'Install CH340 drivers'.
Start the download by clicking on 'Just Download' or contribute to the Arduino project and download afterwards.
Choose 'Run' to start the installation right after the download finishes. Alternatively, you can save the installer to your disk and run it manually.
Wait for the download to finish and then continue with the next step.
When the installer starts, you will see the Windows UAC message. Click 'Yes' to continue with the installation.
Accept the Arduino IDE license terms.
Continue the setup wizard and keep the default settings which include the installation of the required drivers.
Just continue with the default installation path or choose your own one.
Wait for the setup to complete.
When you are asked to install the drivers, confirm the installation of each driver by clicking 'Install'.
Once the installation finished click on 'Close' to exit the setup. Go ahead to the next step.
Open the Arduino IDE and load the Blink example.
In the Tools menu select Arduino Uno as your board and choose the correct serial port.
Click on the big arrow next to the check mark symbol in the menu bar to upload your code to the Arduino.
If everything works as expected, you should see the message 'Done uploading'. The LED on your Arduino Uno should be blinking every second.
If the upload fails, please check the connection to your Arduino, verify you have selected the correct serial port and installed the required drivers.
The drivers for the original Arduino are installed during the installation process of the Arduino IDE.
If you have an Arduino with the CH340 USB-to-Serial converter, you might need to install the driver manually. Whether you need to do this or not depends on your Windows version and the devices you used before. Please test if you can already use it before installing the driver.
You can download the driver from the manufacturer: wch-ic.com/downloads/CH341SER_EXE.html
When the installer starts, you will see the Windows UAC message. Click 'Yes' to continue with the installation.
Click on 'Install' to start the driver installation.
Once the driver installation finishes, you can close the installer and should be able to use your Arduino Uno.
You might need to reinsert the USB cable or reboot your computer in order to make it work.
Arduino IDE Installation (Ubuntu)
Go to www.arduino.cc/en/Main/Software and scroll down to 'Download the Arduino IDE'.
Choose the version matching your operating system (most likely Linux 64-bit).
Start the download by clicking on 'Just Download' or contribute to the Arduino project and download afterwards. Save the archive to your download folder.
Open the download folder in your file browser.
Extract the archive you just downloaded.
You can choose to install the Arduino IDE for all user or to keep it in your home directory.
To install the Arduino IDE for all users follow the three-step process described in step 3a. It uses the official Arduino installation script. This script will create a shortcut to the Arduino IDE on the desktop for all users. This shortcut links to the Arduino IDE installation directory. In order to ensure that all users have access to this directory, you should move it to a globally accessible location like /opt. After you copied the Arduino IDE files to this new place you can remove the files from your home directory.
If you do not want to install the Arduino IDE for all users you can move it to a desired location in your home directory. Step 3b will show you how to create a desktop shortcut or simply run the Arduino IDE from its installation directory.
No matter which option you choose, you need to ensure that your user account has access to the serial port in order to program the Arduino. Typically, this is achieved by adding the user to the dialout group and adding additional udev rules. Arduino provides a script for this. The process is described in step 4 and requires you to use an account with access to sudo.
Open a terminal inside the parent folder of the Arduino IDE and copy the Arduino IDE folder to /opt.
Run sudo cp -r arduino-1.8.12 /opt. Replace the version number in arduino-1.8.12 with your Arduino IDE version.
Run sudo /opt/arduino-1.8.12/install.sh to install the Arduino IDE for all users.
Replace the version number in arduino-1.8.12 with your Arduino IDE version.
Once the script finishes, you can start the Arduino IDE by using the desktop shortcut or by running arduino in a terminal.
Continue with step 4 to assign the required permissions to your account.
To uninstall (e. g. before updating to a newer version) run sudo /opt/arduino-1.8.12/uninstall.sh and remove the old folder from /opt afterwards.
Cut the downloaded and extracted Arduino IDE Folder to move it to the place you want to.
Paste the Arduino IDE in the destination folder of your choice, e.g. your Home directory.
You can already start the Arduino IDE from its installation folder.
You can enable the execution from the file browser ...
... by enabling 'Ask what to do' in the preferences. This allows you to choose 'Run' when clicking on the arduino executable.
Alternatively you can open a terminal in the Arduino IDE directory and run ./arduino.
If you want a more comfortable solution, continue to create a desktop shortcut. Skip to the next step of assigning access permissions to the serial port, otherwise.
To create a desktop shortcut, copy the template 'desktop.template' from the lib directory ...
... and paste it into your Desktop folder.
Rename it, e.g. to Arduino.desktop.
Edit the shortcut parameters:
Click on the icon and choose arduino.png in the Arduino lib folder as the new icon.
Enter the path to the arduino executable in the Arduino IDE folder as Command.
Click on the newly created desktop icon and confirm by clicking 'Trust and Launch'.
The Arduino IDE will launch and your new desktop icon should change its appearance and name.
You have finished the installation now. Continue by assigning access permissions to the serial port for your user.
Open a terminal inside the Arduino IDE folder.
Run ./arduino-linux-setup.sh $USER to assign the necessary permission to your user account.
The script will ask you to enter your password to gain root access.
Once the script finishes reboot your computer and continue with the next step to test the Arduino IDE.
Open the Arduino IDE and load the Blink example.
In the Tools menu select Arduino Uno as your board and choose the correct serial port.
For the original Arduino this is most likely /dev/ttyACM0 and for boards using a CH340 USB-to-Serial converter it is /dev/ttyUSB0.
If you have multiple boards, other USB-to-Serial converters or 3G modems connected the number at the end might differ.
Click on the big arrow next to the check mark symbol in the menu bar to upload your code to the Arduino.
If everything works as expected, you should see the message 'Done uploading'. The LED on your Arduino Uno should be blinking every second.
If the upload fails, please check the connection to your Arduino, verify you have selected the correct serial port and ensure you have executed step 4 for your user account.