Esp32 solenoid control problem

Hi everyone.

I'm trying to assemble esp32 based controller for 12V solenoid valve. Everything works when solenoid-valve is powered through 12V adapter, but when I'm trying to power it via boost-converter (boost is used because all consumers - esp32, OLED, segment display, sensors, etc are 5V), it seems to have not enough power to operate, instead of full open-close cycle, it makes short twitch . I've used voltmeter to check output voltage on boost converter output, it's 12 V.

I'm fairly new to world electronics, so unfortunately can't provide any meaningful schematics besides fritzing schema below:

Would be greatful for any help, advises or hints.

Hi, @xnemox
Welcome to the forum.

What are you using as a power supply?
What are the specs of the solenoid?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

Thank you very much for your reply. As of now I have cheap adjustable power-supply which can provide power in range 1-12V up to 5 Amperes. Solenoid is: https://www.aliexpress.com/i/4000158806626.html

Hi,
How much current is needed to power the solenoid?

What are the specs on the MOSFET?

Tom.. :grinning: :+1: :coffee: :australia:

Beware of such specifications. Most likely the spec means at some setting it can supply 5 Amperes and at some setting it can supply 12 volts. But there is no setting where it can supply both at the same time. Please measure the voltage while you are trying to power the solenoid. Also you cannot just pulse the solenoid to power it.

As is typical with Ali, Amazon and E-Bay, they will say the volts, size, weight and color (that's important, nobody wants an icky pink valve), but never the current (Amps) or power (Watts). :roll_eyes:

Thanks for response. Once button pushed valve is supposed to be open for 2 seconds, and when I'm removing boost converter from the circuit and supplying 12 Volts via power supply it works exactly this way, when I'm decreasing it to 5 Volts and connecting solenoid via booster I'm getting 11.8-12.1 Volts before button is pushed, when pushed it drops to 0 Volts (I've checked and re-checked this twice)

Hi, MOSFET is TIP120: https://www.onsemi.com/pdf/datasheet/tip120-d.pdf

Are you sure the valve is 12V DC? Disconnect the valve from the circuit, then measure the coil resistance with your meter set to "OHMS".

Exactly, I've just crossed fingers in hope that it draws no more then 2 Amps, so 3 Amp booster would be enough

TIP120 is not a MOSFET, it's a Darlington transistor and will drop about 1.5 volts from 12. Did you get the coil resistance?

I'm sure, because it works when I'm passing 12V of power, I've tried less at 5V it's not working at all, at 9V its makes nothing but click sound, and it works on 12V. (without boost converter)

I've set it to 20k at resistance measuring mode 071.2, not sure if it's within expected range, but it's not zero, so coil has to be alive

BTW, I'm using this converter: https://t.ly/c3bqj

Well, if resistance is 71Ω current would be 169mA at 12V (2 Watts) and at least 400mA from the 5V supply. What is the current rating of the 5V supply and the booster? When the valve is energized, what is the voltage at the 5V supply, the booster output and the TIP120 collector?

I'm doing these measurements directly supplying 5V to booster (excluding transistor from this test in order to narrow down the scope of issues) which energizes solenoid directly. So before connecting a solenoid it has 5.19V on booster input, on output 11.98, when solenoid is energized, it twitches and current instantly drops to 0V on output while on input we still have 5.17V.

Hi, not what that means, can you please explain:

Also you cannot just pulse the solenoid to power it.

In my case goal is to supply power to solenoid for certain period of time, in this case it's two seconds , is that considered as a "pulse"?

It appears you may have the TIP120 collector and emitter swapped.

It appears you may have the TIP120 collector and emitter swapped.

In such case would this circuit work? I've removed booster and tried solenoid works when button pushed, so I'm asking before making any adjustments.

I'm not sure what you are asking. Draw and post a schematic.

The TIP120 is a poor choice for a driver transistor. Either the IRL540 or IRLZ44 would be much better.