Potentiometer Controlled LED Brightness Using Arduino
by DESHBOT in Circuits > Arduino
19 Views, 0 Favorites, 0 Comments
Potentiometer Controlled LED Brightness Using Arduino
The objective of this project is to control the brightness of an LED using a potentiometer. As the potentiometer is rotated, the LED brightness changes accordingly.
Supplies
DESHBOT SHIELD
UNO NANO
POTENTIOMETER
LED ( INBUILD IN SHIELD)
Pin Connections
ComponentArduino PiN
Potentiometer middle pin A0
Potentiometer side pin 5V
Potentiometer other side pin GND
LED D13
Working Principle
The potentiometer produces an analog voltage between 0V and 5V. The Arduino reads this voltage using analog pin A0.
The analogRead() function gives a value between 0 and 1023. This value is converted to 0–255, representing the desired LED brightness.
The Arduino then uses software PWM to rapidly switch the LED ON and OFF. Changing the ON time changes the apparent brightness of the LED.
Working Flow
Rotate Potentiometer → A0 reads value → Value converted to brightness → Software PWM → LED brightness changes
Downloads
Conclusion
This project demonstrates how an Arduino can read an analog input from a potentiometer and use the value to control the brightness of an LED. It is a simple project for understanding analog input, mapping values, and software PWM.