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

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
Q2 is not drawn correctly on the schematic.
A resistor is required between pin6 of the ATtiny and the base of Q1.
Why on the image of the pcb does it shows a TO263-2 for Q2?
Should I still use a 2N7002 instead of the big mosfet to switch on the 5v circuit only at dusk? And run 12v directly to the LEDs and LM393?
Maybe I had a brain fart... LOL
 

sghioto

Joined Dec 31, 2017
8,634
The only reason I see for Q2 is to save battery current, which you stated wasn't an issue.
Why not use the output of the LM393 to trigger the ATtiny ?
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
The only reason I see for Q2 is to save battery current, which you stated wasn't an issue.
Why not use the output of the LM393 to trigger the ATtiny ?
So, connect pin 1 from the LM393 to a digital pin on the attiny. A WHILE statement would keep the LEDs off when pin is LOW, otherwise the code would run.... read PIR and run the light sequence or not... Is that the idea?
 

sghioto

Joined Dec 31, 2017
8,634
No, the code runs when the output from the LM393 is low.
Digital pin on the tiny would require a internal pullup resistor enable or an external 10K resistor can be added
 

sghioto

Joined Dec 31, 2017
8,634
Need to use the other of the LM393 to trigger the ATtiny because of the 12 volts on the LM393 exceeds the input voltage of the ATtiny.
Connect pin5 to pin1 and pin6 to pin2.
Connect pin7 to the digital input of the tiny and enable a pull-up on that pin.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,465
hi john,
I am puzzled why you have reverted to the earlier over complex design in using LM393 instead of the ADC input and the MOSFET where a simple reverse voltage diode would work the same, also I have written sketches for the Nano/Tiny which have been to show to work OK.????

E
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
hi john,
I am puzzled why you have reverted to the earlier over complex design in using LM393 instead of the ADC input and the MOSFET where a simple reverse voltage diode would work the same, also I have written sketches for the Nano/Tiny which have been to show to work OK.????
Hi Eric. I explained it on the earlier post of my latest schematic. I still plan to use that approach, but it will take me time to fully understand it and to get it implemented and tested. However, I need working boards with the hysteresis and other circuit improvements now. I expect to utilize the ADC, eliminate the LM393 and it's resistors by spring time.
 

Thread Starter

johnaustinkaty

Joined Jul 16, 2021
284
Need to use the other of the LM393 to trigger the ATtiny because of the 12 volts on the LM393 exceeds the input voltage of the ATtiny.
Connect pin5 to pin1 and pin6 to pin2.
Connect pin7 to the digital input of the tiny and enable a pull-up on that pin.
I was planning (brainstorming) last night about using the other comparitor to monitor battery voltage level and have pin 7 trigger a rapid blink sequence on the attiny when voltage fell below 11v. A heads up for needing to recharge the battery.
Won't the BS250 energize the 5v circuit at dusk as we discussed? What would the signal from lm393 pin 7 to attiny initiate? Once energized, the light functions are triggered by the PIR sensor.
 
Last edited:

eetech00

Joined Jun 8, 2013
4,709
I think so... maybe just preference, but I would like the entire 5v circuit to be de energized during daylight hours. I hope I understood your question...
The 78L05 draws 5mA with no load.
The LDD-300L draws 10mA with no load.

The LDD-300L is always active in latest schematic. Is it really worth disabling the 78L05?

Just saying...
 
Top