Unit 3 Exercise 3-1 Potentiometer Cotrolled Led Dimmer
Unit 3 Exercise 3-1 Potentiometer Cotrolled Led Dimmer
_3__
Introduction:
ILED brightness control is important for energy efficiency and user convenience. This
experiment uses a potentiometer and an Arduino to adjust LED brightness through Pulse
Width Modulation (PWM). Students will learn basic circuit connections, coding, and how
analog inputs control digital outputs, gaining hands-on experience in electronics and
programming.
Learning Objectives:
3.Learn how to write, compile, and upload an Arduino program to implement a variable LED
dimmer.
Learning Outcomes:
1. Students will be able to correctly wire and assemble the potentiometer-controlled LED
dimmer circuit following a provided schematic.
2. Students will successfully write and upload an Arduino sketch to control LED brightness
based on potentiometer input.
3. Students will analyze and explain the role of PWM (Pulse Width Modulation) in controlling
LED brightness and its practical applications.
Statement of Problem:
1
4. USB Cord
5. AC Power Cord
6. Arduino Uno Trainer
Methodology:
1. Circuit Setup – The Arduino Uno board was connected to a computer using a USB cable
for power and programming. A correct AC voltage was supplied to the ITS-100 to power the
circuit.
2. Component Connections – The 1W LED was connected to digital pin 3 of the Arduino
board, while the potentiometer’s wiper was connected to analog pin A2. The circuit was
wired according to the provided schematic diagram
.
3. Programming the Arduino – The Arduino IDE was used to write a program that defined
the potentiometer as an input and the LED as an output. The program utilized the
analogRead() function to read the potentiometer value and mapped it to a PWM signal using
analogWrite() to control LED brightness.
//========== Initialization============
void setup()
//==========Main Code============
void loop()
2
}
4. Uploading the Code – The written code was compiled and uploaded to the Arduino board.
Any errors encountered during the compilation were checked and resolved before execution.
5. Testing and Observation – The potentiometer was adjusted from minimum to maximum,
and the LED brightness was observed. The behavior of the LED was analyzed to determine
if it correctly followed the potentiometer's input changes.
The system successfully controlled the LED brightness based on the potentiometer’s
position. When the potentiometer wiper moved from bottom to top, the LED brightness
increased gradually. Conversely, when moved from top to bottom, the brightness decreased
accordingly. The PWM signal output effectively modulated the LED intensity, demonstrating
that the potentiometer could serve as an efficient dimmer control.
Documantaion:
3
4
5