LED Dimmer
TThe LED Dimmer project demonstrates how to control the brightness of an LED using a potentiometer and Arduino Mega. By reading the analog input from the potentiometer, which acts as a voltage divider, the Arduino converts this analog signal into a corresponding PWM (Pulse Width Modulation) signal to adjust the LED's brightness. This project allows users to interactively dim or brighten an LED based on the potentiometer's position.
Components Needed
- Arduino Mega
- LED (any color)
- 220-ohm resistor (for LED protection)
- Potentiometer (10k ohm)
- Jumper Wires
- Breadboard
- Power Supply
Block Diagram
Circuit Setup
Connect the LED and Potentiometer to Arduino Mega:
One pin to 5V (VCC)
One pin to GND
Middle pin (wiper) to analog pin A0 on Arduino Mega
Instructions
Circuit Setup:
Wire the LED and resistor as per the connection diagram provided.
Connect the potentiometer to provide analog input to the Arduino.
Code Upload:
Open the Arduino IDE and create a new sketch.
Copy and paste the provided Arduino code into the sketch.
Testing:
Upload the code to the Arduino Mega.
Adjust the potentiometer knob to vary the LED brightness.
Observe how changing the potentiometer's position changes the brightness of the LED.