Maker Pro
Maker Pro

Passive infrared sensor relay control.

thorpenny

Jul 21, 2011
7
Joined
Jul 21, 2011
Messages
7
Hello I am relatively new to electronics so please dumb down your responses, if any.

I am trying to build a circuit where a relay is operated by a 3v output PIR sensor which operates on 12v. The batteries I am using to power the PIR sensor are 10 1.2v Ni-MH 3000mA batteries. What I need to know is how to rig it so when the PIR detects something (voltage on output is high), the relay is activated and the circuit that goes to the 12v motor is completed. Further, I was wondering if I can use the same power source for the PIR as the motor? :confused:
 

TBennettcc

Dec 4, 2010
292
Joined
Dec 4, 2010
Messages
292
You should be able to use the same power source. What kind of current does the motor draw?

Are you saying that the PIR sensor is high (3V) when it detects, and low (0V) when it does not detect?

If so, then this should work.
 

Attachments

  • PIR-Relay.gif
    PIR-Relay.gif
    10.8 KB · Views: 5,926

thorpenny

Jul 21, 2011
7
Joined
Jul 21, 2011
Messages
7
Thank you so much for your help! Yes, the pir output is 3v when it is high and 0v when it is low and the motor draws about 2.5 amps/hour without any load. Also, I was wondering if I would need a diode to protect the pir from any voltages produced from the relay?
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
If so, then this should work.

There's a few problems with this circuit. Primarily the 100k resistor in series with the relay coil is likely to stop the relay from operating.

Secondly, it is more typical to place the load in the collector rather than the emitter of the transistor.

There should be a diode connected in reverse (anode to negative) across the relay coil to absorb the transient generated when the relay is released (otherwise your transistor will be quickly damaged).

Given the new information by the OP, the best solution is one where the transistor has it's emitter grounded, the relay is connected between the collector and +V, the PIR is (presumably) powered by the same 12V and it's output is connected (via a resistor, say 470R) to the base of the transistor.

If the motor is being run from the same 12V source, you may need to decouple the power supplied to the PIR from the motor.
 

TBennettcc

Dec 4, 2010
292
Joined
Dec 4, 2010
Messages
292
Thanks for those points, Steve.

Yeah, if you couldn't tell, I'm a little wet behind the ears when it comes to designing circuits, especially with transistors. I knew somebody would say something if what I posted didn't look right. Thanks!

Why is it more typical to place the load in the collector rather than the emitter of the transistor? Is this only for NPN transistors? I tried to do some research on how transistors are typically used for switching applications. I thought I got the concept, but I must've misunderstood something along the way.

Whoops. Forgot the diode across the relay. Good catch!

Why should the PIR be connected with a resistor in series to the base of the transistor? In order to limit current? Is there any reason you picked a 470R?

How would you decouple the PIR and the motor? Use a capacitor?

As always, thanks again Steve.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
Why is it more typical to place the load in the collector rather than the emitter of the transistor?

The reason is that if there is any resistance between the emitter and ground, the current through the emitter (both base and collector current) cause a voltage drop which increases the voltage which must be applied to the base. In essence it is negative feedback. That is all wonderful in an audio amplifier because it allows differences in gain between various transistors to be evened out (amongst other things). But for a switching circuit we would generally prefer that the transistor act as a switch rather than a linear amplifier, so reducing the gain is something we don't want to do.

Is this only for NPN transistors?

No it applies to PNP as well, and to mosfets -- albeit with a change in the names of the elements.

Why should the PIR be connected with a resistor in series to the base of the transistor? In order to limit current? Is there any reason you picked a 470R?

We don't know what the output of the PIR is. If it is a stiff voltage source, then it may try to maintain 3.3V (or whatever) under load. Given that there is now no resistance in the emitter, all you're looking at driving is the BE junction of the transistor. Without current limiting you may damage either the PIR output or the transistor.

470R just seemed like a reasonable value. You probably could use anything from 100R to 4k7. The actual value you'd choose (if you went to the effort of calculating it) would depend on the nature of the PIR's output, the HFE of the transistor, and the current required for the relay.

470R seemed like a safe value :)

How would you decouple the PIR and the motor? Use a capacitor?

You would measure the current required for the PIR and place a resistor in series with it that limits the voltage drop to maybe 1V. You would then place a capacitor across the PIR chosen so that the time constant was significantly longer than the duration of any spikes that the motor might place on the power rail. Practically you might just pick 100uF or something like that.

There are other methods. If the PIR required (or could operate from) a lower voltage, then a zener diode could also be used to provide a more regulated voltage.
 
Top