Monday, 9 April 2018

Arduino simple projects- Arduino with LED

Micro-controller becomes an important source in this modern electronic world. So it is necessary for the engineer to update with the new technologies. Arduino has became one of the most important device in embedded field. Here we are going to teach you how to work with arduino.Let us start with simple project.

Hardware Requirements:

  •   Breadboard
  •   LED
  •   220 ohm resistor

Connecting Arduino with LED:


Step 1: Take the breadboard
Step 2: Connect the LED in the breadboard. Note: In LED the long leg indicates positive terminal and the shorter leg indicates the negative terminal.
Step 3: Connect the resistor across the LED as shown in figure. Resistors are connected to avoid damage to LED. Note: Resistor has no positive and negative terminal
Step 4: Connect the resistor terminal across the positive leg of LED to the digital pin 13 of arduino and the other terminal of resistor to the GND of arduino.


Connect LED with Arduino
Arduino connected with LED
             


Software Requirements:

  • Arduino Uno


Codings:


int ledpin=13;
void setup()
{
pinMode(ledPin, OUTPUT);
}
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}


Codings Explanation:


int ledPin=13;
Indicates that LED is connected to the digital pin 13 of arduino.
void setup()
{
pinMode(ledPin, OUTPUT);
}
This indicates the setup to make LED pin as an output pin.
void loop()
{
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
This indicates the loop to make the LED blink. In this program we coded to make the LED blink with a delay of 1000 ms that is 1 sec.








No comments:

Post a Comment

Arduino with Buzzer

Buzzer: A buzzer or beeper is an audio signalling device,which may be mechanical, electromechanical, or piezoelectric (piezo for short ra...