Light-Sensitive, Motion-Sensitive, Lighting

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Desired operation: When it gets dark enough the LM311 will energize the PIR sensor. When the PIR sensor detects motion, the LED's will light up.

Question:
1) Does this setup look right?

Problems with test circuit:
After bread boarding the LM311 and callibrating the "dark-sensitivity" I get LED1 to light when it gets dark and off when light, but a resistor/LED connected to the collector side of Q1(2N3904)...testing the transistor switch, results in oddness! It is dimly lit when the circuit should be de-energized and off when the circuit is energized. WT_.

??

NightSensorLight.JPG
 

LesJones

Joined Jan 8, 2017
4,174
I think your problem is caused by leakage current between the positive supply to the PIR and it's output pin. I think switching the positive supply to the PIR rather than the ground would solve that problem. Quite a few PIRs I have seen need time to stabilise after applying power so I think you should have it powered on all the time and use it's signal output logically ANDed with the output of the light sensor.

Les.
 

ericgibbs

Joined Jan 29, 2010
18,766
hi,
I would agree with Les regarding that problem and the power up settling time of the PIR module.
If it is the same circuit as this PDF, there is a way for adding an LDR to the PIR module.

Also note as the active output state is only 3v, the 1K in series with the PIR output pin, when driving the LED transistor Base/Resistor.

E
 

Attachments

danadak

Joined Mar 10, 2018
4,057
In order to saturate the LED drive transistor you need to supply Ic/10 mA
to the base, ~ 60 mA. I am guessing the PIR cannot supply that into the
base of Q2 ?

Consider a logic level MOSFET to handle that function.



Note 2N7000, as shown, not suitable for you current requirements.
Also the 100K R shown, thats to hold off the LEDs if PIR tristates
its output when powering up. I would make that a 10K ohm R, to
mimimize pickup/coupling when PIR is tristate (if its output is a
tristate output).

Pick a Logic Level MOSFET that is fully turned on by PIR output
V. Also Rdson rating, select it to dissipate < 100 mW when on.
So P = I ^2 x Rdson = .1W, or Rdson = .1 / (.6A ^ 2) <=~ 3 mili
ohm. You could always let it dissipate a little more as cost of MOSFET
directly affected by its Rdson (read its die size). Say a 10 mili ohm
would be OK.


Regards, Dana.
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
LesJones, ericgibbs,
My apologies for my poor description of the circuit problem. I had not attached the PIR sensor to the circuit yet, but merely a resistor/LED to the collector of Q1. This is where I am experiencing the LED issue. This means that I have two LED's in my partially constructed circuit, one directly off pin 7 of the LM311 and the other in line with the collector of Q1(to verify its proper functioning). The PIR is not in my current setup as yet.

Dana,
Again...my mistake in not making the problem apparent. Though your information is good to have going forward, the current problem is from Q1 being driven from the op-amp only. Below is the portion of the 'whole" circuit I am having trouble with.

00.JPG
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Hello,

When the PIR sensor is using a BISS0001 chip, it has its own possibility of dark sensing:

View attachment 169679

Bertus
That's good to know. Thanks.

But.....as usual with commercial light sensing switching, they always turn on way to early. They sense dusk(ex: the light sensing night-light in my hallway...it is on all day, despite not needing light all day.) Another example: the motion sensor in my bathroom seems to turn on a light even during the day, despite the fact that the sensor also includes an LDR/Cds.
pir2.JPG
 

Attachments

Last edited:

bertus

Joined Apr 5, 2008
22,270
Hello,

In the schematic that I posted R2 and the LDR R3 will determine the activation of the dark sensor.
Changing R2 will change the switchpoint.

An other option would be a transistor controlled by your circuit in stead of the LDR R3.

Bertus
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
hi iONic,
What voltage do measure on pin7 when activated and not activated.?
W
Was just about to post this
text.JPG

This is really reverse of what I would expect, or what I am aiming for!
Is the LED that runs off the output of the opamp working as it should and not as I am expecting?
Is the LDR/resistor feeding the opamp reversed. In other words, should LED1 from the opamp and LED2 biased from the transistor be in sync?
 
Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
hi,
I don't see how its possible to have 10.8V on the Base, unless the transistor is faulty or incorrectly wired.??

E
Bingo!

Not wired wrong! FAULTY!
replacing it with another corrected this mystery.

Voltage on NPN base - Dark(0.741V) Light(0.289V)
 

ericgibbs

Joined Jan 29, 2010
18,766
hi,
Nicely done!
Lets know how the rest of the project works out.
The warm up delay of the PIR gives erratic Hi/Lo's so make sure there is a steady Hi signal before the LED's are powered.

E
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
Pt. 2 - adding the PIR

Circuit:
ckt2.JPG
In the above circuit, when the LDR detects darkness LED1 turns on, when it detects light LED1 turns off. However, the PIR seems to be always on. The PIR works as it energizes Q3 to turn LED4 on when motion is detected. So Q3(PNP) seems not to be operating properly. Food-for-thought while I take some measurements and report back.

Notes: Hmmm, thought I had a PNP as Q3 but it was a PN2222. Flipped it around and it worked very well. But the PNP did not. Then I realized I had designated the pins incorrectly, but flipping this around did nothing to help.

Below is the ckt config that IS working. Notice the reversed NPN transistor. Something seems strange here.
ckt2b.JPG
 
Last edited:

ericgibbs

Joined Jan 29, 2010
18,766
hi Icon,
You appear to have the day/nite sensing inverted.???
Look at this LTS sim.
E

BTW:R7 and the LED is effecting switch Off of the PNP, they are pulling the LM311 output low enough to keep the PNP conducting.
Rem: the LM311 is O/C output.

The 2nd image is an option.
 

Attachments

Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
hi Icon,
You appear to have the day/nite sensing inverted.???
Look at this LTS sim.
E

BTW:R7 and the LED is effecting switch Off of the PNP, they are pulling the LM311 output low enough to keep the PNP conducting.
Rem: the LM311 is O/C output.

The 2nd image is an option.
In all honesty, R7 and it's attached LED does not need to be located where it is. It can be located after Q2. In other words I will remove R7/LED from the circuit and replace my backwards NPN with a PNP and see what happens.

I see the LTS sim, but was pretty darn sure I had this correct prior to adding the PIR(Post #6).
 

Thread Starter

iONic

Joined Nov 16, 2007
1,662
OK, let's see what we have now.
01.JPG

Removed the 6.8k resistor with the LED from pin 7of op-amp. LED turns on when Dark, off in light.
Still question the LTS sims results.

02.JPG

Added PIR as shown above. Effectively the PIR is never off. When dark the "sig" pin of PIR was reading 3.xV and when light the pin was reading 11.xV


03.JPG

But when configured as above, the signal pin was reading as is should. Also after adding a PN222 with LED to the "sig" pin all was well too.
0V when light, 0.7V when dark.
Now, on to the final stage...using the proper NPN from PIR to drive the LED current. Still need to find the correct PIR for this circuit, the ones with adjustable distance and on duration pots. I have them, just need to find them.
I'm looking good for now. The "resistor/LED" fron pin 7 of the op-amp was tossing a wrench in things.
 

ericgibbs

Joined Jan 29, 2010
18,766
hi Ion,
By changing to a NPN and removing the LED, you have changed the sense of the lite/dark as I suggested in my simulations.:)
The Hi output of the LM311 now turns On the NPN, where it tried to turn Off the PNP.

So what is your query with the first LTS sim.?

Ref the PIR you will be able to get an adjustable sensitivity and On period.

E

I use this type.
https://www.amazon.co.uk/Aukru-HC-S...TF8&qid=1549647052&sr=8-1&keywords=pir+module

EDIT:
This sim shows the change from PNP to NPN , so changing the sense.
 

Attachments

Last edited:

Thread Starter

iONic

Joined Nov 16, 2007
1,662
So what is your query with the first LTS sim.?
I think I questioned what it was saying as the circuit was proving otherwise. This was likely the PNP/NPN swapping I was doing.

The PIR I plan to use if essentially just what you referenced. I have a couple, but they are burred in the piles of electronics at my workbench(just picture the aftermath of a hurricane.) A bad habbit, I know, one I must learn myself out of!
 
Top