JavaScript and Web Development

Arduino Yun or Uno Blink LED

24 March 2014 - Arduino - James Brown - No Comments

The below tutorial is an introduction to using the Arduino to perform one of the most basic of tasks, blinking an LED. This tutorial assumes that you already have the Arduino IDE software installed and know how to upload a sketch to the Arduino. If you have not yet setup the software yet, please see the Arduino step-by-step guide.

You might be wondering why I would start with such a basic example. I fell there are a lot of good Arduino tutorials out there, but not nearly enough of them use a large number of pictures. This tutorial (and subsequent guides) will be different. As such, I wanted to start at the beginning of learning Arduino and progress to more advanced topics.

If you have any questions that aren’t covered in this tutorial, please leave a comment below. Thanks!

Here is our basic Arduino breadboard setup. I’m using the Arduino Yun for this example, but this guide identically applies to the Arduino Uno.

These are the parts you are going to need:

  • Three connecting wires. I always use black for ground, red for power but technically the colors don’t matter.
  • 1 – 200 ohm resistor
  • 1 – 5 mm green LED (you can use any color)

Close-up of the resistor and LED

The first things to do are plug the black into the GND and the red into the 5V.

We will then plug the other end of the black wire into the negative rail of the breadboard and the red into the positive.

Next we will plug one end of the blue wire into the pin marked 13.

Next we plug the other end of the blue wire into the second row of our breadboard. We then plug the longer end (positive) of the LED into the pin on the same row horizontally, and the negative (shorter end) into the row directly below.

We then take the resistor and plug it into the negative rail and the same row as the negative pin on the LED.

Here you can see the full setup.

After running the below code, you can see that the light blinks! Since we used pin 13, the LED on the Arduino also lights up.

You can view the code if you open the Arduino IDE and click File > Examples > Basic > Blink

Code:

You can watch a video of the LED blinking on YouTube:


 

 

Let me know if you have any questions in the comments below.

Leave a Reply