Basically you need a frequency fast enough so that the eye doesn't detect it, and a smooth ramp up / down in duty cycle over a 4 minute period.
The problem is that with just 255 steps between 0% and 100% you will notice the stepping in brightness at low levels, such as when the value is in single figures. For smooth dimming you need 4096 steps. One solution would be to use an PCA9685 chip which has 16 PWM outputs, each with 4096 steps, and is controlled via I2C bus.
Bookmarks