2
\$\begingroup\$

I have a PIR sensor (HC-SR501) and I want it to turn an led strip(12V 0.8A) on when the sensor detects motion and off when there's no motion. I checked a previous thread which is similar in that thread they were going for a P channel mosfet and I can't get them in shops near my area.

My options are an N channel mosftet IRF540 and or a 2n2222 transistor. The transistor I presume can't handle a load this big so I'm going for the mosfet.

Will the mosfet work with the 3V trigger from the PIR sensor? Do I need to add resistor before the gate? Will this mosfet work at all or should I get another N channel mosfet?

Here is the diagram of my project.

enter image description here

Thanks in advance.

\$\endgroup\$

4 Answers 4

2
\$\begingroup\$

Don't use the 2N2222 to drive the load as it's an 800 mA device driving an 800 mA load. Note that the data sheet ratings actually cover what they can guarantee from every single 2N2222 transistor they ever make over decades, so individual devices will have high current capability. But it's not good design strategy. Normally, there are plenty of transistors to choose between so pick one with at least twice the current capability of its maximum continuous load.

That leaves you with the IRF540. Its Vgs is the problem, here. It's +/-20 V max. with a switch-on threshold of 4 V min. across all devices manufactured. You detector's LVTTL output can only be expected to guarantee 2 V to 3.3 V for a logic high.

So boosting the 2 V output to, say 6 V would let you drive the IRF540 very comfortably.

If you're saying that IRF540 or 2N2222 are all that's available to you, you can use the circuit below. If you can use other ICs, you could make it a little simpler but not hugely.

schematic

simulate this circuit – Schematic created using CircuitLab

R1 limits the Q1 base current from the sensor, R2 ensures that Q1 is off if the sensor output is not steady during power-up. R1 and R2 deliver 1 V to 1.65 V or thereabouts to Q1 base which is more than the 0.7 V or so needed to turn it on.

R3 ensures that Q2 is on when Q1 isn't. Q2's collector lets the Q3 gate voltage switch between about 0.3 V (turns Q3 off) and the 6 V given by R4 and R5 (turns Q3 on).

If you were switching Q3 fast, you might need to reduce the value used for R4 and R5, so that the gate capacitance of Q3 was charged more quickly and it switched on more sharply. As it is, for the infrequent on/off you sensor will deliver, these values will be fine. If saving standby current is a factor, you could increase all resistors to 100 K or more but only if you need to.

\$\endgroup\$
8
  • \$\begingroup\$ Thanks, here is the list of all available transistors and mosfets in the shop. Will any of them do the job in a better way? Transistiors - 2N3904 2N2222 2N3906 BD139 TIP41C SS8050 Mosfets - IRF840 IRF540 IRFZ44 IRF3205 BS170 \$\endgroup\$
    – Kokachi
    May 7, 2017 at 11:09
  • \$\begingroup\$ the 139 and the 41 would work well. irfz44n too. you can switch hi or lo... \$\endgroup\$
    – dandavis
    May 7, 2017 at 11:40
  • \$\begingroup\$ @Kokachi, the MOSFET will dissipate hardly any power in use so you don't have to worry about heatsinking, unlike with a BJT like BD139. You won't find many MOSFETs that switch on hard at 2 V. Stick with the circuit I've shown, easy and reliable. \$\endgroup\$
    – TonyM
    May 7, 2017 at 12:33
  • 1
    \$\begingroup\$ I guess that's right. Can I use a single 2N2222 to drive the mosfet? \$\endgroup\$
    – Kokachi
    May 7, 2017 at 15:06
  • 1
    \$\begingroup\$ True that. Thanks for all the help and support. :) \$\endgroup\$
    – Kokachi
    May 7, 2017 at 15:47
1
\$\begingroup\$

No, the irf540 would not be suitable with a 3V gate voltage. It would not turn on hard enough for the 800 ma load. Look at the VG chart. It will turn on at 3V but not enough.

The 2n2222 is just enough for this because 800 ma is it's max ICE current.

\$\endgroup\$
4
  • \$\begingroup\$ if it's the max current then wouldn't it heat up ? \$\endgroup\$
    – Kokachi
    May 7, 2017 at 9:40
  • \$\begingroup\$ Here is the list of available transistors and mosfets. Will any of them do the job in a better way? Transistiors - 2N3904 2N2222 2N3906 BD139 TIP41C SS8050 Mosfets - IRF840 IRF540 IRFZ44 IRF3205 BS170 \$\endgroup\$
    – Kokachi
    May 7, 2017 at 9:46
  • \$\begingroup\$ A BD139 can certainly handle the current but its gain is fairly low, you could use one of the others to make a Darlington. \$\endgroup\$
    – Finbarr
    May 7, 2017 at 10:34
  • \$\begingroup\$ @kokachi, no. It wouldn't necessarily heat up. You could put two in parallel if you were really concerned. \$\endgroup\$
    – Passerby
    May 8, 2017 at 4:03
0
\$\begingroup\$

This (first) diagram won't work. Very pluses are connected to the transistor (+12V power supply, +3.3V the signal). The source and the drain must be minus.

\$\endgroup\$
5
  • \$\begingroup\$ Hi @sebastianpachla Can you please elaborate your answer. I don't understand what you mean with 'very pluses'. And why must the source and the drain be minus? \$\endgroup\$
    – Huisman
    Feb 9, 2020 at 13:10
  • \$\begingroup\$ Right diagram for 540N or IRLU8721 seeb.net.pl/images/LED_Stripe-N-MOSFET.png R1 = 10K \$\endgroup\$ Feb 10, 2020 at 10:28
  • \$\begingroup\$ Assembled, working <img src="seeb.net.pl/images/LED_stripe_test.jpg"> \$\endgroup\$ Feb 10, 2020 at 10:41
  • \$\begingroup\$ ANY DC power supply need + and - :D On first diagram transistor are powered only by + :). Power supply +12V, OUT from HC-SR501 3.3V ... How connect - (GND) to trasnsistor? Transistor work like relay must powered + and - to switch. Sorry for my english. \$\endgroup\$ Feb 10, 2020 at 11:00
  • \$\begingroup\$ youtube.com/watch?v=Te5YYVZiOKs \$\endgroup\$ Feb 10, 2020 at 11:02
-4
\$\begingroup\$

here is pratical circuit that works drawing approximate 800maLED Strip, I had BC557 laying aroundenter image description here

\$\endgroup\$
2
  • 1
    \$\begingroup\$ You are using an NMOS transistor as a high-side switch...that's not going to work the way you have it drawn. And then you use a PNP as a low-side switch? What is the purpose of the 47k resistor from collector to emitter? I have very bad feelings about this circuit. \$\endgroup\$ Jul 31, 2020 at 22:35
  • \$\begingroup\$ This should have been drawn using CircuitLab. Then we could judge if it would work or not. VTD. \$\endgroup\$
    – user105652
    Aug 2, 2020 at 4:19

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.