Blink an LED with Arduino Pro Micro

Introduction

This tutorial will guide you through making an LED blink using the Arduino Pro Micro. This beginner project introduces you to basic microcontroller programming and working with breadboards.

Materials Needed

Steps to Blink an LED

Components needed to blink a led. Resistor, led arduino, breadboard.

Step 1: Prepare the Breadboard and Pro Micro

Place the Arduino Pro Micro onto the breadboard, ensuring the rows do not short any connections. Orient the Pro Micro so its pins align correctly with the breadboard rows.

Step 2: Solder the Resistor to the LED

Components needed to blink a led. Resistor, led arduino, breadboard.
  1. Take the LED and identify its positive (longer) leg (anode) and negative (shorter) leg (cathode).
  2. Solder one end of the 270-ohm resistor to the LED’s anode (longer leg).
  3. Trim the resistor and LED legs if needed to fit neatly between the GND and pin 5 on the Pro Micro.

Step 3: Insert the LED and Resistor into the Breadboard

  1. Insert the LED with the resistor into the breadboard so that the resistor connects to pin 5 on the Pro Micro and the LED’s cathode (shorter leg) connects to the GND pin.

Step 4: Power and Program the Pro Micro

Connect the Pro Micro to your computer using a Micro-USB cable. This will also provide power to the board.

Step 5: Write the Blink Code

Open the Arduino IDE and write or paste the following code:

void setup() {
  pinMode(6, OUTPUT); // Set pin 5 as an output
}

void loop() {
  digitalWrite(6, HIGH); // Turn the LED on
  delay(1000);           // Wait for 1 second
  digitalWrite(6, LOW);  // Turn the LED off
  delay(1000);           // Wait for 1 second
}
    

Step 6: Upload the Code

  1. In the Arduino IDE, go to Tools > Board and select Arduino Pro Micro.
  2. Under Port, select the appropriate port for your Pro Micro.
  3. Click the Upload button to upload the code to the Pro Micro.

Step 7: Test the Setup

Components needed to blink a led. Resistor, led arduino, breadboard.

After uploading the code, the LED should blink on and off every second. If it does, congratulations on completing the project!

Explanation

The Arduino Pro Micro is programmed to set pin 6 as an output. The digitalWrite function toggles the voltage on pin 5 between HIGH and LOW, which turns the LED on and off. The delay function creates a 1-second pause between state changes, resulting in a blinking effect.

Troubleshooting

Conclusion

Congratulations! You’ve built a basic circuit to blink an LED using the Arduino Pro Micro. This project teaches you fundamental skills like microcontroller programming, soldering, and breadboard prototyping. You can expand on this by adding more LEDs, sensors, or components to build more complex circuits.

Components needed to blink a led. Resistor, led arduino, breadboard.

For more Arduino tutorials and projects, visit Microautomation.no.