Electrical – Drive 12V Automotive Relay from 3.3v ESP32

#nodemcuarduinomosfetpower electronicstransistors

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

Best Answer

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.

Related Topic