PIR Sensor troubleshooting

Hello there people of the internets,

I'm an electronics newb, hoping someone can help me.
I'm trying to trigger a 1.5-3 volt DC motor using a PIR sensor, without using a microcontroller.  

I have the PIR sensor's output connected to an npn transmitter which triggers a 5v spdt relay to switch on the motor.  When testing the circuit with an LED, it works perfectly, turning the LED on when motion is detected.  
When I swap the LED for the motor, the relay turns on the motor repeatedly every 6 seconds no matter whether there is motion or not.
(it also may have killed the relay after about a minute or two)

I tried a different circuit, using a transistor as a switch instead of a relay, which also works perfectly with an LED, but when the motor is connected instead, again the motor is turned on every 6 seconds without a care for the PIR output.

What could I be doing wrong here?  I'm assuming that perhaps it has something to do with kickback from the motor...maybe?

Anybody have any advice?  (Remember, no microcontroller!  As much as I'd love to try my hand at using arduino or the like, I can't afford to use a microcontroller for this particular project.)

gmoon6 years ago
Those are odd  results.

-- PIR->NPN->relay->whatever:
IF this works with the LED, it should work correctly regardless of what's being driven by the relay. The relay switch is completely isolated from the circuit that drives the relay coil.

But you NEED a protective shunt diode across any inductive load  (a relay or a motor) when you're switching with transistors. It's possible you've already damaged your transistor... This is assuming you're using a trad relay, not a solid state type.

-- PIR->NPN->LED (or motor):
For a small motor, something like a 2N2222 should have enough current capacity to drive the motor directly (still need that diode).

BJ transistors are "current amplifiers," so the load itself has a direct effect on the value of the base resistor (Rb). The PIR outputs a set voltage, so the base current is adjusted with the Rb.

The link above outlines how to figure for the Rb. Without the correct value here, the load will trigger spuriously, or not at all.

Something like an LED might only need a base resistor of 5K-10K, while a small motor might need an Rb of 250-500 ohms...

All this is assuming your NPN isn't already fried by the inductive spikes (the diode thing)...
caitlinsdad6 years ago
I may be wrong but there might be current leakage through the IR sensor. It is always active but it takes a microprocessor to recognize the threshold level or the value it is at to trigger something else like light up an LED. Unless it is completely blacked out from any light will there be 0 voltage going through the sensor?
Is that a PIR sensor circuit or just a photoresistor?