Alternate Blinking LED Code – NANO
🧩 Circuit Connections (Text Description)
| Component | Arduino Nano Pin | Connection Details |
|---|---|---|
| LED 1 | A3 | ➜ Connect anode (+) of LED to A3 through a 220Ω resistor. ➜ Connect cathode (–) to GND. |
| LED 2 | A4 | ➜ Connect anode (+) of LED to A4 through a 220Ω resistor. ➜ Connect cathode (–) to GND. |
| LED 3 | A5 | ➜ Connect anode (+) of LED to A5 through a 220Ω resistor. ➜ Connect cathode (–) to GND. |
⚙️ Power & Ground
- Arduino Nano 5V pin → powers the circuit.
- Arduino Nano GND pin → common ground for all LED cathodes.
🪛 Quick Wiring Summary
A3 → 220Ω → LED1 → GND
A4 → 220Ω → LED2 → GND
A5 → 220Ω → LED3 → GND
✅ Checklist to Verify Your Drawing
- Each LED’s long leg (+) goes to A3 / A4 / A5 via resistor.
- Each LED’s short leg (–) connects to GND.
- All GND points are connected to the Arduino’s GND pin.
- No two LED anodes are shorted together.
- Resistors are in series with LEDs (not parallel).
Circuit
Here’s your updated code that makes the LEDs blink alternately (LED1 ON, LED2 OFF, LED3 ON, then reverse).
// Alternate Blinking LEDs on A3, A4, A5
#define LED1 A3
#define LED2 A4
#define LED3 A5
void setup() {
pinMode(LED1, OUTPUT);
pinMode(LED2, OUTPUT);
pinMode(LED3, OUTPUT);
}
void loop() {
// Step 1: LED1 and LED3 ON, LED2 OFF
digitalWrite(LED1, HIGH);
digitalWrite(LED2, LOW);
digitalWrite(LED3, HIGH);
delay(500); // wait half a second
// Step 2: LED1 and LED3 OFF, LED2 ON
digitalWrite(LED1, LOW);
digitalWrite(LED2, HIGH);
digitalWrite(LED3, LOW);
delay(500); // wait half a second
}
⚙️ Working Explanation
- When the program starts, pins A3, A4, and A5 are set as outputs.
- Inside the loop:
- First pattern: LED1 and LED3 turn ON, LED2 turns OFF.
- After 500 ms, it reverses: LED1 and LED3 OFF, LED2 ON.
- This keeps alternating forever — giving a chaser-like or alternating effect.
Pingback: Arduino Demo Kit Projects - Motion Demo Kit (With Arduino) - Project List - EDGENext Learning