Hi, I was wondering if any one can help me with this project please. I need to run a 3 Way pneumatic solenoid ( SMC VQ100-series 3-port solenoid valve) valve at an open/close rate from zero to twenty cycles per second. With the extension of a potentiometer as means to control the cycle rate of the valve by manual user input. Is this feasible or is it impossible? Thanks in advance
That's doable.
Take a look at the Blink LED example, and the Blink Without Delay* example.
There's an Analog Read example that shows you how to read a pot.
If you understand how those two (or three) programs work, you can combine the concepts to make a program that blinks the on-board LED at a variable rate according the pot position.
Then, it's just a matter of adding a few components to drive the solenoid along with the LED. There's an example for that too.
- The delay() function is rarely used in real-world programs (or it's used carefully). Program execution pauses during the delay time. So for example - If you have a 1 second delay before the solenoid switches states, it can't read the pot during that delay time and any pot-position changes won't happen until after that delay. At 20 cycles per second, that wouldn't be an issue but it might be a consideration at slower speeds.
If you create a variable called "dly" and you assign the pot value to that using the MAP function at the beginning of your main loop, your
val= analogRead(pot_pin);
dly = MAP(val,0,1023,0,255); //20 cps is a delay of 25mS between ON and OFF
digitalWrite(ouput_pin-A,HIGH); //can be followed by
delay(dly);
digitalWrite(ouput_pin-A,LOW);
digitalWrite(ouput_pin-B,HIGH);
delay(dly);
//this completes ONE CYCLE , then returns to the beginning to read the pot before next cycle
You can replace the delay function with millis() if you prefer.
Deauled:
Hi, I was wondering if any one can help me with this project please. I need to run a 3 Way pneumatic solenoid ( SMC VQ100-series 3-port solenoid valve) valve at an open/close rate from zero to twenty cycles per second. With the extension of a potentiometer as means to control the cycle rate of the valve by manual user input. Is this feasible or is it impossible? Thanks in advance
I find there are a few oddities with your post.
- A Pneumatic solenoid value is actuated by air-pressure.
- A 3-way value implies 4 ports i.e. 1 in and 3 out.
Looking at the design of the SMC VQ100 series, you have a manifold which is effectively a common in-port, delivering air-pressure to optional add-on out-ports. However, the actuating medium is not air pressure.
Based on a quick look, it appears each out-port is independently actuated electrically.
So my first question would be - what is the logic based on? Are all 3 ports to be actuated simultaneously, or do they require independent control?
If my conclusions are incorrect, then kindly provide more details.
According to the datasheet, the + voltage goes to the COMMON (B) and the two solenoids (one for each direction) are switched by the two "-" connections (A or C) which sink the coil current based on the diode direction. Since the A diode is opposite polarity to the B diode and AC is both POS and NEG voltage, it would suggest that the diodes determine the polarity. I don't think we know if it is a DC or AC solenoid ? single or latching ?