I have a LDR board that has been connected to a 5v electromechanical relay board through a Digital Out pin. Both the LDR board and relay board are connected by the Digital Out pin going from LDR to relay. When the light is really low, this works very well but when the light is just fading (dusk), it creates a relay chatter till the light becomes low enough. How do I solve this? Is capacitor a solution?