http://www.visitorsdetails.com How to control an LED with Arduino using a resistor?

Sneaky Robots

Learn Build and Share with us

How to control an LED with arduino using a resistor?

Today I will show you how to connect an LED to Arduino.  How to make an LED to blink and control the speed of blinking. It is a simple project but it will get you familiar with Arduino. We need a resistor to control the amount of current coming in, in order not to damage the LED. If High current comes, LED goes on, if low current comes in LED goes off. The value of the resistor, control the brightness of LED.

Components Required

1.  Arduino uno
2. Male Jumper wires
3. Breadboard
4. LED Light Emitting Diodes
5. 1K Ohm Resistors

Circuit Diagram/ How to connect them?

LED pin 1 to the Resistor pin1
LED pin2 to the Arduino GND
Arduino Digital pin13 to the Resistor pin2

 

How to connect LED to arduino
How to connect LED to Arduino

The link below explains in details LED, and how to connect more than one LED.

Getting Started with the Arduino – Controlling the LED (Part 1)

Code Below:

void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT); //Since we connected the LED to output 13

}

void loop() {

// put your main code here, to run repeatedly:
digitalWrite(13, HIGH);
delay(1500);
digitalWrite(13, LOW);
delay(1500);
}

 

 

After uploading the code to Arduino, Open the serial monitor which is found in the top right corner. (Make sure you have the right port selected for the Arduino as discussed in the first post). The results below show blinking LED after every 1500ms. If it worked, Congratulations you just completed a tiny project. You are going in the right direction and hopefully get to finish harder projects together.

Tagged:
Hamoudi
I’m an electrical engineer and a part-time blogger. I love to Play around with electronic parts (build small robots of any kind). I try to post information that can help others.

LEAVE A RESPONSE

Your email address will not be published. Required fields are marked *

You Might Also Like