View Full Version : Connecting pir sensor through a switching transistor?
denny800
Mar 7, 2010, 03:48 PM
I put together a little computer fan circuit using a PIR 555-28027 sensor through a NPN 2N4401switching transistor and I'm not sure if my connedtions are correct. The fan stays on as though the sensor isn't even connected. I have a drawing, but don't know how to put it in here so I'll try and explain.
Power 4.5v DC negative to the fan, positive & negative to the sensor. Out of the sensor to the collector of the transistor, positive to the base and emitter to the positive side of the fan.
Thanks
cdad
Mar 7, 2010, 04:01 PM
What exactly are you trying to do ? Also are you following directions for warming up the circuit?
denny800
Mar 7, 2010, 05:09 PM
I'm wiring a fan to come on via sensor. I wasn't aware of warming up a circuit.
KISS
Mar 7, 2010, 05:10 PM
Use Go advanced/Manage attachments to post in various formats with limitations on size.
cdad
Mar 7, 2010, 05:11 PM
Look for the PDf file that outlines the sensor your using. When I looked it up before it spoke about a warm up time for the sensor so it can calibrate itself.
denny800
Mar 7, 2010, 05:15 PM
Ok, are you saying to wait for the 10 to 60 seconds for the sensor to callibrate and then the sensor should work?
cdad
Mar 7, 2010, 05:17 PM
Yes, they called it warming up the circuit.
denny800
Mar 7, 2010, 05:36 PM
Yes I have let it go for longer than the 60 seconds. You think the wiring is right. Can I put the diagram on here?
KISS
Mar 7, 2010, 06:04 PM
I posted how in post #4.
Your wiring it as a high side switch which it isn't. It has to be used like the circuit in fig #1 here: http://www-inst.eecs.berkeley.edu/~ee105/sp10/labs/2N4401.pdf
The 200 ohm resistor would be connections to the load or your fan.
The two resistors are needed too.
What's the fan current?
denny800
Mar 7, 2010, 06:43 PM
In the first diagram the fan runs constant and in the second the sensor works fine but doesn't allow enough power to run the fan.
Thank you for the advanced help now you can see what I have.
denny800
Mar 7, 2010, 06:50 PM
The fan is DC 12V 0.30a.
KISS
Mar 7, 2010, 07:02 PM
Neither method will work as you found out. I need to hone my schematic drawing skills and I haven't re-installed a package that does it.
The FAN + need to connect to + power
The FAN - needs to go to to the transistor collector
The emitter of the transistor needs to go to ground.
What we don't have is an equlivelent circuit for the PIR detector.
So, the output of the detector would normally go to the base of the transistor through a resistor. A much larger resistor would go from the base to ground. This gives a leakage path.
That's where figure #1 in the data sheet does.
The base needs to be current driven. Saturation (full on) would occur at 600 mA of collector current, so the base current required is 0.6 divided by Hfe(min).
The resistor needed would be sized by the voltage available to turn - a diode drop of the B-E junction.
R < (V - 0.6)/ (0.6 A / Hfe)
I need to look at the data sheet to find those numbers. I'm unhappy there was no equivalent circuit of the PIR detector.
It might work without the resistor.
denny800
Mar 7, 2010, 07:12 PM
I printed out the 2n4401 switching transistor information. Thanks again for leading me to the right one. I'm still not clear on how I should make the connections to make the fan work along with the sensor. I have no problem paying for the information to get the right answers. Radio shack was not sure about a lot of this stuff and as you probably can see I'm not the very up on it either.
Thanks again.
KISS
Mar 7, 2010, 07:48 PM
Does this make sense now?
Modified fig #1 from data sheet.
denny800
Mar 7, 2010, 08:08 PM
What I was told from Parallax this Pir was 555-28027.
KISS
Mar 7, 2010, 08:17 PM
Yep, http://www.jameco.com/Jameco/Products/ProdDS/2082927.pdf But the data in the datasheet is useless. It doesn't give me much to go on for the characteristics of the output like an equlivelent circuit.
denny800
Mar 7, 2010, 09:31 PM
If I'm reading what your saying and I have the connections correct, the fan comes on and stays on. The sensor must be working somewhat because the fan slows down 5% when it kicks on.
Denny
KISS
Mar 7, 2010, 09:43 PM
The drawing shows C and E shorted. E has to go to power minus.
denny800
Mar 7, 2010, 11:03 PM
OK, then where does c go?
DanielF
Mar 7, 2010, 11:47 PM
Your second circuit is the correct one, but 2N4401 is not a power transistor, and is not really suitable for switching the fan.
Also, I'm guessing that the fan is probably intended for 5V operation, but your second circuit will deliver only about 3.5V (4.5V supply minus ~1V transistor B-E drop), which is probably why it's running slowly.
You'd be better off using the 2N4401 as an inverter stage and then driving a PNP power transistor with it. A 5V or 6V supply would also help compensate for transistor losses.
You should also put a 'freewheeling' diode across the fan motor to kill spikes that might otherwise kill your transistor.
Daniel
denny800
Mar 8, 2010, 12:39 AM
Are you saying that the diagram in post #10 is the correct one? Hooked up that way the fan runs all the time and olny slows down about 5% when the sensor activates.
Thank you.
DanielF
Mar 8, 2010, 04:03 AM
I somehow missed the entire Page 2 of answers to your question, which changes a few things.
Had the fan been 5V, then the second circuit in your post #10 would have been the only one of the two that could work. But now I see that the fan is 12V, so it won't work either.
And finally you're confusing me by saying the fan only slows down when the PIR detects something.
Do you want the PIR to start or stop the fan?
When you've answered that, I'll post a new circuit diagram for you that should work. Keep in mind you'll need both 4.5V and 12V power supplies (actually, a power supply from a discarded PC would be ideal, having both 5V and 12V outputs available).
Daniel
KISS
Mar 8, 2010, 04:51 AM
Daniel:
How did I miss all of that? Fan 12 V. PIR 5V.
How about the ULN2003 http://www.datasheetcatalog.org/datasheet2/f/0c6x6a46ig46qlxf3j2qsaii8o3y.pdf
I like the chip. It does contain the diode and rated for 500 mA the fan is 300 mA.
A 5V regulator like the LM7805 and only a 12 V supply?
This assumes that the PIR comes on when people are present.
DanielF
Mar 8, 2010, 07:12 AM
OK, I gather from your earlier post that you want the fan to come on when movement is detected. The following circuits should achieve that. Note the requirement for two supply voltages (+5V and +12V, with a shared common labelled 0V).
If you want to use just a single 12V supply, follow KISS's suggestion of a 78L05 regulator from the 12V supply to feed the PIR sensor.
Due to this website's stupid size limitation, I've had to rotate the drawing 90° – you can rotate it back after downloading.
Daniel
KISS
Mar 8, 2010, 09:39 AM
Yep. Thanks Daniel.
The UF4001 can be a 1N4001 diode which Radio Shack will have.
denny800
Mar 8, 2010, 02:10 PM
I changed your "will work" diagram to using a 12 volt supply only. I think I'm on the same page?
KISS
Mar 8, 2010, 02:41 PM
I also would add a 0.1 uf polyester film cap close to the regulator from IN to ground and one from OUT to ground. It helps keep the regulator stable.
DanielF
Mar 8, 2010, 02:55 PM
Denny,
The 78L05 is not a transistor (though physically it looks like one), but an integrated circuit regulator. I've redrawn it correctly for you, and added some desirable 'stability' capacitors and protection for the MOSFET.
Note that the pinout for the 78L05 is different from the 7805, so if you decide to use the (larger) 7805, check its datasheet for the correct pinout.
Daniel
KISS
Mar 8, 2010, 03:05 PM
D4 is a 10V Zener diode such as Digi-Key - 1N5240BFSTR-ND (Manufacturer - 1N5240BTR) (http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=1N5240BFSTR-ND)
Daniel, why did you put C1 to PIR Out rather than ground?
DanielF
Mar 8, 2010, 03:14 PM
Oops, thanks KISS. Corrected circuit attached.
Daniel