I am a fan of the EasyEDA https://easyeda.com/ program for creating simple circuits, especially because it’s closely integrated with JLCPCB, the company that magically turns your digital files into printed circuit boards fairly inexpensively.

This is what the schematic looks like (link to download json file below). There are plenty of tutorials on how to create these. The cool part of working with schematics is you can make little parts of the circuit, and at the end, the software make sure everything is connected. For example, I don’t need one ground line run to each device that requires a ground; the software just figured out how to connect all of the grounds, 5V lines, 12V lines, 3V3 lines, and so forth.
What’s going on here?
- A 30 pin ESP32 takes 5V at VIN (most dev boards can easily regulate this to 3V3, the logic used in the chip).
- A screw down terminal receives 12V and GND, and feeds this to an adjustable converter which drops the voltage down to 5V.
- Two pins on the ESP, when HIGH, send voltage through a base resistor to a transistor gate. When the transistor receives a voltage at the base, it allows power to go through the relay coil, creating a magnetic field that switches the mechanical relay, thusly sending 12V to its device (I use one each for the arc generator and solenoid valve) via two sets of screw down terminals.
- For safety reasons (explained later), I added two 3-pin connectors in case I want to add PIR sensors to prohibit the device from firing when somebody is near.


On the left is what the PCB design looks like in EasyEDA, and on the right is a 3D mockup that has the relays on there for some reason. To be clear, I only had a general idea of how to choose resistors and diodes and transistors to make these relays work; luckily, chatGPT helped explain how to choose the appropriate base resistor:
Since the coil requires a minimum of 5V to energize, you'll need an external 5V power supply to drive the relay. Here's an updated circuit design for your requirements:
NPN transistor: A 2N2222 transistor should work for this application, as it can handle up to 800 mA collector current, which is well above the 71.4 mA required for the relay coil.
Base resistor calculation: Assuming a minimum HFE (current gain) of 100 for the 2N2222 transistor, we can calculate the base current (I_base) as I_base = I_coil / HFE = 71.4 mA / 100 = 0.714 mA. Now, we can calculate the base resistor (R_base) using Ohm's Law: R_base = (V_ESP32 - V_BE) / I_base = (3.3V - 0.7V) / 0.714 mA ≈ 3.6 kΩ. You can use a standard 3.6 kΩ resistor, or the closest available value, such as 3.3 kΩ or 3.9 kΩ.
Flyback diode: A 1N4007 diode should still work for this application, as it can handle up to 1 A continuous current and 1000V reverse voltage.
Here's the updated circuit:
Connect the collector of the 2N2222 transistor to one end of the relay coil.
Connect the other end of the relay coil to the 5V power supply.
Connect the emitter of the 2N2222 transistor to the ground of both the ESP32 and the 5V power supply.
Connect the base of the 2N2222 transistor to the GPIO pin on the ESP32 through the 3.6 kΩ base resistor (or the closest available value).
Connect the 1N4007 flyback diode in parallel with the relay coil (cathode to the 5V side).
This circuit should allow your ESP32 to control the SRD-03VDC relay with a 3.3V signal, while the relay coil is powered by a separate 5V power supply.
Granted, these relays are supposed to run on 3v3, but my concern was the pins from the ESP could not source enough current to trigger them. I suppose I could have just used 5V relays, and hopefully these will not fail sooner!
This is what all the parts look like, and I was presently surprised it worked. I put headers in for the ESP 32 and for the voltage converter… I’m glad I did this as it allows me to swap them out easily if I goof. IMPROTANT NOTE: If anyone chooses to try and re-create this, the transistor silkscreen is backwards (I burned three hours figuring this out).
All said, here’s the parts list for the electronics (I am not an Amazon affiliate):
- MELIFE esp32-s 30-pin dev board https://www.amazon.com/gp/product/B07Q576VWZ/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- uxcell relay x 2 https://www.amazon.com/gp/product/B00IIDY8JU/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- MP1584EN buck converter https://www.amazon.com/gp/product/B01MQGMOKI/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- NPN 2N2222A transistors x2 https://www.amazon.com/gp/product/B09DWP4XZ6/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- 1N4007 flyback diode x2 https://www.amazon.com/gp/product/B01M7S2ROI/ref=ppx_yo_dt_b_search_asin_title?ie=UTF8&psc=1
- 3.3k resistors x2 (I jusyt combined a 3k and 100ohm resistor, close enough)
- 220ohm cuirrent limiting resistor for the status led (not necessary but helpful, ignore the 470ohm in the schematic)
- status led (choose one you like)
- 10uF current smoothing capacitor on 5V
- 200uF current smoothing capacitor on 12V
- screw-down terminals
Next post will have the parts list for the actual flamey-shooty part