Light-Sensitive, Motion-Sensitive, Lighting

ericgibbs

Joined Jan 29, 2010
21,439
hi Ion,
Q2 is configured as an Emitter follower, I would use a lower value resistor for R5, say 47R thru 150R.
Don't forget the PIR module will not be stable for about a one minute after power On.
So the SIG voltage will switch Hi/Lo during that warm up period, so the circuit connected to SIG should be configured to handle that erratic operation.

If you check the PIR, the type I posted, you will see the standby current is uAmps, so you could keep the PIR powered and use the LM311 output , ANDing with the SIG output voltage to control the nite/day operation of the lamps.

E

Footnote:

Checking the LM311 and its supporting components, with the NPN/PIR removed, shows a day lite standby current of ~ 15mA, compared to the < 50uA drawn by the PIR module in standby.
I would recommend ANDing the PIR SIG and the LM311 output, via a suitable voltage divider circuit. [ Rem: LM311 = 12Vo ,,,, PIR = 3Vo]
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
hi Ion,
Q2 is configured as an Emitter follower, I would use a lower value resistor for R5, say 47R thru 150R.
Don't forget the PIR module will not be stable for about a one minute after power On.
So the SIG voltage will switch Hi/Lo during that warm up period, so the circuit connected to SIG should be configured to handle that erratic operation.
So far the "warmup period has not given me any trouble. It seems to take about 15s - 20s to operate correctly but with no erratic light output from the LED's. The circuit is built(excluding the section in RED - see image below), but this doesn't mean I can't change things.

If you check the PIR, the type I posted, you will see the standby current is uAmps, so you could keep the PIR powered and use the LM311 output , ANDing with the SIG output voltage to control the nite/day operation of the lamps.
This actually sounds like a good idea. My reading for the circuit, just the LM311 section, is 24mA standby and 9mA when dark(activated). This seemed a bit high, but after seeing what you sim'd, maybe it's not. The circuit seems to be running a tad warm. I wouldn't expect to notice anything at all really.
Current circuit below:
The high resistor for the flashing LED dims the LED and reduces the activated current from 15mA to 8mA. Will replace base resistor with 120 Ohm
diagnose.PNG

Footnote:
Checking the LM311 and its supporting components, with the NPN/PIR removed, shows a day lite standby current of ~ 15mA, compared to the < 50uA drawn by the PIR module in standby.
I would recommend ANDing the PIR SIG and the LM311 output, via a suitable voltage divider circuit. [ Rem: LM311 = 12Vo ,,,, PIR = 3Vo]
Somehow I did not read this post.[/QUOTE]

Perhaps I can Vreg the 12V to 5V for operating the LM311 & PIR. I can also replace the LM311 with a low-pwr one. I would be looking at the "Operating Supply Current" parameter for this, correct?
These are the op-Amps I have in my toolbox:
osc.PNG

Edit:
I have some LM393's with output current of 2mA
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,439
hi Ion,
Consider the 1k on the LM311 output pin.
During the 'PIR Off state' the output is sinking low, so that means, 12V/1k = 12mA current thru the 1k.[ you could increase the 1k to say 4k7]

In the 'PIR ON state' the LM311 output is o/c, so a small Base current, into Q2, flows via the 1k and 10k.
The 10k should be lowered in value, say 100R

E
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Changes:
1) Changed R6(1k) to 3.9k,
2) Changed R5(10k) to 10k//120 or 118 Ohms

Previous results:
Standby current - 24mA
Activated - 9mA

New results:
Standby current - 16mA
activated - 8mA

Changed 12V source to 5V source, limiting resistor from 6.8k to 1k
New results:
Standby current - 7mA
Activated - 4mA

Removal of the LED results in an activated current of 6mA??

All results are derived by placing a 1 ohm, 10W resistor inline with the circuit and measuring the voltage.
 
Last edited:

ericgibbs

Joined Jan 29, 2010
21,439
Removal of the LED results in an activated current of 6mA??
hi,
With the LED shorted out of the circuit, the Q2 Emitter current will increase slightly.
Consider the voltage drop across the 6k8 and a Gn LED, due to the Emitter current thru Q2 it creates a Vbe drop of say 0.7v on Q2
Shorting out the Gn LED means that a higher Emitter current will be required in order to maintain the Vbe of 0.7v.
The Base voltage of Q2 is held steady by the current thru R5 and R6.

Try measuring Q2 Emitter voltage with and without the Gn LED shorted.

E
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Now that I think of it, the V measurement without the LED was made by removing the LED, thus leaving the Q2 emitter floating(not tied to GND)

All-in-all, I believe that the circuits power consumption(thus far) is OK having the following changes.

Changed 12V source to 5V source, limiting resistor from 6.8k to 1k
New results:
Standby current - 7mA
Activated - 4mA
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
DAMSL.PNG Complete Schematic attached of completed, functional project. Darn near got the LED too close to the LDR. It is an old, non-diffused LED that does not disperse the light widely.

project1_open.jpg project1_closed.jpg
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Ahh Phooey!
The circuit worked OK for about a day or two and then started having problems.

What it should be doing..
1) When darkness comes, the PIR sensor is activated via Q2, PN2222
2) An LED indicated the PIR ready state(albeit after about a minute if stabilization by the PIR)
3) When motion is sensed the LED's are activated with 3.3V from PIR via Q1, N-Ch MOSFET

What is happening...
1) When darkness comes, the PIR sensor is activated via Q2, PN2222
2) The LED's come on and stays on until light de-activates Q1, PN2222

This leads me to believe that the Dark sensor is working as desired. It is difficult to say if the PIR is faulty as the lights are on with or without motion. I was ready to rush to judgement on the MOSFET as it seemed that it was always on, but this is not the case as it is off when Q2, PN2222 is off. I am going to take some measurements...any suggestions?

Datasheet for MOSFET see attachment.


Be back...

i


DAMSL.PNG
 

Attachments

MisterBill2

Joined Jan 23, 2018
27,508
Home Depot sells such an item, as do many other places. Both mains powered and battery powered and some with solar cells to charge the battery.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Home Depot sells such an item, as do many other places. Both mains powered and battery powered and some with solar cells to charge the battery.
Yes, similar items. But my device is more specific with respect to when it activates and the distance from the lights. Besides, I had the parts and wanted to start paring down my parts box.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Hmm. After taking down the system from the garage I set it up inside. Upon plugging in the power adapter, the LED's came on, and was on regardless if the dark sensor was active or not. It also stayed on when the PIR signal pin was disconnected. And since the only component separating the complete circuit path is the MOSFET. Voltage on the MOSFET varied at aprox 9V or 5V...at which time the LED's merely flickered dimly.
But the question is WHY?
 

ericgibbs

Joined Jan 29, 2010
21,439
Was my choice of MOSFET OK with the 3.3V PIR signal?
hi ion,
It looks OK from the d/s, check the Vout of the Sig pin is 3V.
Also as a test disconnect Q1 Gate from Sig, [ have the 47K from Gate to 0V connected], then apply +3v to Q1 Gate, the LED's should illuminate.
then check the Drain voltage on Q1, post what you measure, also is Q1 running cool.?
E
AA1 02-Mar-19 08.19.gif
 

Attachments

MisterBill2

Joined Jan 23, 2018
27,508
It is possible that there is some leakage that is biasing the gate to the "on" condition, at least some. Because mosfets do have a high gate impedance they do not take very much current to turn them on. Just a bit of solder flux between the connections can absorb moisture and turn them on in some cases. And the leakage can be any place along the lead connected to the gate terminal.
That might explain the condition or it may not. But it ius one possibility. That is why some folks always use a gate pull-down resistor.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
hi ion,
It looks OK from the d/s, check the Vout of the Sig pin is 3V.
Also as a test disconnect Q1 Gate from Sig, [ have the 47K from Gate to 0V connected], then apply +3v to Q1 Gate, the LED's should illuminate.
then check the Drain voltage on Q1, post what you measure, also is Q1 running cool.?
E
It seems moot, as the LED's are on, despite any connection to the sig pin or Gate.
The PIR sensor reads 3.29V when in darkness, 0.25V when in light.
Drain Voltage is 0V

The LED is sort of on or off sometimes. The 47k resistor does seem to reduce the LED brightness or even turns it off, but generally has not solved the problem. I did some scraping of the perf board between the Gate, Drain, Source pins with no changes to its "malfunctioning" state.
The device runs cool. I think that I should replace the MOSFET(adding the 47k resistor)...my guess. It really should not be allowing the LED's to light with 0V on the gate. I am working indoors with the circuit too, so temperature or moisture is not an issue. The RH this time of year is low, currently in the low 30s(30%-34%). The light, in practice, should be turning off after about 1min and is not. Currently, with the 47k resistor. the circuit in darkness is turning the LED's on, then off when light is introduced, but it is not turning off after about 1 min.

PIR sensor has two pots, one for sensitivity and one for delay.
 

MisterBill2

Joined Jan 23, 2018
27,508
It seems moot, as the LED's are on, despite any connection to the sig pin or Gate.
The PIR sensor reads 3.29V when in darkness, 0.25V when in light.
Drain Voltage is 0V

The LED is sort of on or off sometimes. The 47k resistor does seem to reduce the LED brightness or even turns it off, but generally has not solved the problem. I did some scraping of the perf board between the Gate, Drain, Source pins with no changes to its "malfunctioning" state.
The device runs cool. I think that I should replace the MOSFET(adding the 47k resistor)...my guess. It really should not be allowing the LED's to light with 0V on the gate. I am working indoors with the circuit too, so temperature or moisture is not an issue. The RH this time of year is low, currently in the low 30s(30%-34%). The light, in practice, should be turning off after about 1min and is not. Currently, with the 47k resistor. the circuit in darkness is turning the LED's on, then off when light is introduced, but it is not turning off after about 1 min.

PIR sensor has two pots, one for sensitivity and one for delay.
OK, thatsort of has me a bit stumped, unless the mosfet is one of those that is normally conducting and requires some bias to switch it off. But I am not an expert on those devices, but I have read about them. If it were a bipolar device then I would blame base-collector leakage for the current illuminating the LEDs. One more thought is that LEDs will give some light with far less than the rated voltage and current, so it may be that you just have a small amount of current. If you tie the gate to the source then the device should switch off completely, it seems. That will tell you if it is drain to gate leakage or drain to source leakage. AND now I am wondering about the voltage rating of that particular device. THAT might be the cause, or it may not.
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
OK, thatsort of has me a bit stumped, unless the mosfet is one of those that is normally conducting and requires some bias to switch it off. But I am not an expert on those devices, but I have read about them. If it were a bipolar device then I would blame base-collector leakage for the current illuminating the LEDs. One more thought is that LEDs will give some light with far less than the rated voltage and current, so it may be that you just have a small amount of current. If you tie the gate to the source then the device should switch off completely, it seems. That will tell you if it is drain to gate leakage or drain to source leakage. AND now I am wondering about the voltage rating of that particular device. THAT might be the cause, or it may not.
Yes, it is perplexing. At times it is working as it should, but at other times it is quite bizarre. I can not do a valid test until the PIR sensor has had power for at least 1 minute as this is the period where it can be erratic, according to product descriptions. The datasheet for the MOSFET is attached to Post 34 in case you desire to check it out. ericgibbs believes the MOSFET was OK for its intended use. As I had said, the 47k resister did seem to help some, even though I did not notice any real voltage fluctuations at the gate.
 

MisterBill2

Joined Jan 23, 2018
27,508
OK, I have reviewed several of the circuits and now I suggest to switch off the mosfet but still have it switch on correctly try a 10K resistor from the gate to the source connection. That is a low enough resistance to remove the drive and yet high enough resistance to allow the motion sensor to switch the mosfet on.
 

ericgibbs

Joined Jan 29, 2010
21,439
hi ion.
I did point out that sometimes after being powered up, the PIR On times are erratic, sometimes for a couple of minutes before it settles down.
Thats why its a bad idea to control the PIR via its power supply, ANDing the Sig and Comp output is more reliable.
E
Is the NMOSFET faulty.?
 
Top