Dark sensor circuit using LM393 question.... unstable OFF/ON... flickering

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
hi john,
Did you measure the resistance of LDR using those test units for the different R7 values.?
E
I handheld my Fluke leads to a handheld LDR around the time I want the light to dim and the meter read 80 ohms. That is when you gave me the original 39k resistor size and the 10k pull up.
 

ericgibbs

Joined Jan 29, 2010
21,463
Hi,
Are you using the one individual LDR for the other units you are testing.? or other LDR's of the same type as the individual, for the other boards you are testing?

E
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
hi,
They will vary in the resistance/light values, this is why I suggest R7 be a trim pot
E
I understand. Could they vary enough to make the light come on well before or after dusk? Or, should it be relatively close? My goal is for the light to come on approx 15 min before or after my preferred ambient light level. This is a considerable difference in available light.
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
This evening I had three lights set up for testing for resistor size needed at R7. Here are the results:
The following values are for R7:
22k came on at 5:50pm
14.7k came on at 6:02pm
12.2k came on at 6:07pm

I believe that a 15k will work perfectly for this light. Good thing is that since I'm doing all of my SMT soldering myself, I will be able to change this resistor size at any point if needed.
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
I believe I'm ready to order boards. I added the hysteresis, the delay circuit for the LDD-700L to eliminate the flash from the high power LED at power on (dusk) and the 2N2222 (Q1) transistor to send the PWM and digital signals to the 5mm red leds (RA) from the ATTINY. Thanks guys for all of your help. This is a much improved design. Please let me know if you see anything I may need to address before I order boards in a few days.
1767229217940.png
 
Last edited:

lichurbagan

Joined Jul 4, 2025
130
I have a dark sensor circuit for my LED night security light. The issue is that as dusk falls and the resistance in my LDR increases, my light flickers erratically for several minutes before either staying energized or staying off altogether. This is happening consistently on several prototypes, some worse than others. If the light stays off after the flickering, I can disconnect the 12v battery and plug it back in and the unit is energized as intended. I have done a lot of research and have not honed in on the problem. Bench testing in the shop with electrical tape on the LDR has the light working perfectly as expected. I analyzed a std PIR sensor module that can utilize an LDR and see approx 12+ capacitors on the board, both ceramic SMT and electrolytic thru hole. I'm guessing that I may need one of the following solutions?

- resistor to stabilize the IRF9Z34N mossfet? If so, what size and where?
- adjustment in my resistor sizes related to the LM393 comparator?
- another capacitor somewhere?

All of this being said, the LM393 was originally needed for a voltage level comparison at PIN 5/6, but that is no longer needed. Should I eliminate the LM393 altogether and simplify things? Or, is there a simple solution to what I already have? What is missing or what adjustment needs to be made?

I really could use your help in stabilizing this circuit so that the 12v power is either OFF or ON and not floating/flickering.
The LDR I am using has the following resistance:
3.6 M ohm in 100% darkness
270 ohm in daylight (cloudy day at noon)

Thx for any help
John



View attachment 361008
What's the value of C4 here?
 

ericgibbs

Joined Jan 29, 2010
21,463
Hi john,
With a part number I could perhaps locate the LDR specification, by knowing that it maybe possible to advise the optimism values for R7 for a known light flux value.
E
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
Hi john,
With a part number I could perhaps locate the LDR specification, by knowing that it maybe possible to advise the optimism values for R7 for a known light flux value.
E
I have no idea what the light flux value would need to be, but I think the part# is as shown below: After last nights testing, I believe a 15k for R7 will be ideal.
1767290405722.png
 

ericgibbs

Joined Jan 29, 2010
21,463
hi john,
This is the PDF datasheet for the 5528.
Note the logarithmic resistance response.
E
Also note the width of the plot, which shows a wide possible variation in resistance/light response of individual LDR's

What are your measured LUX values???
 

Attachments

Last edited:
Top