PIR to Transistor to LED 200620

Thread Starter

allenpitts

Joined Feb 26, 2011
182
Hello All About Circuits forum,

Working on a project that uses a signal from a PIR sensor (AM312)
to send a signal to an Arduino which sends and output to a
transistor that turns on power to an LED.

But could not get it to work and because the out put from
the Arduino looked normal it was suspected that the issue
was with or near the transistor.

So simplified the circuit by eliminating the Arduino and just
sending a signal from the PIR to the transistor to the LED.
PIR_to_Transitor_to_LED_200620.jpg
This circuit does not work.

So started testing. (Of all the things that have assimilated in
working with electronics, the most useful knowledge has come
from learning about testing. Use to be the circuit was constructed,
then powered up and if it didn't work [usually] I was stuck.
The only next step was to rebuild the circuit from scratch
and hope it worked the next time. If it didn't the second
or third time one starts getting into the idea about
doing the same thing over and over and expecting a different
result.)

Test 1. Built circuit according to PIR to Transistor to LED 200620
Result: Not working
1.1 Checked power at power board. Result +5.1v
1.2 Checked power at power input to PIR. Result +5.1v
1.3 Checked power at PIR output during PIR signal high. Result +3.2v
1.4 Checked PIR output at Control board during PIR signal high. Result +3.2v
1.5 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 2. Substitute BC557 at Q1 for BC547 (Rationale: Wanted to sub same transistor,
BC547 for existing to prove component not issue but had no more BC547s
so had to use BC557)
Result: Not working.
2.1 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 3. Substitute PN2222 for BC557 at Q1 (Rationale: Sub similar transistor)
Result: Not working.
3.1 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 4. Substitute 10 ohm for 25 ohm R8. (Rationale: Reduce resistance at transistor to
LED ground)
Result: Not working.
4.1 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 5. Substitute jumper wire for R8. (Rationale: Reduce resistance at transistor to
LED ground)
Result: Not working.
5.1 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 6. Substitute 220 ohm ar R1 for 470 ohm resistor . Replace R8 25 ohm for jumper wire.
Result: Working. That is, the LED is on for a period expected from the known good
high cycle of the PIR.
Test 7. Substitute 470 ohm ar R1 for 220 ohm resistor.
Result: Not working.
7.1 Checked PIR output at Q1 side of R1 during PIR signal high. Result +3.2v
Test 8. Substitute BC547 at Q1 for PN2222.
Result: Working,
Test 9. Substitute BD43R at Q1 for BC547. (Rationale: When the Arduino is refactored
in want Q1 to operate 18 LEDs so will need transistor with max collector current 4 amps)
Result: Working.

So the conclusion is from Test 6 is the the value of R1 was too high.

Next step is to put the Arudino between the sensor and the transistor. The output of the
Arduno is +5v, max 40mA. The output of the AM312 is 3 v but not sure the current is
understood. the data sheet
https://forum.mysensors.org/topic/3658/pir-am312
says the max current is max high output is -10 mA. How can minus milliamps be a high signal?

Thanks.

Allen in Dallas
 

WBahn

Joined Mar 31, 2012
32,939
There's some information missing, so I'm going to make some assumptions here.

First, I'll assume that your LED has a forward voltage of about 2 V and that you are trying to drive it into saturation.

With R8 being 25 Ω, that means that the current when on in saturation (assuming Vcesat is about 0.2 V) will be

Ic = (5 V - 2 V - 0.2 V) / 25 Ω = 112 mA

Typically you operate these kinds of transistors at a beta of about 10 when in saturation, so that means you want about 11 mA of base current.

Assuming a Vbe of 0.6 V and assuming your PIR output is able to maintain 3 V, that means your base resistor needs to be less than about

R1 = (3 V - 0.6 V) / 11 mA = 218 Ω

A couple of questions arise: Can your PIR deliver 11 mA and how close can it hold its output to 3 V when doing so?

As for the max output being negative, this is likely due to the polarity assigned to the reference current. I common definition is that a current is positive if it is going into the pin, so current coming out of the pin would be negative.

What was the voltage at the output of the PIR when the LED was on?

It might be a good idea to map the V-I characteristic of the output of the PIR so that you have it for reference (and keeping in mind that each unit will be somewhat different and the one you test may or may not be "typical").

With the output HI, put a 10 kΩ resistor between the output and ground and measure the voltage at the output. Calculate the corresponding current. Make a note of the (V,I) pair (perhaps plot it on a piece of graph paper).

Then use a smaller resistor and repeat the test. Keep doing this until the calculated current is 10 mA or perhaps until the voltage is 1 V less than what you are powering the PIR with. You don't have to take too many data points to get a good feel for how the unit behaves. If the unit is able to maintain 3 V when sourcing 10 mA, the corresponding resistance would be 300 Ω (use 330 Ω) for your second resistor. Then take perhaps one or two data points in between, such as 470 Ω and 1 kΩ, and perhaps something a bit smaller, such as 220 Ω, to explore the other side.

You can do a similar test to map the output characteristic when the output is LO by tying the other side of the resistor to the PIR power supply.
 

Audioguru again

Joined Oct 21, 2019
6,826
Your BC547 did not work maybe because you connected its pins backwards. Like most European little transistors its pins are CBE but an American 2Nxxxx little transistor pins are EBC. You measured its base-emitter voltage as 3.2V which confirms that its pins were backwards when it should be a diode voltage drop of 0.6V to 0.7V.
 

eetech00

Joined Jun 8, 2013
4,709
hi
If I can believe the PIR datasheet, the AM312 is spec'd with a supply of 3.3 volts max, so with a supply voltage of 5v it will eventually burn out. A regulator should be used to drop the 5v supply voltage to 3.0 volts. The TLV431 regulator is adjustable, so I would drop the voltage to 3.0v so its below max supply voltage to increase reliability. Also add a base resistor to ground to ensure Q1 turns fully off.
 

MisterBill2

Joined Jan 23, 2018
27,684
The output current can be negative because there are at least 3 types of semiconductor outputs in common use. They are sinking, sourcing, and "voltage", which will both sink and source.
A current sinking output requires an external pull-up resistor for the voltage to be at a "High", A sourcing output requires a resistor to the supply negative for the voltage to drop to the low value, while a voltage output does not need an external resistor. So the very first step is to connect the sensor to power and monitor the output terminal voltage relative to the supply negative and see what happens when the device is triggered. OR, if you have a data sheet for the device, that should explain what is required.
 

Bernard

Joined Aug 7, 2008
5,784
Specs for AM312 seem to be all over the place. consensus seems: Vss ? 2.7V to 12V. output = Vss - 1V @ 10 mA, Vdd regulated to 3.3V; inactive current .1 mA, 2 sec. delay & blocking, & output hi when activated.
LED driver could be LL FET or med power darlington. I'd go for dual power supply, 5V & 12V.
 
Top