Controlling LEDs with Arduino


Your browser needs to be JavaScript capable to view this video

Try reloading this page, or reviewing your browser settings

This segment provides a brief overview of the basics around LEDs, Arduino, and key terms used in subsequent segments.


  • led
  • arduino
  • circuit
  • blink

About this video

Liz Clark
First online
09 April 2019
Online ISBN
Copyright information
© Liz Clark 2019

Video Transcript

Before we jump in, though, let’s take a moment to go over some basics. Let’s start at the beginning. What is an Arduino? Arduino is a family of microcontroller boards that allow you to easily interface electronics with code using the Arduino IDE, an open source piece of software that makes it easy to write, compile, and upload code for Arduino boards.

In the upcoming segments, you’ll see an Arduino Uno board being utilized, which is one of the most common boards. The Arduino Uno has a series of GPIO, which stands for General Purpose Input and Output pins that you can use to connect different circuits and sensors to work with. These allow for digital, analog, and power connections to be made all with one board. Each GPIO pin has a number that can then be referenced at the beginning of your code to control different components. This is how you can interface with hardware and software using the Arduino Uno.

Besides being something that lights up, what is an LED? LED stands for Light Emitting Diode. An LED contains material that lights up when electrical current passes through it. Traditional LEDs have two leads, the anode and the cathode, that allow it to connect with a circuit. The anode is the longer of the two leads and connects to power, or positive, while the cathode is the shorter lead and connects to ground, symbolized with a negative sign. When working with LEDs, it’s important to keep in mind the polarity of the lead since wiring it backwards can cause it to short out and possibly permanently damage it.

It’s also important to wire LEDs with a resistor attached to the anode. A resistor is an electrical component that has a variety of uses in electrical circuits. And in the case of our LEDs, it will limit the current that is reaching the LED and help to prolong its lifespan. It can also protect it in some cases from receiving too much current in certain circuits.

A 220 ohm resistor, identified with the color bands red, red, and brown, is a common value used in simple circuit with low currents. We’ll be using this value for the majority of our segments.

LEDs are one of the most common and easily recognizable electrical components. They also add a lot to projects since they’re able to convey data or status in a visual way and to make a project more visually appealing. This also makes them a great learning tool.

At this point, you may be wondering, how do you build a circuit? We’ll be building all of our circuits on a solderless breadboard, one of the most popular ways to prototype electronics. A breadboard has a series of conductive rails that are accessed through small holes specifically sized for electrical components.

A common configuration for breadboards is to have short rows in the middle that share a conductive rail that allow for components, such as an LED and resistor, to form an electrically stable connection. Power rails can be found on the side that you connect to ground and power to respectively so that multiple components can receive power easily.

We’ll go over how to build circuits utilizing the breadboard with the Arduino in the upcoming segments. And pictographic circuit diagrams for each example will be available on GitHub for your reference along with the code that we’ll be using. Now that you know a bit more about basic electronic components and prototyping, let’s get started with controlling LEDs with Arduino.