Free Shipping

Getting Started with Arduino

About Arduino

Arduino is an open-source electronics platform that makes it easy to build interactive devices and basic robots. At the heart of every Arduino project is a small microcontroller board that can read electronic inputs and respond by activating lights, motors, displays, and more.

The Arduino uses its own programming language, which is easy to learn compared to other programming languages. For this reason, it has become popular with STEM educators, hobbyists, and people new to DIY technology.

Step 1: Choosing an Arduino Board

Each Arduino model is unique, with its own set of features tailored to different types of projects.

Board Type Key Capabilities
Arduino UNO Rev3 A reliable, beginner-friendly board that's great for learning the basics of electronics, sensors, and motor control.
Arduino UNO Rev4 WIFI Combines the classic UNO experience with built-in Wi-Fi and Bluetooth, making it easy to create IoT projects.
Arduino Nano A compact version of the UNO that offers the same functionality in a smaller size.
Arduino Micro Features a smaller form factor and built-in USB capability, making it ideal for projects that need USB communication.

Step 2: Getting What You Need

To get started with an Arduino project, these are the things you'll need:

  • Arduino Board: This is your main computing board.
  • USB A-to-B Cable: This will connect your computer to your Arduino so you can program it.
  • A Personal Computer: This is where you will be programming your Arduino.

Most projects will also require a breadboard to manage connections with other components like sensors, LEDs, and motors. Vilros sells kits with all of these components so you can get everything you need in one place.

Step 3: Installing the Arduino Software

You need to download an Arduino Software package to start programming your board. Which package you use depends on the operating system already on your personal computer. The Arduino Software IDE is cross-platform and runs on Windows, Linux and Mac OSX – and is available on the Arduino download page.

Once you have downloaded the software, open the Arduino application on your computer. A window will appear where you type the code you want to compile and send to your board.

Step 4: Connecting Your Arduino

Plug your USB cable into the Arduino board and into your computer. You will notice that the LED on the board starts to blink. This is just the default program stored on the chip and we will override this later on.

The USB cable powers the board, or you can plug in a power supply to the port at the bottom left of the board. It’s easier to use the USB port to power and program your Arduino device at the same time for now – but you can use a separate power supply when you’re not programming your board.

Step 5: Coding Your Arduino

The code segments you write for your Arduino are called sketches, and they are written in the C++ programming language.

Every sketch needs two “void” functions – these functions do not return any value. The first void function is setup () and this runs once, just after your Arduino is powered up. The second void function is a loop () and this runs continuously after the initial setup.

All your initialization steps need to run in the setup () function and the loop () is where you write the code you want to run repeatedly after setup.

A basic sketch looks like this:

void setup()
{

}

void loop()
{

}

Sample Code

You might notice that there's an LED on your board. This onboard LED is on pin number 13.

Enter the following code to

1. Create a variable called ledPin with an integer (int) type.
2. Call a special function called pinMode() in the setup to assign the LED as an output.
3. Call another special function called digitalWrite() to turn off the LED (and override the default flashing LED).

int ledPin = 13;

void setup()
{
pinMode(ledPin, OUTPUT);
}

void loop()
{
digitalWrite(ledPin, LOW);
}

Compile the code by clicking the “upload” arrow button in the application window. The LED will turn off.

Now, replace the LOW for HIGH in the digitalWrite() function and hit the “upload” arrow button again. The LED will turn on.

Additional Resources

Here are some resources that will get you started with your Arduino project:

  • Official Arduino Guide: These resources on the Arduino website will help you learn how to code your Arduino, connect it to other components, and more!
  • Coding Your Arduino: This is the official introduction to the Arduino IDE, where you'll be coding your Arduino.
  • Arduino Subreddit: This community of Arduino users is where you can get inspiration, ask questions, and share your projects for feedback.
  • Github: Many Arduino users share their code on Github, which will allow you use their code in your own projects and make faster progress.