Introduction: LED Control

This project is part of my final for CSCI 1200.

This project has 5 LEDs and a potentiometer. Moving the potentiometer changes between the LEDs and fades the LEDs that are next to the current LED.

Step 1: Get Arduino Ready

For this project, you will need:

  • Arduino Uno
  • Breadboard
  • Jumper Wires
  • 5x LEDs
  • 5x 220Ω Resistors
  • Potentiometer

Step 2: Connect Power to Breadboard

Connect the 5v power pin on the Arduino to the power rail on the breadboard. Connect the ground pin on the Arduino to the ground rail on the breadboard.

Step 3: Connect the First LED

Add the first LED to the breadboard and connect the cathode to the ground rail. Connect the 220Ω resistor to the anode leg of the LED and connect it to pin 3 on the Arduino.

Step 4: Add the Rest of the LEDs

Connect the rest of the LEDs to the breadboard the same way as the first one.

Follow the layout below to find which pin each LED goes to.

LED 1: 3

LED 2: 6

LED 3: 9

LED 4: 10

LED 5: 11

Step 5: Add the Potentiometer

Place the potentiometer on the breadboard and connect one of the bottom legs to the ground rail and the other one to the power rail on the breadboard. Connect the top leg to pin A5 on the Arduino.

Step 6: Upload the Code

Upload the code to the Arduino and it will begin running. Turn the potentiometer to change which LED is selected and the ones around that LED will fade.

Attachments