# Controlling Proportional valve with NPN transistor (TIP 122) using PWM

We are working to control the proportional solenoid valve (9C, 2W) (VSO by parker, datasheet) by changing the voltage across it. For this we are using PWM from the controller, thus changing the average current across the valve.

The controller (i.MX RT1060 from NXP) is capable to give up-to +3.3V. We are using TIP 122 NPN Darlington transistor to switch the voltage to 9V. Whenever we are changing the duty cycle from 95% to 100%, then only the valve is getting ON. If we are giving duty cycle is below 90% the valve is completely OFF.

We are giving 5KHZ PWM frequency, with 16 bit PWM resolution. The experiment result is mentioned below. Have a look at the sudden increase in the voltage from the duty cycle 95% onward. We are getting controlled flow, in between 95% to 99% only. If the circuit should work, if should work for the whole range.

Initially we have used base resistor of 390 ohm. We thought at lower duty cycle the voltage from the controller to the base of the transistor should be less. We decreased the resistor value from 390 to 190 and then to 47 ohm. Still did not get significant change across solenoid voltage at lower duty cycle. The flow vs duty cycle graph is not matching the datasheet.

• The simplest thing to do is to measure the coil resistance and compare it to Table 2 of the data sheet. If the resistance is greater than 47 ohms, you're using the wrong model valve, and its voltage requirements are too high for your 9 V supply. In other words, you may be using the wrong model valve. Jun 3, 2020 at 22:40

You need a diode across the valve coil so that current continues to flow when the transistor is off.

When you do get consistent current, compare with the valve datasheet values (should be included here if you want us to comment on the system behavior).

• Updated with the valves voltage and link for datasheet. How come adding diode will make sure that at low duty cycle, we will get required voltage across the coil. Jun 3, 2020 at 19:57
• The diode is necessary to the functionality, not just for protection. Jun 3, 2020 at 23:08
• It worked flawlessly, by adding schottky diode. I think current control better than voltage control (via PWM). But unable to understand technical difference. Jun 16, 2020 at 6:59

There a several problems in your schematic. 1. Diode over the coil as allready mentionted by Spehro 2. Most likly your frequency is to high. You will not reach the nessacary current. ~300Hz 3. The histeresis will be large. (Difference dependening on closing and opening). Superpose a second frequence over your set signal. HTH

• Please explain point 3. The datasheet specifically mentions PWM frequency range is from 5 kHz to 12 kHz so the frequency is the minimum suggested. It is not too high. Jun 3, 2020 at 20:28
• The force at opening and closing the valve has a different sign. => To compensate add a fix value at opening and subtracte a fix value at closing.
– Bill
Jun 14, 2020 at 19:08
• Does current control is better than voltage control (via PWM). Jun 16, 2020 at 6:57

As for your question about the diode across the valve coil, it's called a Flyback diode, and prevents kickback damage, ringing/oscillations due to PWM:

https://en.wikipedia.org/wiki/Flyback_diode