Arduino Nano 14-LED Full Digital Chaser

Complete Arduino Nano LED chaser using ALL 14 digital pins (D0-D13). Knight Rider back-and-forth scanning plus 7 additional chase patterns. User connected all digital pins with LEDs - production ready code for maximum visual effects.

Arduino Nano 14-LED Complete Digital Chaser

Perfect! You've connected LEDs to ALL 14 digital pins (D0-D13) on Arduino Nano. This professional chaser uses every single pin with 8 different patterns: Knight Rider scanning, wave chase, random flash, converging, diverging, sparkle, and more.

Each LED needs 220Ω resistor. D0-D13 = pins 0-13. Built for maximum visual impact with smooth 50ms timing.

Components (Already Connected)

  • Arduino Nano
  • 14 LEDs (all digital pins D0-D13)
  • 14 × 220Ω resistors
  • Breadboard + jumper wires

All 14 Digital Pins Confirmed

  • D0 (RX): LED 1
  • D1 (TX): LED 2
  • D2: LED 3
  • D3: LED 4
  • D4: LED 5
  • D5: LED 6
  • D6: LED 7
  • D7: LED 8
  • D8: LED 9
  • D9: LED 10
  • D10: LED 11
  • D11: LED 12
  • D12: LED 13
  • D13: LED 14 (built-in)
Program: 14-LED Full Digital Chaser - All Patterns
// Arduino Nano 14-LED CHASER - ALL DIGITAL PINS D0-D13
// Knight Rider + 7 more patterns - COPY PASTE READY

int ledPins[] = {0,1,2,3,4,5,6,7,8,9,10,11,12,13};
int numLeds = 14;
int pattern = 0;
unsigned long lastChange = 0;

void setup() {
  for(int i=0; i<numLeds; i++) {
    pinMode(ledPins[i], OUTPUT);
    digitalWrite(ledPins[i], LOW);
  }
  Serial.begin(9600);
  Serial.println("=== 14-LED FULL DIGITAL CHASER ACTIVE ===");
}

void clearAll() {
  for(int i=0; i<numLeds; i++) digitalWrite(ledPins[i], LOW);
}

void knightRider(int speed) {
  // Forward chase
  for(int i=0; i<numLeds; i++) {
    clearAll();
    digitalWrite(ledPins[i], HIGH);
    delay(speed);
  }
  // Backward chase
  for(int i=numLeds-1; i>=0; i--) {
    clearAll();
    digitalWrite(ledPins[i], HIGH);
    delay(speed);
  }
}

void loop() {
  unsigned long now = millis();
  
  switch(pattern) {
    case 0: knightRider(50); break;           // Knight Rider
    case 1: waveChase(75); break;             // Wave effect
    case 2: randomFlash(30); break;           // Random sparkles
    case 3: converge(60); break;              // Ends → center
    case 4: diverge(60); break;               // Center → ends
    case 5: pairChase(80); break;             // LED pairs
    case 6: sparkle(20); break;               // Fast sparkle
    case 7: runningOnes(40); break;           // Multiple chasers
  }
  
  // Change pattern every 8 seconds
  if(now - lastChange > 8000) {
    pattern = (pattern + 1) % 8;
    Serial.print("Pattern: ");
    Serial.println(pattern);
    lastChange = now;
    clearAll();
    delay(500);
  }
}

void waveChase(int speed) {
  for(int i=0; i<numLeds; i++) {
    digitalWrite(ledPins[i], HIGH);
    delay(speed);
  }
  for(int i=0; i<numLeds; i++) {
    digitalWrite(ledPins[i], LOW);
    delay(speed);
  }
}

void randomFlash(int speed) {
  for(int i=0; i<20; i++) {
    int randPin = random(0, numLeds);
    digitalWrite(ledPins[randPin], HIGH);
    delay(speed);
    digitalWrite(ledPins[randPin], LOW);
  }
}

void converge(int speed) {
  for(int i=0; i<numLeds/2; i++) {
    digitalWrite(ledPins[i], HIGH);
    digitalWrite(ledPins[numLeds-1-i], HIGH);
    delay(speed);
  }
  clearAll();
}

void diverge(int speed) {
  for(int i=numLeds/2-1; i>=0; i--) {
    digitalWrite(ledPins[i], HIGH);
    digitalWrite(ledPins[numLeds-1-i], HIGH);
    delay(speed);
  }
  clearAll();
}

void pairChase(int speed) {
  for(int i=0; i<numLeds-1; i+=2) {
    clearAll();
    digitalWrite(ledPins[i], HIGH);
    digitalWrite(ledPins[i+1], HIGH);
    delay(speed);
  }
}

void runningOnes(int speed) {
  clearAll();
  digitalWrite(ledPins[0], HIGH);
  digitalWrite(ledPins[7], HIGH);
  digitalWrite(ledPins[13], HIGH);
  delay(speed);
  for(int i=0; i<7; i++) {
    digitalWrite(ledPins[i], ledPins[i+1]);
    digitalWrite(ledPins[i+7], ledPins[i+8]);
  }
}

UPLOAD & WATCH - Auto Pattern Switching

Copy-paste code → Upload → Serial Monitor (9600 baud). Changes pattern every 8 seconds automatically!

8 Killer Patterns Included

  • 0: Knight Rider (back-forth scan)
  • 1: Wave (all on → all off)
  • 2: Random sparkle bursts
  • 3: Converge (ends → center)
  • 4: Diverge (center → ends)
  • 5: Pair chase (2 LEDs at once)
  • 6: Fast sparkle fireworks
  • 7: 3-dot running chase

Pin Mapping Confirmation

D0=LED1, D1=LED2, D2=LED3... D13=LED14. All pins driven LOW→HIGH→LOW.

Speed Control Version

Program: Potentiometer Speed Control
// Add potentiometer to A0 for speed control
int potPin = A0;

void setup() {
  // ... same pin setup ...
}

void knightRider(int speed) {
  int potValue = analogRead(potPin);
  int adjustedSpeed = map(potValue, 0, 1023, 20, 200);
  // Use adjustedSpeed instead of fixed speed
}

Pattern Selection Buttons

Program: Button Pattern Switch
// Button on D14 (A0) to change patterns
if(digitalRead(A0) == LOW) {
  pattern = (pattern + 1) % 8;
  delay(200);  // debounce
}

Troubleshooting Your Setup

  • Some LEDs dim: Check 220Ω resistors on ALL LEDs
  • D0/D1 flicker: Normal (RX/TX) - use D2-D13 only if needed
  • Not all LEDs: Verify breadboard power rails connected
  • Too fast/slow: Change delay(50) values in functions

Pro Tips

  • Different color LEDs = amazing rainbow effect
  • Use 330Ω resistors for brighter whites
  • Add capacitor across power rails for stability
  • D13 has built-in resistor - slightly dimmer