Arduino LED Blink Simplest Arduino Project

Arduino LED Blink Simplest Arduino Project

Arduino LED blink is the simplest Arduino project that you can do with an Arduino to view the physical result. Establishing this essential basis will provide you with a sound basis for more advanced experiments.

Components for the Arduino LED Blink

Arduino Uno× 1Amazon
LED× 1Amazon
Resistor 220 Ω× 1Amazon
Breadboard× 1Amazon
Jumper wires× 2Amazon
USB cable type A/B× 1Amazon

Software

Arduino IDE

Arduino LED Blink Circuit Schematics

Arduino LED Blink Circuit Schematics
Arduino LED Blink Circuit Schematics

Note − LEDs are polarized, which means that you need to connect them in a specific way if you don’t blow them. See LED closely to determine the polarity of the LED. The shortest of the two legs is the negative terminal to the flat edge of the bulb.
The value of the resistor can change from 220 Ω in the LED series, the LED may also light up to 1 kΩ.

Arduino LED Blink Source Code

By clicking the button in the top right corner of the code field, you can copy the code. Copy and paste it into Arduino IDE. 

/*
  www.arduinopoint.com
  Blink Led
  Turns an LED on for one second, then off for one second, repeatedly.
  Change on and off time of LED using delay function
 */
 
// Pin 13 has an LED connected on most Arduino boards.
// initialize a digital pin to blink LED
int LED_Pin = 13;

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

// the loop routine runs over and over again forever:
void loop() {
  digitalWrite(LED_Pin, HIGH);  // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second | LED ON time
  digitalWrite(LED_Pin, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second | LED OFF time
}

pinMode(LED_Pin, OUTPUT)Before you use one of Arduino’s pins, you need to declare Arduino Uno whether it is an INPUT or OUTPUT. Therefore, We use a built-in pinMode() “function”.

digitalWrite(LED_Pin, HIGH) – When using a pin as an OUTPUT, you may declare whether it is HIGH (output 5 volts) or LOW (output 0 volts).

delay() – Pauses the program for the time specified as a parameter (in milliseconds). (One second is equal to thousand milliseconds.) We use this function to set the ON and OFF time of the LED

Result

 You should see your LED turn on for one second, then off for one second, repeatedly. If you cannot see the desired output, ensure the circuit has been properly assembled, and verified and uploaded the code to your board.

Leave a Reply