Introduction: Led Brightness Without Potentiometer With Arduino
We can glow LED with different brightness in loop without using potentometer also by connecting LED to PWM pins namely, pin 3,5,6,9,10,11 which supply voltage between 0 to 5V .
Resistance between 220 ohms to 1K ohms can be used in resistance with LED.
Step 1: Component Required
Step 2: Circuit Schematic
Pin 9 --> led anode
GND--> led cathode
Step 3: Arduino Code
we use analogWrite function instead of digitalwrite with PWM pins and duty cycle of PWM is between 0 to 255.
analogWrite(pin number, PWM dutycycle);