Community project

Potentiometer LED Dimmer

WMKIDS

Published July 28, 2026 · Updated July 28, 2026

Arduino3 components4 assembly steps
Remix this project
Photo of Potentiometer LED Dimmer

This project demonstrates analog input and PWM output on an Arduino Uno by building a simple LED dimmer controlled by a potentiometer. Turning the knob smoothly adjusts the LED brightness from off to full brightness, making it an ideal introduction to reading analog sensors and controlling power output.

The guide includes a complete wiring diagram, a parts list with the Arduino Uno, potentiometer, LED, and current-limiting resistor, step-by-step assembly instructions for breadboard layout, and ready-to-upload firmware that maps the potentiometer's analog reading to PWM brightness levels.

Wiring diagram

Interactive · read-only
Wiring diagram for Potentiometer LED Dimmer

Pan and zoom to explore the wiring. Remix the project to edit it in your own workspace.

Parts list

Bill of materials
ComponentQtyNotes
LEDRed 5 mm1Standard 3mm/5mm through-hole LED. A current-limiting series resistor is added automatically.
220 Ω Resistor220 Ω1Through-hole current-limiting resistor in series between Arduino PWM pin D9 and the LED anode.
10kΩ Potentiometer10 kΩ1A 3-terminal passive resistive voltage divider with a total resistance of 10kΩ. One end connects to 5V, the other to GND, and the wiper outputs a variable voltage between 0V and 5V.

Assembly

4 steps
  1. Prepare the breadboard power rails

    Use jumper wires to connect the Arduino Uno 5V pin to the breadboard positive rail and an Arduino GND pin to the breadboard ground rail. All circuit ground connections must share this ground rail.

    • Tip: Keep the red/positive and blue/ground rails consistent across the breadboard.
    • Tip: The Uno can be powered through its USB port for this low-current circuit.
    • Do not connect the 5V rail directly to Arduino analog pin A0 or digital pin D9.
  2. Wire the 10 kΩ potentiometer

    Place the potentiometer so its three terminals are in separate breadboard rows. Connect one outer terminal (End1) to the 5V rail, the opposite outer terminal (End2) to the GND rail, and the center terminal (wiper) to Arduino A0.

    • Tip: If clockwise rotation makes the LED dim rather than brighten, swap the two outer potentiometer wires; leave the center wiper on A0.
    • Tip: A0 is the Arduino pin labeled A0, not digital pin 0.
    • Ensure the center wiper is not shorted to either power rail.
  3. Install the LED and current-limiting resistor

    Insert the LED with its long lead (anode) in one row and its short lead or flat-side lead (cathode) in a different row. Connect the cathode to the GND rail. Connect the LED anode to one end of the 220 Ω resistor, then connect the resistor’s other end to Arduino digital pin D9.

    • Tip: D9 is PWM-capable, so it can vary LED brightness.
    • Tip: The resistor may be placed on either side of the LED electrically, but it must remain in series with the LED.
    • Never connect the LED directly from D9 to GND without the 220 Ω resistor; excessive current can damage the LED or Arduino pin.
    • Check LED polarity before applying power.
  4. Final connection check

    Confirm the circuit has exactly these signal connections: potentiometer wiper to A0, D9 to 220 Ω resistor, resistor to LED anode, and LED cathode to GND. Confirm both outer potentiometer pins go to 5V and GND.

    • Tip: After deploying the firmware, turn the potentiometer slowly: one direction should move from off to full brightness.
    • Disconnect USB power before moving wires if you suspect a short circuit.

Pin assignments

Board wiring reference
PinConnectionType
5Vpotentiometer_1 End1 (VCC side)power
GPIO 14potentiometer_1 Wiper (middle)analog
GNDpotentiometer_1 End2 (GND side)ground
GPIO 9resistor_1 INdigital
EXTresistor_1 OUTLED ANODEdigital
GNDled_1 GNDground

Firmware

Arduino
main.cppDeploy to device
#include <Arduino.h>
// Potentiometer-controlled LED brightness for Arduino Uno.
// A0 reads 0..1023; D9 outputs PWM duty cycle 0..255.

const uint8_t POT_PIN = A0;
const uint8_t LED_PWM_PIN = 9;

int lastBrightness = -1;

void setup() {
  pinMode(LED_PWM_PIN, OUTPUT);
  analogWrite(LED_PWM_PIN, 0);
}

void loop() {
  const int potReading = analogRead(POT_PIN);
  const int brightness = map(potReading, 0, 1023, 0, 255);

  // Only update PWM when the requested visible brightness changes.
  if (brightness != lastBrightness) {
    analogWrite(LED_PWM_PIN, brightness);
    lastBrightness = brightness;
  }

  delay(10);
}

“Deploy to device” opens this project in Schematik, where you can flash it to your board over USB.

Remix this project

Make it yours in one click

Open a full copy of this project in your own Schematik workspace — diagram, code, parts, and assembly steps included. Swap the sensor, add features, or redesign the whole thing with AI. The author's original stays untouched.

Open in Schematik