This project Simple LED Flashing Circuit serves as an essential guide to electronics and Arduino programming.
We will learn the fundamentals of hardware configuration and software control by flashing an LED.
Despite its apparent simplicity, this project creates the framework for future initiatives that will be more complicated.
Coding and Explanation:
int ledPin = 13; // Select the pin to which the LED is connected
void setup() {
pinMode(ledPin, OUTPUT); // Declare the LED pin as output
}
void loop() {
digitalWrite(ledPin, HIGH); // Turn the LED on
delay(1000); // Wait for one second
digitalWrite(ledPin, LOW); // Turn the LED off
delay(1000); // Wait for one second
}
- int led pin 13 defines a variable called led pin and sets its value to 13, which is the Arduinos digital pin 13.
- pin mode (led pin, OUTPUT) designates the led pin as an output, allowing the Arduino to regulate the pins voltage.
- digital Write (led pin, HIGH) sets the led pin to HIGH about 5V to turn on the LED.
- delay (1000) causes a 1000 millisecond 1 second pause in the application.
- digital Write (led pin LOW) sets the led Pin to LOW 0 volts to turn off the LED.
- The application is paused for an additional 1000 milliseconds using delay(1000);.
- The LED blinks as a result of the loop() method repeatedly doing these actions.
Circuit Working:
Parts List:
Component | Quantity |
---|---|
Arduino Uno board | 1 |
Any LED 5mm 20mA | 1 |
Resistor 220Ω | 1 |
IC 7809 | 1 |
In this basic Arduino project, we will learn how to control an LED by making it blink.
The practice of repeatedly turning on and off an LED in a repeating pattern is known as LED blinking.
In electronics and microcontroller based projects, it is a simple and typical example.
An LED is a semiconductor device that, when a forward moving current flows across it, creates light.
But since LEDs are current sensitive, too much current might harm them.
The resistor safely restricts the amount of current that passes through the LED.
A digital output pin on the Arduino board has two possible settings: HIGH and LOW.
About 5V are produced when it is set to HIGH.
The resistor and voltage work together to generate a current flow that illuminates the LED.
The LED shuts off and the current ceases when the setting is set to LOW.
How to Build:
To build a Simple LED Flashing Circuit with Arduino Uno follow the below mentioned steps connections steps:
- Gather all the components as mentioned in the above circuit diagram
- Connect a regulated IC1 7809 to provide a regulated 9V DC to the Arduino board
- Connect LED cathode short leg to the ground (GND) pin on the Arduino.
- Connect LED Anode long leg to one end of the resistor.
- Connect resistor 220Ω one end to the LEDs anode and the other end is connected to a digital output pin on the Arduino board pin 13.
- Connect Arduino board GND pin 13 through resistor 220Ω and anode of LED and cathode of LED to GND of Arduino board
Note:
- The value of the resistor in this circuit 220 ohms is essential for safeguarding the LED.
- An erroneous value might harm the LED.
- Make that the LED is positioned appropriately at all times.
- Anode, the longest leg is usually positive.
- The Arduino has many digital output pins that you can utilize as needed.
Conclusion:
To conclude, you have successfully stepped into the world of electronics and programming by using Arduino to flash an LED.
In this project, the basic ideas of hardware and software interaction are demonstrated.
By expanding on this understanding, you may work on increasingly challenging tasks including integrating sensors, operating motors and producing a variety of light patterns.
Leave a Reply