This project allows you to smoothly adjust an LED’s brightness by turning a potentiometer knob.
The potentiometer outputs different voltage levels as you turn it (using variable resistance). The Arduino reads this voltage through its analogue input pin A0, converts it to a digital value between 0-1023, and uses this value to control the LED’s brightness through PWM (Pulse Width Modulation) on pin 11.
Parts List
- 1x Arduino Uno
- 1x LED (any color)
- 1x 220Ω resistor
- 1x 10kΩ potentiometer
- Breadboard
- Jumper wires
Assembly Instructions
- Place the LED on the breadboard, noting the longer leg (anode) and shorter leg (cathode)
- Connect the LED’s anode through the 220Ω resistor to Arduino pin 11
- Connect the LED’s cathode to Arduino GND
- Connect the potentiometer’s centre pin to Arduino A0
- Connect one of the potentiometer’s outer pins to Arduino 5V
- Connect the potentiometer’s other outer pin to Arduino GND