• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

Circuit Ideas for You

Get free circuit ideas online.

  • Home
  • Privacy Policy
  • About
Home » Simple Arduino LED Dimmer Circuit using PWM

Simple Arduino LED Dimmer Circuit using PWM

Last updated on 11 June 2026 by Admin-Lavi Leave a Comment

This post show how to make a Simple Arduino LED Dimmer Circuit using PWM, as PWM changes voltage by changing square wave duty cycle; also it changes duty cycle to make LED more or less bright.

Therefore, more power means more brightness.

Arduino Code:

#define LED_PIN 9
#define BUTTON1_PIN 2
#define BUTTON2_PIN 3

int brightness = 0;

void setup() {
  pinMode(LED_PIN, OUTPUT);
  pinMode(BUTTON1_PIN, INPUT_PULLUP);
  pinMode(BUTTON2_PIN, INPUT_PULLUP);
}

void loop() {
  if (digitalRead(BUTTON1_PIN) == LOW)   
 {
    brightness++;
    if (brightness > 255) {
      brightness = 255;
    }
  }

  if (digitalRead(BUTTON2_PIN) == LOW) {
    brightness--;
    if (brightness < 0) {
      brightness = 0;
    }
  }

  analogWrite(LED_PIN, brightness);
  delay(10);
}
  • LED and button pins use constant names like LED_PIN, BUTTON1_PIN, BUTTON2_PIN.
  • Variable “brightness” store how bright LED is now.
  • setup() make button pins input with pull-up and LED pin output.
  • loop() always check button press.
  • BUTTON1 increases the brightness, while BUTTON2 decreases it.
  • analogWrite() set PWM duty cycle to control LED brightness.

Circuit Working:

Simple Arduino LED Dimmer Circuit Diagram using PWM

Parts List:

ComponentsQuantity
Resistor
220Ω 1/4 watt1
10k 1/4 watt2
Capacitor
100µF 25V1
Semiconductors
IC 78091
Arduino Uno board1
LED 5mm 20mA any color1
Tactile switches2

LED must connect correct like in circuit diagram, so the push buttons may be unstable, but they will not cause any errors.

Also, using PWM on Arduino is easy and on ATMEGA it is hard because many settings need change; but in Arduino already set these things so we just use right function for PWM and also Arduino makes square wave signal on LED pin.

Furthermore, resistors and capacitor change square wave to DC voltage and duty cycle control average DC voltage which controls LED brightness.

So press button1 the duty cycle goes up and LED goes more bright and then press button2 the duty cycle goes down and LED goes less bright.

How to Build:

To build a Simple Arduino LED Dimmer Circuit using PWM follow the below mentioned steps:

  • First, gather all parts as per the circuit diagram.
  • Next, connect IC1 7809 to give 9V DC power to Arduino board.
  • After that, connect 100μF capacitor positive side between 220Ω resistor and red LED and negative side to GND.
  • Then connect 220Ω resistor and red LED in series from pin 9 and LED cathode goes to GND.
  • Now connect button1 one leg to pin 2 and other leg to GND and then connect button2 one leg to pin 3 and other leg to GND.
  • Also, connect 10k resistor between pin 2 and 5V and then connect another 10k resistor between pin 3 and 5V.

Conclusion:

To conclude, this article for Simple Arduino LED Dimmer Circuit using PWM show how to use PWM with Arduino to control LED brightness in simple and easy way.

Also, by learning PWM and code we can make many light control projects.

Filed Under: Arduino Projects, DIY Projects, LED and Lamps

About Admin-Lavi

Lavi is a B.Tech electronics engineer with a passion for designing new electronic circuits. Do you have questions regarding the circuit diagrams presented on this blog? Feel free to comment and solve your queries with quick replies

Previous Post: « Arduino Temperature Controller Circuit using DC Fan
Next Post: Simple Servo Motor Controller Circuit using Arduino »

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Primary Sidebar




Categories

  • 555 Timer Projects (111)
  • Alarm Circuits (74)
  • Amplifier Circuits (92)
  • Arduino Projects (103)
  • Audio Circuits (186)
  • Automation Circuits (79)
  • Automobile Circuits (36)
  • Battery Charger Circuits (86)
  • DIY Projects (341)
  • Free Energy (12)
  • Heater and Temperature Controllers (31)
  • High Voltage (24)
  • Hobby Circuits (173)
  • Indicator Circuits (60)
  • Inverter Circuits (19)
  • IoT projects (4)
  • LDR Circuits (45)
  • LED and Lamps (192)
  • Meters and Testers (42)
  • Mini Projects (247)
  • Motor Controllers (24)
  • Oscillator Circuits (64)
  • Power Supply Circuits (220)
  • Radio Frequency (3)
  • Remote Control Circuits (11)
  • Renewable energy (5)
  • Security and Protection (96)
  • Sensors and Detectors (215)
  • Solar Circuits (31)
  • Timer Circuits (62)
  • Transistor Circuits (169)
  • Transmitter Circuit (20)
  • Tutorials (22)
  • Voltage Regulator (26)
  • Water Level Controller (10)

Recent Posts

  • Low Current Controlled Battery Charger Circuit using LM723 IC
  • 741 Op-Amp Treble Booster Circuit
  • Simple Diode and Transistor Based Audio Limiter Circuit
  • Simple 500mW Speaker Driver Circuit
  • Easy DIY LM386 Audio Amplifier Circuit

Recent Comments

  1. Tony Gallegos on NTC Thermistor Based Temperature to Voltage Converter Circuit
  2. colin on Simple Single Transistor Audio Amplifier Circuit
  3. How to Make a Bird Chirping Noise Easily on Chirping Bird Sound Generator Circuit
  4. Transistor Based Medium Impedance Preamplifier Circuit - Circuit Ideas for You on Low Impedance Input Transistor Preamplifier Circuit
  5. Admin-Lavi on Alternate Red Green LED Flasher Circuit

Copyright © 2026 | New Circuit Ideas