Blinking LED With Arduino Uno.

by SaswatSamal in Circuits > Electronics

736 Views, 1 Favorites, 0 Comments

Blinking LED With Arduino Uno.

Screenshot (194).png
Screenshot (206).png
making the perfect cup of coffee.png
How to make Blinking LED Project with Arduino Uno|| P.I.Y. Project It Yourself ||

First off, consider the throwie: a simple, fun circuit that lets you light up the town.

Grab your LED and check it out. One long leg and one short. The long leg is positive. The short leg is negative, and you can remember because that side of the LED is slightly flattened, like a –.

Grab your Arduino, and start making your first basic project of Arduino!

Things Required.

Screenshot (195).png
Screenshot (196).png
Screenshot (197).png

Go to your Electrical Shop and gather the following things:

1. LEDs

2. Arduino Uno R3

3. Arduino Cable

Bust out your computer and install the latest complete version of the Arduino IDE, from the top of this page: https://www.arduino.cc/en/Main/Software
Plug your Arduino board into a USB port on your computer. Get out your components. All set!

Assembling the Circuit.

Screenshot (199).png
Screenshot (200).png
Screenshot (201).png
arduino-led.jpg

Grab your LED and check it out. One long leg and one short. The long leg is positive. The short leg is negative, and you can remember because that side of the LED is slightly flattened. (shown in the video)

Connect the Arduino with the computer through the Arduino Cable.

Like most Arduino boards, the Uno comes with a built-in LED that's connected to digital pin 13. Upload the code and watch it flash on and off, changing once per second.
Now, do the same thing with an external LED! Grab yours and plug the long positive leg into the header at digital pin 13. Plug the short leg into the GND (ground) header. You can also move the positive leg to any of the other digital pins, and change the "13" in your code to match. (As shown in the diagram).

The Coding Part.

Screenshot (202).png

To blink the LED takes only a few lines of code. The first thing we do is define a variable that will hold the number of the pin that the LED is connected to. We don't have to do this (we could just use the pin number throughout the code) but it makes it easier to change to a different pin.

In our setup section, we're telling it that there is a controllable output on digital pin 13.
Once setup is done, the loop section takes over and (as the name implies) runs over and over again until the board is powered off. Our loop turns the LED on (HIGH) or off (LOW) every 1 second (1000 milliseconds).

The Code.

Screenshot (203).png
Screenshot (204).png
Screenshot (205).png
/* Blink Turns on an LED on for one second, then off for one second, repeatedly. Most Arduinos have an on-board LED you can control. On the Uno and Leonardo, it is attached to digital pin 13. If you're unsure what pin the on-board LED is connected to on your Arduino model, check the documentation at http://www.arduino.cc This example code is in the public domain. modified 8 May 2014 by Scott Fitzgerald */ // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin 13 as an output. pinMode(13, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(13, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }

Here We Go, Your LED Starts to BLINK!

Screenshot (206).png
How to make Blinking LED Project with Arduino Uno|| P.I.Y. Project It Yourself ||

After uploading the code to the board, the LED starts to blink.

The blinking speed can be changed by changing the values of "delay".

Now, here we go, your first ever Arduino Project is ready. Keep experimenting by changing the values and enjoy.