Before we start controlling the world of Arduino, we’ll need to set up the software (IDE – Integrated Development Environment) to program the Arduino boards. The Arduino IDE allows us to write programs on our computers and upload them to our boards. As of writing this tutorial, there are two options of the IDE:
- Desktop IDE (V 1.8.6)
This is the offline version of the IDE that most people who prefer to work offline would opt for. You should always use the latest version of the IDE that can be downloaded here …. https://www.arduino.cc/en/Main/Software.
- Online IDE (Arduino Web Editor)
This is the online version of the IDE that you should use if you have a reliable internet connection. The web editor allows you to save your sketches on the cloud, which means your projects will be backed up and readily available from any device. It is always updated automatically and as a user, you don’t need to install updates or community generated libraries. Also note that Boards work out-of-the-box on the web editor, you don’t need to install anything. How cool is that?
- Installing the Arduino Desktop IDE:
In the previous tutorial, we observed that Arduino is cross-platform i.e. it can run on Windows, Mac & Linux Operating systems. For the purpose of this tutorial we are going to concentrate on how to install the IDE on Windows PCs and also the board we’ll cover here is the Arduino Uno/Genuino. In case you have a Mac follow the instructions here https://www.arduino.cc/en/Guide/MacOSX. For Linux users, follow the installation instructions here https://www.arduino.cc/en/Guide/Linux.
2.1 For Windows PCs:
Download the latest version of the Arduino software (IDE) from the download page at https://www.arduino.cc/en/Main/Software. While at the site, you have two options to choose from i.e. the installer (.exe) or the zip package. For this tutorial, we’ll download and use the installer that installs directly everything we need to use the Arduino Software (IDE), including the drivers. Unlike the Installer, with the Zip package, we have to install the drivers manually and also it’s useful if we want to create a portable installation.
Fig 1. Arduino Desktop IDE Download Page
When the download is complete, go ahead with the installation and allow the driver installation process to run when prompted by the operating system by selecting the components to install.
Fig 2. Locating the application on your disk drive
Click the “I Agree ” button to accept the license agreement.
Fig 3. The license Agreement
Select the components to be installed on your computer.
Fig 4. Selecting components to be installed
Choose the installation directory, we suggest you keep the default directory.
Fig 5. Choosing the installation directory
The process will extract and install all the required files and you will be prompted to install drivers that are required to execute properly the Arduino Software (IDE).
Fig 6. Extracting the required files
Fig 7. Promoted drivers to be installed
When the installation is complete, close the setup and start the Arduino IDE
Fig 8. The Arduino Desktop IDE
After the Arduino Software (IDE) is properly installed on yours Windows PC, we then need to learn how to connect our Uno/Genuino board to the computer and upload our first sketch.
Connect your Uno/Genuino board with an A-B USB cable and the green power LED (labelled PWR) should light up as shown below.
Fig 9. Connecting the Arduino Uno board to your computer via a USB cable
Install the board drivers:
If you downloaded the installer, (Windows – from XP up to 10), this will install the drivers automatically as soon as you connect the board to your computer. But if for some reason, you decided to download and extract the Zip package, and the board is not properly recognized, then follow the procedure below;
- Click on the Start Menu and open the control panel.
- While in the control panel, navigate to system and security and click on System, then open the device manager.
- Check under ports (COM & LPT), you should see an open port named “Arduino UNO (COMxx)” and if there is no COM & LPT section, then check under “Other Devices” for “Unknown Device”.
- Right click on the “Arduino UNO (COMxx)” port and choose the “Update Driver Software” option.
- Then choose the “Browse my computer for Driver Software” option.
- Then navigate to and select the driver file named “arduino.inf”, located in the “Drivers” folder of the Arduino Software download (not the “FTDI USB Drivers” sub-directory). If you are using an old version of the IDE (1.0.3 or older), choose the Uno driver file named “Arduino UNO.inf”.
- Finally windows will finish up the driver installation from there.
The Anatomy of the Arduino Desktop IDE.
Fig 10. The anatomy of the Arduino Desktop IDE
Parts of the IDE:
- Menu – Selection of software features.
- Verify – Compiles and verifies your sketch.
- Upload – Sends the verified code to the Arduino board.
- New – Opens a new sketch window.
- Open – Opens an existing sketch.
- Save – Saves the current active sketch.
- Sketch Name – Shows the name of your saved sketch.
- IDE Version – Shows the current version of the IDE you are using.
- Serial Monitor – Opens a window to send and receive information.
- Code Editor – This is the code editor area. Type your sketch in this area.
- Status Bar – The IDE reports verifying and uploading message here.
- Console – The IDE reports any failures or success message here.
- Selected Board – Indicates the board selected.
- Port – Shows the COM serial port active.
Open your first sketch, let’s open the LED blink example sketch: File > Examples > 01.Basics > Blink.
Fig 11. Opening the LED blink example sketch
We then need to select the board type and port. Tools > Board > Arduino/Genuino Uno.
Fig 12. Selecting your preferred board type
Then select the serial device of the board from the Tools > Serial Port menu. This is likely to be COM3 or higher (COM1 and COM2) are usually reserved for hardware serial ports. To find out, you can disconnect your board and re-open the menu; the entry that disappears should be the Arduino/Genuino Uno board. Reconnect the board and select that serial port.
Fig 13. Selecting the Serial COM port
The final step is to upload the program. Simply click the “Upload” button in the IDE and after a few seconds, you should see the RX and TX LEDs on the board flashing. If the upload is successful, the message “Done uploading” will appear in the status bar. A few seconds after the upload is complete, Pin 13 LED on the board will start to blink in orange. If it does, then CONGRATULATIONS!, you have successfully setup your Arduino/Genuino Uno board. In case of any errors, please re-follow the instructions in this tutorial once again.
Now that you have set up and programmed your Arduino/Genuino Uno board, you may find inspiration in our DIY Arduino projects with lots and lots of open source tutorials & projects to get you started with building your own home-made Arduino projects.
In the next chapter, we are going to get acquainted with the Arduino Web Editor.