How to blink an LED bulb using Arduino step by step

Hello guys, This is my second article in the Arduino tutorial. Thanks so much for reading my articles. In the last article, I presented a full article about Arduino. I hope you have read it. So let’s go to today’s post. This tutorial includes how to blink an LED bulb using Arduino.

So First, let’s see what the Arduino language is. This language is essential for giving commands to the Arduino board or to perform any task. It’s a very easy language to learn. This language is based on C and C ++ high-level computer languages. It is the same as the English language. We will continue to learn this language step by step.OK let’s go to our first project.

For this project, I’m using the Arduino UNO board. Because the Arduino UNO board is very good for this project and it is a low-cost board. In this project, I will present how to blink the LED bulb using Arduino. How to do it step by step is explained in detail below. The materials needed to carry out this project and the links where they can be purchased are given below.

Components

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

Second, connect the LED bulb to the Arduino board. We don’t need resistance for that. Because the amperage value of the Arduino UNO board is low. It does not affect the LED bulb. If you want, you can connect a 1K resistor.

Connect the anode pin of the LED bulb to the 13 pins of the Arduino board and the cathode pin to the GND pin. The GND pins on the Arduino board can be considered cathode pins. You must remember it.

Step 3

Thirdly, connect the Arduino board to the computer.

Step 4

Run the Arduino IDE on your computer. Let’s talk about the Arduino IDE interface.

what is the void setup ()   

The void setup is a function. It includes activities that only need to be done once. For example, To inform the pin Arduino board we use.

What is the void loop ()

The void loop is a function. It includes This function includes things that are done continuously. For example, the Continuous blink of the LED bulb.

Step 5

Next, copy and paste the following program to the Arduino IDE.

void setup(){
pinMode(13,OUTPUT);
}

void loop(){
digitalWrite(12,HIGH);
delay(500);
digitalWrite(12,LOW);
delay(500);
}

pinMode(13, OUTPUT); —- This code informs the Arduino board of the PIN required for our project. The 13th pin is a digital pin. You must remember to apply a semicolon to the end of the code line.

digitalWrite(13,HIGH); — This code line supplies 5 volts for the 13th pin. Then the LED bulb is ON.

delay(500); — This code line informs the Arduino board of the time delay at which the LED bulb should light up. Let it know in milliseconds.

digitalWrite(13, LOW); — This code line supplies 0 volts for the 13th pin. Then the LED bulb is off.

delay(500); — This code line informs the Arduino board of the time delay at which the LED bulb has turned off.

Step 6

Now, check this code using the verify button. Then, select the board and port. Finally, click the upload button.

OK, enjoy this project. I hope you have learned something from this article. So, see you in the next blog post. Bye. Have a good day.

Similar Posts

Leave a Reply

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