PIR to NPN to LED 210123

Thread Starter

allenpitts

Joined Feb 26, 2011
163
Hello AAC forum,

Working to figure out this circuit.
PIR_to_3904_to_LED_210123.jpg
When the PIR is activated the LED comes on.
After about eight seconds the PIR no longer sends a signal and the LED goes off.
This is as designed and expected.

What is not fathomed is the readings from the DMM.
With the DMM probes positioned as show in the schematic
and the PIR is activated and the LED is on the DMM reads .5 volts.
When the PIR and the LED goes off, after about eight seconds
the DMM reading is 10.5.

Not getting this. Maybe the transistor operation is not grasped.
This what is known (I think) about the NPN. Please let me know
if any of this is wrong.
The current drains out through Emitter.
The Base controls the biasing of transistor.
Current flows in through Collector.

When the Base pin is not receiving current it will be at ground
and the NPN is reversed biased and the connection between the Collector
and the Emitter is open.

When the Base pin is receiving current and the NPN is forward biased
the connection between the Collector and the Emitter is closed.

Applying this to the circuit, when the PIR sends a signal the
NPN is forward biased and the current from the voltage source
flows from the +v12 to the ground thru the resistor making the LED glow.

And conversely, when the PIR is not sending a signal the transistor
is reversed biased or open and no current flows thru the LED and
the LED is off.

Yet, when the PIR is activated and the LED is on the DMM reads a low voltage value,
+.5 volts. And when the PIR and the LED are off the DMM reads a higher
value, +10.5 volts.

I know it is not the other way around, I can read the meter. But it
seems counterintuitive. Should not, when the current is flowing
thru the transistor the voltage be high and when the current is not flowing
thru the transistor the voltage be low?

Thanks.

Allen
 

ElectricSpidey

Joined Dec 2, 2017
2,758
Your readings are correct.

The higher voltage will develop across the higher resistance...think about it.

What you are seeing is the voltage drop across the Collector Emitter when the transistor resistance is low.

The reason you are not seeing the entire supply voltage across the Collector Emitter when the transistor is off, is because you have an LED in the Collector and its resistance is really high when not conducting.
 
Last edited:

sghioto

Joined Dec 31, 2017
5,376
Install a 4.7K resistor across the LED and the reading will be 12v across the transistor when off.
The NPN transistor symbol is incorrect.
 
Last edited:

Tonyr1084

Joined Sep 24, 2015
7,852
Part of the confusion may be that the transistor you show is a PNP transistor when it should be an NPN type. When the output from the PIR goes high it turns on an NPN transistor which acts like a source follower switch, providing a pathway to the negative terminal. Redraw a circuit using a physical switch instead of the transistor. Assume the switch drops 0.5 volts when closed. That's the voltage you're reading across the EC junction.

[edit] to clarify why you read 10.5V when the switch is open - that's because there's a forward voltage drop across D1. 12V - 10.5 = 1.5Vf (forward Voltage) of the LED. At 10.5V and 430Ω (and the additional 0.5V of the transistor) the total current is:
12V -1.5V -0.5V = 10V
10V ÷ 430Ω = 23mA (0.023A)
12V x 23mA = 297mW (0.297 Watts) That tells me the 430Ω resistor is a half watt resistor, not a quarter watt resistor.
 
Last edited:

Bernard

Joined Aug 7, 2008
5,784
The PIR is active low so that PNP is proper but needs to be wired differently. Emitter to +12V, base to PIR, & collector to R & LED anode, LED cathode to - common. Assuming that there is an internal pull-up resistor.
 

MisterBill2

Joined Jan 23, 2018
18,167
The symbol for the transistor does not match what it really is. The 2N3904 IS an NPN transistor. Thus when the PIR device is delivering an output the base is biased positive and the transistor conducts. And of course, when it is not switched on the current is quite low, but not zero, and so there is just enough current to have a voltage drop across the LED without it showing any light. Also, the meter is drawing some very small current and that also is leading to the voltage drop across the LED.
 
Last edited:

ElectricSpidey

Joined Dec 2, 2017
2,758
" The PIR is active low so that PNP is proper but needs to be wired differently. Emitter to +12V, base to PIR, & collector to R & LED anode, LED cathode to - common. Assuming that there is an internal pull-up resistor. "

Not according to this...
This.JPG
or this...
This2.JPG
 

Tonyr1084

Joined Sep 24, 2015
7,852
First, how do we know the PIR is active low output? I don't see that anywhere in the TS statement. As is typical, I may have missed something. On the assumption it's active low - using a PNP transistor such as 2N3906 (not 2N3904) this would be the circuit diagram I come up with:
1611509408229.png
[edit] OK, yes, it's an HC-SR505. However, the EG4001 data sheet I can find is in Chinese. I don't read Chinese. Not able to determine if pin 6 (EG4001) is open collector, or other.
 
Last edited:

sghioto

Joined Dec 31, 2017
5,376
First, how do we know the PIR is active low output?
Because it's not. Doesn't have anything to do with what the TS may or may not have said. It's in the specs of the PIR.
Getting off track here.
The circuit the TS posted is correct for a 2N3904 NPN transistor. He just inserted the wrong symbol as I mentioned back in
post #3.
 

Thread Starter

allenpitts

Joined Feb 26, 2011
163
Hello MisterBill2, Electric Spidey, sghhioto, Tonyr1084 and the AAC forum,

The inaccuracy in the schematic is corrected herewith. To be sure the transistor
is a 2N3904.
PIR_to_3904_to_LED_210124.jpg
From what has been read
2N3904 when the Base is saturated (receiving current) is on, the Emitter and the Collector are connected.
2N3906 when the Base is saturated (receiving current) is off, the Emitter and the Collector are not connected. Right?

ElectricSpidey:
What you are seeing is the voltage drop across the Collector Emitter when the transistor resistance is low.
'Voltage drop' In this phrase 'drop' is a noun not a verb, right? If that is true, then what is meant is there is a change in the voltage across the Collector to the Emitter when the base is biased, the transistor resistance is low and the connection is made between Emitter and the Collector which means that more current flows when the base is biased and more current means more voltage. So there should be less current and voltage when the transistor is not saturated and more current and voltage when the base is saturated. Seems backwards to what is observed.

sghioto
This what I think was meant by
Install a 4.7K resistor across the LED and the reading will be 12v across the transistor when off.
PIR_to_3904_to_LED_210124_w_4_7k.jpg
'a 4.7k resistor across the LED'
With the breadboard in this config the DMM reads 10.42 when the transistor and the LED is off
and .02 when the transistor and the LED are on.
The LED is somewhat dimmer is this config.
Not sure what the focus of this test is but in this test the voltage at the probes are higher when the transistor is off and lower when the transistor is on.

Tonyr1084
As suggested redrew circuit w/o transistor using a simple switch
Simple switch sicuit_210124.jpg
Simple Switch Test One
With the switch closed and the LED glowing the DMM reads 5.66 volts
With the switch open and the LED unlit the DMM reads 6.77

So I guess there is a connection thru the PIR. So the PIR was removed.
Simple Switch Test Two
With the switch closed and the LED glowing the DMM reads 0.0 volts
With the switch open and the LED unlit the DMM reads 10.4
(Connecting the wall wart (regulated AC/DC converter) to DMM reads 12.34 v)

When the output from the PIR goes high it turns on an NPN transistor which acts like a source follower switch, providing a pathway to the negative terminal.
'A source follower switch, providing a pathway to the negative terminal.' If there is a pathway to the negative terminal when the transistor is
on then the DMM should sense voltage. An when there is no pathway to the negative terminal when the 3904 is off the DMM should sens no voltage which is opposite from what is observed,

I guess my understanding of circuits is off. It would seem that with the switch is open
the voltage would be zero. And with the switch closed the DMM would read
the voltage from the power source. Why is it backwards?

Perhaps the circuit is wrong. If the desired operation is for there to be a positive at R1 when the PIR is active and no voltage when the PIR is not active how would the circuit be done?

On the operation of the HC-SR505:
With a probe at ground and a probe
at the output lead from the PIR, the DMM reads 2.7 volts with hand wave.
And 0.0 after eight seconds.
Pretty sure the output of the sensor about 3 volts (high) when activated and
0 volts low when not sending a signal.

Thanks.

Allen
 
Last edited:

ElectricSpidey

Joined Dec 2, 2017
2,758
When the switch is open you should see full supply voltage, but you do not because the meter provides a path across the switch and the LED is in non conductive mode.

Yes, your understanding is flawed, as I pointed out previously the highest voltage will always develop across the highest resistance in the circuit, and since the open switch is the highest resistance, the highest voltage will develop there.

I'm curious...what is the input impedance of your meter in the voltage mode?
 

sghioto

Joined Dec 31, 2017
5,376
Allen,
That's not correct
Connect the 4.7K resistor in parallel with the LED. That means connect one end of the resistor to the cathode and the other end to the anode of the LED.
 

djsfantasi

Joined Apr 11, 2010
9,156
I guess my understanding of circuits is off. It would seem that with the switch is open
the voltage would be zero. And with the switch closed the DMM would read
the voltage from the power source. Why is it backwards?
With the switch closed, the DMM leads are shorted together. You’ll get 0 volts.

With the switch open, you’ll see a voltage drop caused by the LED and resistor, but the internal resistor of the meter will limit current to below that required to light the LED.
 

MisterBill2

Joined Jan 23, 2018
18,167
When a transistor is "off" the collector to emitter resistance is high but not infinite, and when the transistor is biased "ON" the collector to emitter resistance is low , but not zero. That is quite important to understand. For bias current levels between "off" and "on" the effective resistamce varies.
 

Thread Starter

allenpitts

Joined Feb 26, 2011
163
Hello sgihoto., djsfantasi, MisterBill2 and the AAC forum,

Beginning to get an idea about how the circuit works.

I think the main problem is understanding how the readings from the DMM work.

To answer ElectricSpidey's question:
From the Owner's Manual of the Micronta LCD Digital Multimeter:
Input Impedance: 10 Megaohm (DCV/ACV)
More than 100 Megaohm on 300 mV DC

Thanks for the feedback.

Allen
 

Tonyr1084

Joined Sep 24, 2015
7,852
I'm not sure you have gotten an answer that makes it clear why you are reading what you are. So hopefully this will explain it better. The "Zero" volts is the point to which all other points are referenced.
1611601026000.png
 

sghioto

Joined Dec 31, 2017
5,376
1611607096123.png
Getting technical the above represents the circuit when the transistor is in the OFF mode.
R1,R2,R3 and the transistor form a voltage divider.
R3 represents the input impedance of the meter
R1 represents the impedance of the LED when OFF.
Assuming no leakage in the transistor when OFF it can be removed.
Since R2 is a small fraction of R3 it can be removed from the circuit as well.
Basically what you have left is below.

1611607690581.png
As already mentioned the reason you are only reading 10.5 volts is because of the high impedance of the LED when OFF.
Using Ohm's law you can calculate the effective impedance of R1 or the LED.
The current is equal 10.5v / 10M = 1.05ua
Voltage across LED is 1.5volts therefore:
R1 = 1.5v/1.05ua = 1.428M

Now if you install a 4700 ohm resistor in parallel with the LED you can see the total resistance of R1 + R2 is a tiny fraction of the impedance of the meter, therefore the reading for all practical purposes will be 12 volts.

1611610103302.png
 
Top