WHAT'S NEW?
Loading...

Arduino LED Blinking Project to Get Started


Hello, 


Arduino development board looks cool but the possibilities of it are even cooler and endless only if you know how to get started with Arduino and create fun and interesting toys and projects. Not only the circuits in many Arduino projects are easy to connect but are fun to play with.




Before this, you should read :


Let’s get started with the Arduino LED Blinking Project

Things you will need:

1. Arduino Uno
2. Breadboard
3. Arduino Cable
4. LED 5V (red, yellow or green)
5. Jumper cables
6. Resistor – 220 ohm

Step 1: Making the Circuit



You may or may not connect the circuit as the Arduino Uno R3 (a common development board) comes with inbuilt LED at pin 13. But, we shall make the circuit so as to understand the pins connections and get hands-on experience.

Arduino LED Blinking Circuit Connections


1. Fix the LED on the breadboard such that the two legs of the LED do not short.

2. Connect the pin 13 of the Arduino to the positive terminal (the longer leg) of the LED with jumper cable.

3. Connect the Gnd of the Arduino to the negative terminal (the shorter leg) of the LED with jumper cable.

4. Connect the 220 ohm resistor between pin 13 and the positive of the LED so as to protect the LED from getting damaged.

Step 2: Uploading the Code



Although, you may find this code easily in the Arduino IDE (Arduino software) in File>Examples>Basics>Blink, you shall also copy the below code and paste it to the sketchbook.

int led = 13;

// the setup routine runs once when you press reset:
void setup() {      
         
  // initialize the digital pin as an output.
  pinMode(led, OUTPUT);    
}

// the loop routine runs over and over again forever:
void loop() {

  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second

  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second
}

Now, connect the Arduino to the computer via the USB cable provided and choose the correct COM port. Then, click on the upload button from the toolbar. And wait till the software says 'Done Uploading'.

Step 3: LED Blinking



You may now observe the behavior of the LED on the breadboard, the LED turns on and off after a fixed interval of time of one second.



The time interval may be varied by altering the delay();  value and consequently the behavior of the LED may be changed.

Congratulations! You have just completed your Arduino Project – simple, fun and easy.

Watch it blink all day, add different colors LED or connect multiple LEDs at once.







Stay Hungry! Stay Foolish!

0 comments:

Post a Comment