# Proportional Solenoid Valve + Arduino

I am thinking of buying a proportional solenoid (PVQ31) valve for a project. I thought of using Arduino to drive this valve but the issue is - this valve needs a range of current supply (0-165mA for 24V or 0 - 330 mA for 12V) for flow control. How can I have current control using Arduino? I thought of using digital pots but they operate at 5V only.

Thanks.

Z

Driving a solenoid, even a proportional one, is best done with pulses. Solenoids have significant inductance, so do their own current filtering. When the pulses are fast enough, the solenoid "sees" only the average current.

Using pulses not only simplifies the circuit, but makes it efficient. Since power isn't wasted and turned into heat, you don't have the problem of having to use large parts and getting rid of the heat.

Here is a simple circuit:

The gate of the FET is driven directly by a PWM output of the microcontroller. Something around 25 kHz PWM frequency should be fast enough for most solenoids so that the current changes very little during one pulse. That is also above the audible range, so you won't hear any whining. Many modern microcontrollers have plenty of PWM resolution left at 25 kHz.

Q1 is used as a switch, and turns on when the PWM output is high. This applies the full power voltage to the solenoid. When Q1 turns off again, D1 provides a path for the existing current to continue circulating.

I've driven proportional solenoids with exactly this circuit in a real commercial product.

• thanks. I understand. But with your circuit, how do I exactly set the right resistance for coil to draw certain current? Apr 2, 2017 at 13:59
• @Zeus: You don't use resistance. Adjust the duty cycle to vary the average voltage across the coil. For example, with a 24 V supply and 35% duty cycle, the effective coil voltage is 8.4 V. Apr 2, 2017 at 15:44
• I see. This is what Piotr Szturmaj suggested earlier. imgur.com/a/hnOLo R_added (145.45 ohms) was for the reason that resistance generated on source and drain pins would be unknown until I measure (at least I don't know how to calculate). In this case, valve will be NO and with PWM, it would be possible to drive the valve Apr 2, 2017 at 20:14
• Hi I will request you to answer this questions which I put to Piotr. I built the circuit which Piotr suggested for my PVQ31 24V model. This circuit is similar to yours as well. I used FQP30N06L mosfet in the circuit. Based on the specs, total resistance (Rcoil, Radded and Rds of mosfet) should be around 145.45 ohms. R_added came out to be ~40 ohms. Unfortunately, the circuit couldn't drive the valve. Please suggest what could be wrong.. Thanks. Jul 5, 2017 at 6:19
• @Zeus: Ask that as a separate question. Jul 5, 2017 at 13:00

I have not seen no industrial controller controlling a proportional valve with DC current. It is much easier and more efficient to use PWM directly. The inductance of the valve coil and inertia of the valve makes whole system not sensitive to current oscillations at sufficiently high frequencies (I have not seen a frequencies above several kHz). All you need is a powerful enough high side or low side switch and a flyback diode for coil - you can use a common MOSFET or you can look at specialized switches/FET drivers with logic level inputs (like IPS511/521, IPS6041 and similar, for example). By regulating the PWM frequency and duty cycle, you determine the resulting average ripple current in the solenoid. It is an efficient, classical solution, look at this page, for example. It is also possible to easily add a galvanic isolation with a conventional optocoupler, if necessary. Sorry for bad English.

Update Taking into account your comment under my reply, my thoughts are as follows:

1. Calculate the required factor of the divider R1R2 easily: see, because of the fixed gain factors of the operational amplifier and the transistor in datasheet circuit, we see a pleasant regularity - taking the resistance from the middle row of the datasheet table (4990 and 178 ohm) and solving the voltage divider equation for five volts on input, we get 0.172 volts at the output of the divider, which corresponds to the current from the table - 0.172 A :) It is easy to check the regularity for the remaining rows of the table using the calculator. Thus, for your 330 mA current for PVQ31, the resistance of the R2 will be 352.61 ohms if you leave the resistor R1 the same. Having received the necessary ratio of resistances (Р1 / Р2 = 14.15), you can choose the resistances of both resistors from the existing standard series. For example, for the E24 series there is a close resistance of 360 ohm, 360 * 14.15 = 5094, which is close to the standard resistance in 5.1kOhm, this combination will give you a maximum current of 329.67mA. In addition, nothing prevents you from using digital pots or recalculate R1R2 for other input voltage.
2. The converter from your link (as judged by the description) is designed for little else - it converts the signal voltage into a standard signal current of the current loop 4-20mA. He will not suit you. Confuses the specified maximum current of 770 mA, but I'm not a great expert, without the module schematics I can not say for sure.
3. I would still experiment with PWM ;) Moreover, in datasheet it is indicated that it is possible to use PWM and even frequency is marked - 5 kilohertz and more. If the rest of your device were analog, then a DC current option would be preferable, since it would be more costly to implement a PWM. But since you will be controlled using a digital circuit (arduino), you do not need anything extra to implement PWM, and the analog driver will be more expensive, IMHO.
• Hi, yes I agree with you. Smaller proportional valves are usually current controlled (from what I have see until now). I found a similar valve from parker but its current requirement is not same as PVQ31. Here is the link.drive.google.com/file/d/… On page 5, there is a driver circuit. I am not sure if this circuit will drive PVQ31 unless I recalculate R1 and R2 which I don't know how to. Apr 1, 2017 at 9:46
• Alternatively, do you think if this can replace the circuit? m.ebay.com/itm/… Apr 1, 2017 at 9:50
• Hmm... Interesting. I will add a new answer, since there are too many letters in it :) Apr 1, 2017 at 19:02
• @ZeusEx I updated my answer. Apr 1, 2017 at 19:29
• Super! Thank you (Spasiba!) I have a small comment which I mention in the comment section of dannyf post. Apr 2, 2017 at 13:54

You can use a MOSFET in linear region plus a simple PWM controlled DAC (like this: http://www.avdweb.nl/arduino/hardware-interfacing/fast-pwm-dac.html). MOSFET will act as a resistor controlled by DAC voltage. If you have such resistor, you can control current passing through. Given the drain voltage (12V/24V) and selected valve current you can calculate required resistance from the Ohm law.

• Comments are not for extended discussion; this conversation has been moved to chat. Mar 31, 2017 at 14:43
• @PiotrSzturmaj hi, I built the circuit you suggested for my PVQ31 24V model. I used FQP30N06L mosfet in the circuit. Based on my calculations, R_added came out to be ~40 ohms. Unfortunately, the circuit couldn't drive the valve. Please suggest what could be wrong.. Thanks. Jul 5, 2017 at 5:28

I recalculate R1 and R2 which I don't know how to...

simple:

Vctrl * R2 / (R1 + R2) = I * 1.

1. Pick R1 + R2 to satisfy the max current capability of the control voltage. Say 10ma @ 5v -> R1 + R2 = 470R.

2. Pick R2 to achieve the desired I / Vctrl ratio.

• great thanks. I am not an electrical engineer first to mention before I explain myself. I am familiar with basic voltage divider circuit which is Vout = Vin(R2/(R1+R2)). Dimensionally, also [V] = [V]. In your above equation why on the RHS instead of V, I is multiplied by 1? Apr 2, 2017 at 13:57