Small and easy to understand LED controller using potentiometer.
All the pictures and files you need can be found further down. I hope everyone likes the new version I have made, and if you do please show me some respect by hitting the thumbs up so that more people can find this project. =)
(Be careful to connect everything correctly so that you don't accidentally break anything!)
EXPANDED TECHNICAL DETAILS
Analog-to-Digital Intensity Control
This project explores the foundations of PWM (Pulse-Width Modulation) by using a physical knob to control the brightness or transition-speed of an LED.
- ADC High-Resolution Sampling: The Arduino captures the analog voltage (0V-5V) from a potentiometer. The firmware maps this 10-bit range (0-1023) to an 8-bit PWM duty cycle (0-255).
- Logarithmic Brightness Mapping: (Advanced version) Because human eyes perceive light logarithmically, the Arduino uses a "Gamma Correction" lookup table, ensuring that the LED appears to brighten and dim smoothly as you turn the knob.
Prototyping
- Verified with Arduino IDE: Optimized for 100% stability, with a software "Hysteresis Filter" that prevents the LED from flickering when the potentiometer is at rest.