0
\$\begingroup\$

I am working on a project to start a vehicle using Automotive Relays. enter image description here And I am following this circuit in the tutorial to do so. Everything works fine on Arduino UNO. But I want to use ESP32 of this kind in my final project and ESP32 is 3.3v with ~12mA max current. When I plug ESP32 to the above-given circuit (Obviously powering through external 5v connection with the shared ground and not 12v battery), it fails to trigger the relay and instead resets. Any suggestions?

My ESP32 Circuit. enter image description here

\$\endgroup\$
  • 1
    \$\begingroup\$ You have shown a schematic of what does work. Can you please post a schematic of what does not work showing any voltage regulators and power supplies. \$\endgroup\$ – Randy Nuss Apr 13 at 14:39
  • \$\begingroup\$ Are you, by any chance, running the TIP122 emitter current back to the battery via the ESP32? (If so then you would need to correct your schematic.) \$\endgroup\$ – Transistor Apr 13 at 15:29
  • \$\begingroup\$ @Transistor Yes. What would the ideal/optimal circuit if I am using 3.3v ESP32 ? \$\endgroup\$ – Suraj Jorwekar Apr 13 at 16:14
  • \$\begingroup\$ You may be running a high-ish current from the relay coil through the board and that might upset it. Try connecting the emitter directly to the battery negative. If you can find the PCB schematic and board layout it may help you understand potential problems. Start on github. \$\endgroup\$ – Transistor Apr 13 at 16:38
  • \$\begingroup\$ Okay. Will try to put the emitter directly to the battery and not to ESP32. \$\endgroup\$ – Suraj Jorwekar Apr 13 at 16:54
0
\$\begingroup\$

The ESP board has 5V in but runs on 3.3V, has a small ldo on the board to regulate the 5V down. And as the output current rises the output voltage level will drop below 3.3V.

The solution is to replace the TIP NPN Darlington transistor with a logic level N-Channel mosfet. IRLZ44 or STN4NF03L maybe. These are voltage driven instead of current driven and won't have the issues with the ESPs limited current and sagging voltage output.

Alternatively, use a opto isolated relay board/module. The esp would drive a small led based optocoupler that then drives a transistor and the relay.

Or use a smaller relay. Or use a small nfet to drive your Darlington transistor. A bunch of options. The logic level mosfet would be the simplest imho.

\$\endgroup\$
  • \$\begingroup\$ Can i use IRF520 MOSFET module - aliexpress.com/item/… \$\endgroup\$ – Suraj Jorwekar Apr 14 at 6:14
  • \$\begingroup\$ Or a IRL4ZZn Mosfet? \$\endgroup\$ – Suraj Jorwekar Apr 14 at 6:36
  • \$\begingroup\$ @SurajJorwekar Take a look at Typical Transfer and Output Characteristics graph. IRF520 is not logic level MOSFET. Use IRL4ZZN instead. \$\endgroup\$ – Unknown123 Apr 15 at 0:28
  • \$\begingroup\$ Hey guys unable to find IRLZ44 and STN4NF03L. Please suggest some other equivalent mosfet \$\endgroup\$ – Suraj Jorwekar Apr 15 at 13:43
  • 1
    \$\begingroup\$ just read the word logic level in the datasheet, you'll straightly know that it is logic level mosfet. \$\endgroup\$ – Unknown123 Apr 15 at 19:23
0
\$\begingroup\$

I would recommend using a logic level MOSFET. Use 1k gate resistance and don't forget to add a pull-down resistor (10k or so) so that the MOSFET remains OFF when you want it to be OFF ;) Make sure your GPIO pin voltage is at acceptable levels with the pull-down resistor installed. You'll find more details about this in the microcontroller datasheet.

\$\endgroup\$

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.