I'm a newbie in transistor switching.

I have PIR sensors with C and NC onboard. NC is 12 V signal that I need to switch transistor (bipolar?) to emit 3.3 V (collector connected to 3.3 V).

Fire and PIR circuit

VCC equals 3.3 V. PIR is pin on ESP32.

  • Can you tell me if this circuit is okay or does it need additional edits?

Note: Q3, Q4 transistor number is random, if you can offer me suitable transistor I would be glad.

Next circuit:

ESP32 pin "ALARM" is connected to transistor (MOSFET N channel) base.

Alarm circuit

ALARM as device is connected to 12 V, required 300 mA to run and I need transistor to switch circuit. Relay is awful.

  • Is this circuit correct?
  • Do I need any additional edits?
  • Can you suggest me suitable transistor?
  • I don't know much about MOSFET shortcuts.

Third circuit I need is same as this but instead 12 V I need to switch 5 V.

  • I guess just to change MOSFET transistor?
  • Or use same as for 12 V?

Combined circuit schematic:

Fire, PIR and Alarm circuit schematic

  • Your new schematic - have you posted that as an answer, or is that the circuit to which your questions apply? I notice that you have taken suggestions from Rp Rp's answers and made changes to the original circuit. That could end up confusing the question. If your original question was answered, then you should accept one of those answers. Thereafter if you have a new question then you should post a New Question. Sorry, I am just a bit confused as you asked for transistor suggestions, and then edit your answer to reflect those suggestions. Your new circuit should be posted as a answer maybe Jul 7, 2018 at 13:21
  • Also, you should flag your question for migration to SE.Electrical Engineering as it would be a better fit, as your question isn't really about Arduino, but electronics in general. Jul 7, 2018 at 13:27
  • @Greenonline my mistake, I thought if I was speaking about Arduino a little bit it could be posted here instead electrical stack exchange. I edited post because I can't add image to comment :) Jul 7, 2018 at 14:51

1 Answer 1


I'll try to answer your post with "just words" and we will see how it goes. If it is not clear to you, i will post small schematic.

I do not recommend the first schematic that you posted. You will likely reverse bias the BE (base emitter) junction with 12v. Most bipolar transistors have a maximum reverse BE bias of 5 v.

I do recommend using bipolar so that you dont have to study, understand the range of turn on voltages for a MOS transistor.

The bipolar is always 0.6v and a Darlington bipolar is twice that.

Also, i dont know why you have the 100nF caps in there. They will guarantee a surge, everytime you turn the circuit on and hence put noise on your supply bus.

When I design a driver for a similar application i frequently use a TIP100 (https://www.digikey.com/product-detail/en/on-semiconductor/TIP100G/TIP100GOS-ND/1485300)

So use the basic design of your second circuit but use the TIP100.

ALWAYS have a resistor (10k ohms or so) to keep the leakage current (Icbo) from turning on the transistor when you dont want it on !

I would put all the loads into the Collector circuit in your second schematic, rather than make the uP drive your LED.

If your load is at all inductive (a coil) then ALWAYS put a reverse-biased diode across the load to catch any inductive kick back.

If this is all Greek to you, then just say so and I will draw a simple universal circuit that will work for 3.3v drive or 12v drive.

All the Best to you. RP

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