3
\$\begingroup\$

I have this setup where a PIR sensor (HC-SR501) powers an LED strip with the help of a P2N2222 transistor. enter image description here

I then manually connected the Transistor base to the 12v rail and it has no problem powering the LED strip. I have also tried changing the 2.2K ohm resistor with a 100 ohm and still the PIR sensor doesn't trigger the transistor. I have tried powering a 3.4V 8mm LED from the PIR sensors OUT pin and it works fine, so the sensor's OUT pin is giving the 3.3V. Is it not enough for the transistor base?

What am I doing wrong here? Please advice.

Thanks in advance

\$\endgroup\$
6
  • 3
    \$\begingroup\$ You're trying to use the transistor as a high-side switch. If you want to use an NPN transistor, switch it on the low side instead. \$\endgroup\$
    – Hearth
    May 8, 2017 at 14:16
  • \$\begingroup\$ @Felthry ok, how do I do that? \$\endgroup\$
    – Kokachi
    May 8, 2017 at 14:18
  • \$\begingroup\$ Typing up an answer now, just a moment. \$\endgroup\$
    – Hearth
    May 8, 2017 at 14:19
  • 2
    \$\begingroup\$ We must have 100's of "transistor as a switch" questions like this with as many answers. Where's my dup-hammer ... ? \$\endgroup\$
    – brhans
    May 8, 2017 at 14:25
  • \$\begingroup\$ @brhans when interesting and or complex questions are put on hold minutes after they have been posted because "too broad" or "opinion based", that's what you are left with. I also like the "what resistor do I need for..." kind of question. They are very popular for the very same reason. \$\endgroup\$ May 8, 2017 at 14:32

2 Answers 2

5
\$\begingroup\$

Your problem is that the transistor is on the high side, and you're only giving it 3.3V on the base. Since your base-emitter junction must have approximately 600mV across it in order for current to flow from collector to emitter, your transistor is unable to have anything higher than 3.3V - 0.6V = 2.7V at the emitter, which isn't enough to turn on your LEDs.

schematic

simulate this circuit – Schematic created using CircuitLab

A better way to do it is as follows:

schematic

simulate this circuit

This way, the transistor has its emitter connected directly to ground, so the transistor can enter saturation when the signal is at its high level, and the transistor will have a low voltage drop (around a hundred millivolts) from collector to emitter. This means that you'll have almost 12V across your LED module, enough to power it.

Think of it this way: If, in the first schematic, your transistor was in saturation mode, you'd have approximately 0.1V between collector and emitter, and so the emitter voltage would be close to 12V, higher than 3.3V, and the base-emitter junction would be reverse-biased. Since a reverse-biased base-emitter junction means the transistor is not in saturation mode, this is a contradiction and the initial assumption (the transistor is in saturation) must be false.

Now, up to this point, I've been assuming the transistor had a high β (aka hFE) at the operational current, which as Tony Stewart in the comments pointed out, is not correct. The 2N2222 is only going to have a β of around 30 or less at 500mA, meaning that it will be in forward-active mode and not saturation. Transistors in forward-active mode have a higher voltage drop between collector and emitter, meaning higher power losses, than when in saturation mode. Now, one obvious solution here is to increase β, which you can do like this:

schematic

simulate this circuit

This configuration is called a Darlington pair. Q2, here, is a TIP31 transistor rather than another 2N2222 for power-handling capability; Q2 is dissipating significantly more power than Q1, so it should ideally be a higher-rated transistor. Using a second 2N2222 may work, but a TIP31 is more suitable for the task.

Alternatively, you might want to look at Tony Stewart's answer below; his circuit is not quite so simple and requires the use of a MOSFET (which you mention having difficulty getting in small quantity), but has some marked advantages over the ones presented in this answer, such as lower power losses when presented with higher input voltages.

\$\endgroup\$
15
  • \$\begingroup\$ will try it out and let you know the reult asap. thanks. \$\endgroup\$
    – Kokachi
    May 8, 2017 at 14:28
  • \$\begingroup\$ If the emitter of Q1 had 12V on it as in your first diagram, the LED would be lit! \$\endgroup\$
    – Finbarr
    May 8, 2017 at 14:31
  • \$\begingroup\$ @Finbarr hence my caveat of "if the transistor was conducting"! \$\endgroup\$
    – Hearth
    May 8, 2017 at 14:32
  • \$\begingroup\$ The base-emitter junction is not reverse biased as you state. The LED doesn't light because this circuit can only produce about 2.7V maximum across the load and that isn't enough. \$\endgroup\$
    – Finbarr
    May 8, 2017 at 14:36
  • \$\begingroup\$ I'll clarify. I meant to keep it fairly simple, but you're right, the way I worded it is misleading. \$\endgroup\$
    – Hearth
    May 8, 2017 at 14:39
1
\$\begingroup\$

If you examine the HC-SR501 schematic, datasheet, you will notice it says 3.3V TTL compatible logic level output yet adds 1K series R (for ESD protection), thus not True TTL output impedance with positive logic 1= detected human. So these two criteria , you must use an inverting FET switch with low side switching (-) to make it non-inverting , i.e. LED on with input high.

Question is how low does RdsOn need to be assuming Vth<=1.5V? 10Ω 1Ω 0.1Ω ?

I know that your LEDs 3V@500mA=1.5W has an equivalent ESR of ~1/1.5W=0.6 Ω x3 = 2Ω and series R's on ledstrips must be approx (14V-3*3V)/500mA= 10 Ω approx. total. and 2.5W =Pd total wasted for 7W applied with automotive range supply 12~14.2V possible.

We consider for thermal reasons, switch RdsOn about <=5% of load or Pd of 1/4W for this type, thus you can see with 1k series to an emitter follower 3.3V will never work to a 10 Ohm load even if it were 12V+1k logic and an hFE of 100. (DFM rules)

Thus 5% of 10.6Ω ESR load of Stripleds is 50mΩ which is the range more or less I would choose for your Nch enh MOSFET switching Drain to LED - and LED + to V+ which is from 12 to 14.2V

Final answer

schematic

simulate this circuit – Schematic created using CircuitLab

enter image description here

\$\endgroup\$
18
  • \$\begingroup\$ isn't 3.3v too low for the gate of an N channel mosfet? \$\endgroup\$
    – Kokachi
    May 8, 2017 at 14:52
  • \$\begingroup\$ historically FET's Vgs= Vth were 4V then 3 then 1.5 now 0.7 and called Logic level power switches. Thanks to enhancemode technology and w/l ratios of junction \$\endgroup\$ May 8, 2017 at 14:54
  • \$\begingroup\$ I can't get logic level mosfets here. I will have to bulk order atleast 1,000 or more. \$\endgroup\$
    – Kokachi
    May 8, 2017 at 14:57
  • \$\begingroup\$ no way.. anyone can order 1 from Digikey, mouser, RS, ebay etc and have it delivered anywhere within reach. \$\endgroup\$ May 8, 2017 at 15:08
  • \$\begingroup\$ nope, I'm from India and our reserve bank has imposed very strict regulations on online purchase from outside the country. It's very very difficult to purchase from outside the country. \$\endgroup\$
    – Kokachi
    May 8, 2017 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.