This tutorial is meant for beginners who want to start learning Arduino IDE and build their first Arduino project.
Table Of Contents :
- Required Materials
- Let’s Download Arduino IDE
- Launch Arduino IDE
- Quick Navigation Buttons In Arduino IDE
- Open Your First Project In Arduino IDE
- Power Up Your Arduino Board
- Selecting your Arduino board
- Select Your Serial Port In Arduino IDE
- Uploading To Arduino Board
- A Computer
OS: Windows, Mac, or Linux. In this tutorial, we will use Windows.
- A Arduino Development Board
You can use your favorite Arduino development board, But In this tutorial, we will use the Arduino UNO board. As Arduino UNO is the most popular board among the Arduino family.
- A USB A to B Cable
In case you are using Arduino UNO, Arduino Duemilanove, Arduino Mega 2560, etc you need a standard USB A to B cable (also used for printers).
- A USB A to Mini B Cable
But In case you are using Arduino Nano, you need a standard USB A to Mini B cable.
Let’s Download Arduino IDE:
For downloading Arduino IDE, we will first go to the official Arduino website.
You will see a different download option on the right side of the page for different operating systems.
In this tutorial, we will use Windows, therefore, clicking on the windows zip file option. Download the file to your desired directories.
Note:- Downloading and using Arduino IDE is free of cost. But if you think the Arduino community has changed your life, consider a small contribution to the community before downloading. It will help the community to grow more.
Once the download is finished, you will see a Zip file name Arduino with its latest version in your download location.
Unzip or extract the zip file at your desired location.
Launch Arduino IDE:
After the file is extracted successfully, open the folder, and locate the file type as application.exe with an Arduino symbol.
This file will open the Arduino IDE software; therefore, it is better to create a desktop shortcut for easy navigation next time.
After that, open it by double-clicking it.
You will see an Arduino IDE starting image while it’s opening. We have installed Arduino IDE successfully.
Quick Navigation Buttons In Arduino IDE:
There are few handy quick navigation buttons in the top section of Arduino IDE.
Here is a short overview of the usage of all buttons-
- Verify Button – By pressing this button, it will compile your project code.
- Upload Button -It will first compile the code, and then it will upload it to your Arduino board.
- New Button – It will open a new project window.
- Open Button – Press this to open examples and recent projects.
- Save Button – To save your current project.
- Serial Monitor – To open Serial monitor. It is used to send and receive messages to and from the Arduino board. Also used for Debugging purposes.
Open Your First Project In Arduino IDE:
Once the Arduino IDE Software started, we have two main options:-
- Create a new project.
- Open an examples project.
Apart from this, we have options for open recent projects or open existing saved projects.
Create A New Project:
To create a new project, select File → New.
Clicking New will open a new project window, and you can start writing your new project code.
You can also press the New Button in the quick navigation section to create a new project.
Likewise, we can use the shortcut Ctrl+N to open a new project.
It’s a good practice to save your new project at your desired project location. You can press the Save Button or use the shortcut Ctrl+S.
Open an examples project:
To open an existing example project, select File → Example.
Inside example, you will find all default example that comes with Arduino IDE installation. Additionally, when you add any external libraries, the examples of that particular libraries will also be shown in the list.
You can also open examples by pressing the Open Button.
For this tutorial, we will select a famous blink example, select Example → Basics → Blink.
Blink example is the first step for the learning curve. Blink example will turn ON and OFF the onboard LED in your Arduino Board at an interval of 1 second.
If you want to learn different methods of blinking Arduino LED, you can check out the tutorial for 6 Simple Ways To Blink Arduino LED.
Power Up Your Arduino Board:
We will use Arduino UNO for this tutorial, but you can use any Arduino compatible boards such as Nano, Mega, Leonardo, and many more.
You need to connect the Arduino board to your computer using the USB cable type A to B if you are using(Arduino UNO, Arduino Duemilanove, Mega, etc.) or USB type A to Mini B if you are using Arduino Nano.
After the connecting, The green power LED (labeled as PWR or ON) should glow.
Right now, your Arduino board will take supply from your computer’s USB port. You can also provide an external supply to your Arduino boards; like in Arduino UNO, you can add an external supply less than 12v from its DC jack.
Note:- most of the computer’s USB ports are only capable of delivering less than 0.5A of current. Therefore if your Arduino project current consumption is greater than that, we recommend using an external power supply or a good USB hub.
If, in case, you are using Arduino Diecimila, make sure that your Arduino Diecimila board is configured to draw power from the USB connection. The power sours are selected from the jumper wires that fit onto two of the three pins between the USB and power jacks.
Selecting your Arduino board:
Now we will select the Arduino board that we are using.
Note: It is important to select the right Arduino board that you are using not to get compiling or uploading errors.
We will select Arduino UNO as our board for this tutorial. As per the latest update in Arduino IDE, they have categorized each board based on their architecture. Arduino UNO works on the Atmega328p microcontroller based on AVR architecture; therefore, Arduino IDE has a category named Arduino AVR boards.
To select Arduino UNO board Go to Tools → Board → Arduino AVR boards → Arduino UNO.
You can select different Arduino board which you are using by following same steps.
Select Your Serial Port In Arduino IDE:
Now you have to tell the Arduino IDE that in which USB COM port you have connected your board.
To select the appropriate COM port, Go to the Tools → Serial Port.
After opening the Serial Port menu, you will find your COM Port automatically with your board name. Select the COM Port, which matches your board name.
Most of you reading this tutorial this far will be using Arduino IDE and Arduino board for the first time; therefore, there are chances that you will not see any COM port in the port section. Therefore you need to install COM port drivers.
In MAC and Linux, it will be done while installing Arduino IDE.
Skip this step if you see the proper COM port in Arduino IDE.
Installing COM Port Drivers In Windows
You need to follow these simple steps to install new COM port drivers.
- Open Device manager from the start window.
- Navigate to ports(COM & LPT). Inside that, you will find an Unknown Device. If not found, see inside Other Devices.
- Right-click on that and choose the “Update Driver Software” option.
- Next, choose the “Browse my computer for driver software” option.
- Finally, 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”.
- Driver installation is done now.
Uploading To Arduino Board
In this tutorial, we have used a blink example; therefore, we know that there will be no errors in the code. Therefore we will not check the code by clicking Verify Button.
Note:- If you have written your code for the project. Then it is good practice to Verify your code before uploading it. By doing this, you will get to know any errors left in your code while compiling.
Now click the Upload Button, And you will see that code is compiling.
Additionally, you will see the progress bar in the bottom right corner while uploading or compiling your code.
After successful compiling, it will start uploading code to your board. Now you will see RX and TX LED’s on Arduino UNO will flash quickly; it indicates that the program is being flashed in our board over a serial port.
You will see Done Uploading written in the bottom section of Arduino IDE once the program is successfully uploaded.
After uploading the blink example, you will see an onboard LED in the Arduino UNO board that will start blinking. Default delay for LED ON and OFF is 1 second you can change in by changing vale in the delay function used in the program.
Note:- Delay function in Arduino IDE takes input in milliseconds; therefore, delay 1000 will be equal to 1 second.
The current Arduino IDE doesn’t have a feature that a modern IDE should have. Therefore to overcome this gap Arduino community has come up with an Arduino2.0-Beta.
Check out the all-new features that Arduino 2.0 has for considering it as a modern IDE.
In this tutorial, you have controlled a Digital pin of an Arduino Board to blink that tiny LED. It’s just a starting step towards the exciting journey ahead.
Feel the power of your code “What you write will be executed by the controller“.
If you want to learn more about Arduino Projects, consider subscribing to our weekly newsletter.