Introduction: Blink an LED Bulb Using Arduino: Step-by-Step Guide
Welcome to this Arduino tutorial! In this guide, you'll learn how to blink an LED using an Arduino UNO board. This is a perfect project for beginners to get started with Arduino programming and basic electronics.
Supplies
Materials Needed
- Arduino UNO Board
- LED Bulb
- USB Cable
- Breadboard and Jumper Wires (Optional)
Step 1: Identify the Components
Before starting, ensure you have all the necessary components:
- Arduino UNO board
- LED bulb
- (Optional) 1K resistor
- USB cable
- Breadboard and jumper wires (if not connecting directly)
Step 2: Connect the LED Bulb to the Arduino Board
Step 3: Connect the Arduino Board to Your Computer
Use the USB cable to connect the Arduino UNO board to your computer. This will supply power to the board and allow you to upload your code.
Step 4: Open the Arduino IDE
Launch the Arduino IDE on your computer. Familiarize yourself with the interface, including the code editor, message area, and toolbar with buttons for verifying and uploading code.
Understanding the Key Functions
- void setup()
- This function runs once when the Arduino is powered on or reset. Use it to set pin modes and initialize variables.
- void loop()
- This function runs continuously after the setup() function. Use it for tasks that need to repeat indefinitely, like blinking an LED.
Step 5: Write and Upload the Code
void setup(){
pinMode(13, OUTPUT);
}
void loop(){
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(500);
}
Code Explanation
- pinMode(13, OUTPUT);
- Sets digital pin 13 as an output pin.
- digitalWrite(13, HIGH);
- Turns the LED on by supplying 5 volts to pin 13.
- delay(500);
- Waits for 500 milliseconds.
- digitalWrite(13, LOW);
- Turns the LED off by setting pin 13 to 0 volts.
- delay(500);
- Waits for another 500 milliseconds.
Step 6: Verify and Upload the Code
- Verify the Code: Click the Verify button (checkmark icon) to compile your code and check for errors.
- Select Board and Port:
- Go to Tools > Board and select "Arduino UNO".
- Go to Tools > Port and choose the port your Arduino is connected to.
- Upload the Code: Click the Upload button (right





