0
\$\begingroup\$

I have an alarm rated for 12V 90mA. I want to turn the alarm on/off with a 2N2222. The base of the 2N2222 is connected to an ESP32. Circuit diagram is attached. Will it work?

Circuit of Alarm

\$\endgroup\$

1 Answer 1

0
\$\begingroup\$
  • Placing a resistor (10k to 47k) across the base-emitter of Q1 prevents false turn-on in case of a physical disconnection with the Wi-Fi module.

  • If the wire that connects the alarm to the Q1's collector is long (e.g. >1m) then unwanted spikes can be induced when you turn the alarm off and these spikes can damage Q1. So a diode (silicon such as 1N4148, 1N4007) can be placed: anode to Q1's collector, cathode to 12V (place as close to Q1 as possible).

  • And finally, make sure R9 is enough to force the Q1 saturate. Calculate R9 for a base current of one tenth to one twentieth of the load current, i.e. 4mA minimum. So R9 can be \$R_9=(3.3-0.6)/0.004=680\Omega\$ but 750R is okay.

\$\endgroup\$
1
  • \$\begingroup\$ I dont have much info about current saturation. My alarm needs 90mA to operate. Can you suggest appropriate value of the base resistor for that? \$\endgroup\$
    – ROBERT
    Commented Mar 16, 2023 at 8:21

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