LED Blinking Using Arduino
Last Updated :
23 Jul, 2025
We will interface an LED (light-emitting diode) to the Arduino UNO board. An LED is a simple diode that emits light in a forward bias. We will write an LED-blinking program on the Arduino IDE and download it to the microcontroller board. The program simply turns ON and OFF LED with some delay between them.
What is Arduino?
Arduino is an open-source, board that has a Microchip ATmega328P microcontroller on it. This microcontroller has a set of Digital & Analog input and output pins. The operating voltage of the board is 5V. It has 14 digital I/O pins & 6 Analog input pins. The clock frequency of the microcontroller is 16 MHz.
What is LED?
LEDs (Light Emitting Diodes) are becoming increasingly popular among a wide range of people. When a voltage is given to a PN Junction Diode, electrons, and holes recombine in the PN Junction and release energy in the form of light (Photons). An LED's electrical sign is comparable to that of a PN Junction Diode. When free electrons in the conduction band recombine with holes in the valence band in forward bias, energy is released in the form of light.

Structure of an LED
Structure of LEDThe flow of charge carriers (electrons and holes) across the P-N junction drives the activity of an LED. When a forward voltage (anode positive in comparison to the cathode) is applied, electrons and holes recombine at the junction, releasing energy in the form of photons (light). The semiconductor chip is linked to external terminals known as the anode (+) and the cathode (-). The anode is linked to the P-region, and the cathode to the N-region.
Blinking an LED
Blinking an LED is an introductory Arduino project in which we control an LED using Arduino. LED blinking refers to the process of continuously turning an LED (Light Emitting Diode) and off in a repetitive pattern. It is a simple and common demonstration in electronics and microcontroller-based projects.
Working Procedure
setup() and loop() are two fundamental Arduino functions for controlling the behavior of your board. The Arduino framework automatically calls these functions, which form the foundation of any Arduino program.
The setup() function is only called once when the Arduino board boots up or is reset. Its goal is to set pin modes, initialize variables, and execute any other necessary setup tasks before the main loop begins. This function can be used to configure settings that should only be changed once over the board's lifespan.
The loop()
function is the heart of an Arduino program. After the setup()
function is executed, the loop()
function starts running repeatedly until the Arduino is powered off or reset. It contains the main code that performs the desired tasks, controls the board, user input. Whatever is included in the loop()
function will be executed in a continuous loop, allowing the Arduino to perform its intended functions continuously.
In the code, we have declared two integers, LEDpin and delayT. LEDpin represents the pin number of the Arduino where LEDs need to be connected, and delayT is an integer variable for the delay() function. The delay() function accepts values in milliseconds.
Components Required
- 1 X LED
- 1 X Resistor, 330 Ohm
- Breadboard
- Arduino UNO R4 or earlier versions.
- Jumper wires
Components Description
- 1 X LED: We are controlling only one LED in this program.
- 1 X Resistor, 330 Ohm: For every LED, we need one current limiting resistor.
- Breadboard: A breadboard is a fundamental tool used in electronics and prototyping to build and test circuits without soldering.
- Arduino UNO R4 or earlier versions.
- Jumper wires: Jumper wires are simple electrical wires with connectors on both ends used to create connections between various electronic components or points on a circuit on a breadboard.
Arduino Code
C++
int LEDpin = 13;
int delayT = 1000;
void setup() {
// put your setup code here, to run once:
pinMode(LEDpin, OUTPUT);
}
void loop() {
// put your main code here, to run repeatedly:
digitalWrite(LEDpin, HIGH);
delay(delayT);
digitalWrite(LEDpin, LOW);
delay(delayT);
}
Deployment Using Arduino IDE

Circuit Diagram
In the circuit diagram, we used one 330-ohm resistor in series with the LED. This resistor is also called a current-limiting resistor. The Anode of the LED (the longer pin) is connected to one end of the resistor, and the cathode (the shorter pin) is connected to the ground. The other end of the resistor is connected to the Arduino pin. A step-by-step explanation is as follows:
- LED Connections: Connect the LED to the breadboard. The LED has two legs, the longer of which is the anode (positive) and the shorter of which is the cathode (negative).
- Resistor Connection: Insert one end of the resistor into the same row of the breadboard as the LED's Anode. The resistor's other end should be connected to the Arduino's digital output pin.
- Ground (GND) Connection: Connect a jumper wire from the same row as the LED's cathode to any Arduino board GND (Ground) pin. This connects the circuit to the ground of the Arduino.
The circuit is now complete. Here's how it works:
When you upload a simple Arduino program that controls the LED, the microcontroller on the Arduino board executes the program, and the LED will blink according to the code you wrote.

Applications and Uses of LED Blinking
The LED blinking project is an important and straightforward method that can be utilized for a wide range of applications in microcontroller-based projects like :
- Security Systems: To check the status of security systems
- Warning Signals: In battery-operated devices, LED blinking can be used to indicate low battery levels.
- In Testing and debugging.
- Status Indication: LEDs can be used to indicate different states of a system. For example, in a home automation project, an LED might blink to indicate whether a device is connected to an internet network or not.
Conclusion
The Arduino LED blinking project provides a hands-on introduction to microcontrollers, hardware interfaces, and programming ideas. It serves as a foundation for more sophisticated projects and allows you to experiment with numerous Arduino features and capabilities. Whether you're new to electronics or an expert maker, this project will help you develop crucial skills and knowledge for future Arduino-based projects.
Similar Reads
Electronic Devices & Components
Avalanche PhotodiodeAn Avalanche photodiode (APD) is a highly sensitive semiconductor detector that uses the photoelectric effect to convert optical signals into electrical signals. In case of conventional photodiodes, PIN photodiodes operate in a linear mode and the output current is very small and also has limited ga
4 min read
PIN DiodeA PIN diode, abbreviated as a Positive-Intrinsic-Negative diode, is a semiconductor tool that belongs to the diode family. Power electronics play an essential role in converting and controlling electrical strength in numerous packages, ranging from electricity components and motor drives to renewabl
15+ min read
Schottky DiodeThe Schottky diode is popularly known as a hot-carrier diode, low-voltage diode, or Schottky barrier diode. It is a type of diode formed by the junction of a semiconductor with a metal. We know that in a PN junction diode, p-type and n-type semiconductors are joined collectively to form a PN junctio
13 min read
Solar CellA Solar Cell is a device that converts light energy into electrical energy using the photovoltaic effect. A solar cell is also known as a photovoltaic cell(PV cell). A solar cell is made up of two types of semiconductors, one is called the p-type silicon layer and the n-type silicon layer. So Solar
8 min read
Power Semiconductor DevicesIn electronic components, Power Semiconductor Devices are electronic devices that need an external power source to operate actively. Materials used to make semiconductor devices are neither excellent insulators nor conductors. They mainly manipulate, amplify, switch, or control the flow of electric
15+ min read
Digital Circuits & Logic
Analog & Circuit Behavior
RectifierA rectifier is an electronic component that converts alternating current (AC) into direct current (DC), ensuring a unidirectional flow of electric charge. As we know, electricity reaches our homes from power grids in the form of AC, but most commonly used electric appliances, such as mobile phones,
10 min read
Diode As a SwitchThe diode is an electronic instrument of great importance, one of them being using the diode as a switch. It is interesting to note that under certain conditions we can use a diode as a switch. In this article, we will study what is an electrical switch and how it differs from a mechanical switch. W
11 min read
Forward BiasForward Bias is a term commonly used in semiconductor electronics, particularly concerning diodes and transistors. A diode is considered to be in forward bias when its p-side is connected to the positive side of a power supply and its n-side to the negative side. In the case of an NPN transistor, th
9 min read
Schmitt TriggerWe use Schmitt Triggers in digital electronics. It is used for rejecting the noise from the input signals by using the hysteresis curve. To provide accurate and more stable results, it uses two threshold voltages i.e., upper threshold voltage (VUT) and lower threshold voltage (VLT). It is mainly use
11 min read
Integrated CircuitsIntegrated circuits (ICs) also called microelectric chips are used to create a device that can perform certain electrical operations such as signal amplification which is called a transistor from the combination of words of the transfer and resistor. Solid-state electronics is the name given to the
8 min read
Solid-State Devices
Solid-State LightingIn this article, we will study solid-state lighting, which is the use of solid-state materials as a source of illumination, usually light-emitting diodes (LEDs). Solid-state lighting, as opposed to conventional incandescent or fluorescent lighting, which depends on thermal processes, produces light
7 min read
Avalanche PhotodiodeAn Avalanche photodiode (APD) is a highly sensitive semiconductor detector that uses the photoelectric effect to convert optical signals into electrical signals. In case of conventional photodiodes, PIN photodiodes operate in a linear mode and the output current is very small and also has limited ga
4 min read
Avalanche PhotodiodeAn Avalanche photodiode (APD) is a highly sensitive semiconductor detector that uses the photoelectric effect to convert optical signals into electrical signals. In case of conventional photodiodes, PIN photodiodes operate in a linear mode and the output current is very small and also has limited ga
4 min read
MOSFET CharacteristicsMOSFETs (Metal-Oxide-Semiconductor Field-Effect Transistors). It is a transistor that controls the flow of electric current in the circuit. The MOSFETs have 3 main terminals: the Gate (G), the Drain (D), and the Source (S). They are popular because they work efficiently. MOSFETs are able to handle h
6 min read
Junction Field Effect Transistor or JFETIn electronics, the junction field effect transistor is a fundamental component, operating on the principle of electric field control. It is a three-terminal device, and it consists of the gate, drain, and source terminals. There are two types of JFETs: N-channel JFET and P-channel JFET. The N chann
11 min read
Communication Systems
Signal Processing