Fading 220 v AC light bulb relay problem

Hello.

I am trying to control 220 ac light bulb with solid state relay (ESR5102401000) using arduino nano.
I've connected D9 pin to 1K resistor and the resistor is connected with the relay. When i start my program which is working fine for dc LED diode, but for ac i get blinking bulb. I am using pwm pin and when it's 250 the bulb is constantly on and when the value starts to fall down the bulb is starting to blink instead of continous fading.

Now my question is, I am doing something wrong with the program which is really simple single for with value of i increasing from 0 to 255 or there something with the frequency of the pin or something third?

Stefan Petkoski

One possibility is that the solid state relay is intended for "on" or "off" and is too slow for brightness control.

Please read and follow the directions in the "How to use this forum" post.

You cannot use PWM with an SSR. Period. The output triac stays on until the zero crossing, you can't turn it off before that. You need phase angle control, that takes this into account, like a real dimmer.

That being said, who even still uses incandescent bulbs? They're being phased out anyway. Here in Europe, you can't buy them anywhere anymore.
Use LED lights with appropriate drivers that accept PWM inputs.

Pieter