I am builing a simple ldr based light sensor. The purpose of this circuit is to turn on or off the relay depending upon the light. the other side of relay is connected with 220v circuit and lamp as a load. i have built this circuit using simple transistors as well as latching transistors. circuit works well at no load. but whenever i connect the lamp on other side of relay flickering of lamp starts. now i am building this circuit with window comparator as well as simple comparater using LM393 IC. but circuit is not working. IC never saturates. I am new to LM393 IC. can anyone tell what are the possible reasons. plz help someone.