Light Dimmer Circuit using Arduino – Tutorial 3

In this project you will learn come to learn “How to make DIMMER CIRCUIT ?” In this project you will learn use of potentiometer.

Potentiometer is a VR (variable resistor) with a knob that allows you to alter the resistance of the potentiometer as you turn it. It is commonly used for volume controls on audio equipment. This project uses a 50k-ohm potentiometer.

By using of potentiometer , we can control brightness of LED.

To complete this project we require following component :-

1Arduino board
3Jumper wires
550k-ohm potentiometer
6470-ohm resistor
7Arduino Uno cable
8Power Supply


How it Works :-

Potentiometer continuous generating a analog signal, which require a physical measurement.

To create persistence of vision, the Arduino uses a technique called pulse width modulation (PWM). The Arduino creates a pulse
by switching the power on and off very quickly. The duration that the power is on or off (known as the pulse width) in the cycle determines
the average output, and by varying this pulse width the pattern can simulate voltages between full on (5 volts) and off (0 volts). If the
signal from the Arduino is on for half the time and off for half, the average output will be 2.5 volts, halfway between 0 and 5. If the
signal is on for 80 percent and off for 20 percent, then the average voltage is 4 volts, and so on. You can vary the signal, which in turn
varies the pulse width, by turning the potentiometer left or right, increasing or decreasing the resistance. Using this technique, you can change the voltage sent to the LED and make it dimmer or brighter to match the analog signal from the potentiometer. Only pins 3, 5, 6, 9, 10, or 11 on the Arduino can use PWM.


//welcome to kits4u tech blog//
int potPin = A0; // Analog input pin connected to the potentiometer
int potValue = 0; // Value that will be read from the potentiometer
int led = 9; // Pin 9 (connected to the LED) is capable of PWM
// Runs once at beginning of the program
void setup() {
 pinMode(led, OUTPUT); // Set pin 9 to output
// Loops continuously
void loop() {
 potValue = analogRead(potPin); // Read potentiometer value
 // from A0 pin
 analogWrite(led, potValue/4); // Send potentiometer value to LED
 // to control brightness with PWM
 delay(10); // Wait for 10 ms
Author: kits4ublog

Leave a Reply

Your email address will not be published.