12V solenoid not opening when Microcontroller is hooked up to circuit

Thread Starter

Steve7716

Joined Feb 1, 2019
1
With the attached circuit the 12V solenoid activates when the button is manually pushed however when the ESP32 Adafruit Feather microcontroller is attached to the circuit, when the input is sent to the microcontroller the solenoid does not operate even though a voltage reading is shown coming out of the pin. Does this have something to do with the MOSFET or are there missing components with my circuit?
Additional notes: I am using a wi-fi communication with the microcontroller and therefore using the 5V regulator to power the board without the use of the USB cable. The 5V regulator is placed on the BAT pin of the microcontroller. The power supply being used is 12V 5A not 12V 2A as shown in the circuit.

Circuit: https://www.circuito.io/app?components=513,10456,10456,10456,10456,360217
 

wayneh

Joined Sep 9, 2010
16,399
I'm confused but I'll speculate that you're trying to drive a solenoid directly with the micro controller? It won't work. The solenoid needs more current than the µC is capable of. You need to control the MOSFET switch with the µC and that will handle the higher current needed by the solenoid.

Do you have a schematic? I'm not in the mood to study the image.
 

dendad

Joined Feb 20, 2016
3,591
Indeed. A circuit will make it easier, and also lets us compare it to your breadboard setup.
And it is often a worth while idea to add an LED/resistor to the port pin to indicate if it switches.
 

dendad

Joined Feb 20, 2016
3,591
All I see is a "picture" of the setup. That's ok I suppose, but drawing a real circuit is a good habit to get into.
 

danadak

Joined Mar 10, 2018
4,057
You need to use a logic level MOSFET that will turn on with a Vgs ~= the Voh of UP pin.

The interface should look like this -




So if Vdd of UP is 5V, and =~ Voh of UP pin, then MOSFET should be speced to turn on
hard with a Vgs < 5.0 V.

Make sure that D1 you choose has a revese breakdown rating that can handle
power supply V. You can use a regular silicon fast diode to do this also.

R1 typically 20 - 100 ohms, selected to minimize Vgs ringing due to high C
in MOSFET gate and stray L.



Regards, Dana.
 
Last edited:
Top