According to the attached images, I am creating a small circuit where I need to trigger a siren (12vdc 200ma) through a pin signal of the ESP8266 microcontroller (NodeMCU).

The signal output of the pin of the ESP8266 is 3.3v 5ma. However, to trigger the siren I need the values already mentioned.

In this circuit, I have a voltage amplifier (like this: https://www.ebay.com/itm/DC-3-3V-3-7V-5V-6V-to-12V-Step-up-Power-Supply-Boost-Voltage-Regulator-Converter/201919379310?hash=item2f0355376e:g:IsoAAOSwcB5ZEIrx) where, coming in with 3.3v or 5v, we have 12v output. Great! Question of tension is resolved.

However, the current remains the same, not stabilizing the circuit (so the siren is "gaga"! Rsrs).

Can anyone help me how I would go up the chain?

PS: I have transistors (TIP31C, BC548, BC547, BC458, BC457), diodes (1N4148), relays (5v-12v, max 30a), capacitors (various capacitances) and leds (red, green, yellow, white and blue).

Thank you in advance, thank you for your promptness and promptness.enter image description here

  • \$\begingroup\$ use a logic-level MOSFET like the IRLZ44N, or make a darlington with your existing trannies. google "mosfet switch" for 1001 schematics. it's not clear, but you can't power the siren from the ESP, at all. the siren gets hard-wired on, then a switch/fet is spliced in the ground to connect/disconnect the buzzer. \$\endgroup\$
    – dandavis
    Jan 26, 2018 at 5:24
  • \$\begingroup\$ what is your power source? If sufficient Boost regulator and logic switch to 12V buzzer is trivial. \$\endgroup\$ Jan 26, 2018 at 5:35
  • 1
    \$\begingroup\$ I'm not going to mentally follow all the jumper wires in that image. Edit your post and include a proper schematic of how your circuit is connected, and I suspect we'll be able to see why it's not working like you expect it to. \$\endgroup\$
    – MrGerber
    Jan 26, 2018 at 6:37

1 Answer 1


To drive the siren a switch is needed to isolate the 3.3V/5mA output of the ESP8266 GPIO pin from the 12V/200mA demanded by the siren. The ESP8266 output pin can drive the base of a transistor as a switch, and the transistor will conduct the power to the siren through it's emitter and collector.

To choose a suitable transistor it needs to handle over 200 mA continuous through its collector, controlled with a 5 mA drive current at it's base - thus it needs a DC current gain factor (hfe) greater than this ratio: 200mA/5mA = 40 - at the desired load current. From the data sheets I could find of the transistors that were listed as on hand, the TIP41C has enough power capability - but perhaps oversized and hence possibly not enough DC current gain (depending on batch variability and manufacturer) to be controlled by the output pin (you could try it and it might work if you have a higher gain batch). The others BC54x have fantastic current gain but do not have sufficient current drive capability. A better suited candidate would be the 2N2222A. With a suitable transistor the schematic would be as follows;


simulate this circuit – Schematic created using CircuitLab

The 12 Volts for the siren is supplied by the described power converter from the 3.3 Volt ESP supply. Be certain that there is enough power headroom available from the 3.3 volt supply to drive both the ESP and the additional 1.5 amps to cover the 3.3 volt input load of the converter.

The transistor will switch on when the base is pulled approximately 0.7V above the emitter which is at ground, at this point the amount of current at the base will determine how much current the transistor conducts. With the control pin from the ESP8266 turned on at 3.3 Volts, the difference will be 3.3 - 0.7 = 2.6 Volts between the control pin and the base of the transistor. A 560 ohm resistor here will limit the current to approximately;

(Via Ohms Law: I=E/R) = 2.6V/560R = 4.6 mA,

..ensuring both that the transitor is fully switched on, and that the current is within the 5mA output capacity of the pin.

If you don't have a suitable transistor on hand, and the TIP41C doesn't provide enough gain reliably, the TIP41C can be combined with one of the BC54x parts in a Darlington configuration - which basically multiplies their current gains together while letting the heftier TIP41C handle the load utilizing the best characteristics of both parts. In that case the same circuit would be a follows;


simulate this circuit

With this configuration there are now two 0.7 base-emitter voltage drops effectively in series, so the voltage across the same 560 ohm resistor now becomes approximately: 3.3 - 1.4 = 1.9 Volts, delivering 3.4mA to the base of Q2. With the Darlington configuration thats fine since the gain is so high it should be more than enough drive to turn them fully on - and in fact a higher resistance can now be used to reduce the output current demand on the ESP's GPIO pin. 4.7K here instead would load the control pin with only 0.4mA and should stil reliably turn the transistors fully on.

R2 is not a critical value - it simply provides a "pull-down" path for Q1's base to discharge ensuring it turns off quickly and completely - since Q2 can be almost like an open circuit in the OFF state.

  • \$\begingroup\$ Fantastic explanation, DelTomix! I Will purchase those components that i don't have now, and then make this circuit like your suggest. Later i will post here the result. Thank you very much!! \$\endgroup\$ Jan 26, 2018 at 14:09
  • \$\begingroup\$ DelTomix, i purchased the components and i builded the circuit like your schema. The result is amazing! Thank you very much!!! Could you suggest me a book for learning about integrated circuits and your mainly components? Thank you again! \$\endgroup\$ Jan 27, 2018 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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