Go Down

Topic: Controlling 2 position double acting 24VDC solenoid (Read 788 times) previous topic - next topic


Does anyone know the proper signals to give the SMC SY3240 24VDC 2 position double acting solenoid?  It has a 24VDC connector on both sides.  I want to control a pneumatic actuator - be able to have the actuator extend and retract on signal.  I am using 2 pins on the Arduino to control 2 relays that control the 24VDC input to the solenoids ( one relay for the extend side and one relay for the retract side of the double acting solenoid).  I assumed that I would give a 24VDC pulse to the one side for 100 milliseconds or so and then when I want to change position, give a 24VDC pulse to other side.  In practice I could get the actuator to extend with the first pulse, but it would not retract when I pulsed the solenoid on the other side.  Any idea's.


[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]



All I have found - the one I am using is the base ported version of the SY3240




Nevermind, I wired up 24vdc directly using momentary switches and the double acting valve works like I thought it should - momentary pulse on one side swings the valve one way and a momentary pulse on the other side swings it the other way.  I had tested the relay circuit and Arduino control pin with 5VDC prior to hooking up 24VDC and going live and it was able to light up test LED's I put in the circuit.  Will go back to troubleshooting and figure out what changed.



hello ddailor,
why don't you just wire the solenoid directly to the arduino via a transistor or a mosfet. Basically, a solenoid is the same as a relay coil just without the contact. In terms of programming  i would do something like this. activate a solenoid then use the blink without delay to turn it off. how about make a function of it to call it in maybe something like,

Code: [Select]

void Solenoid( Int Name)
unsigned long previousMilis= millis();
unsigned long currentMillis = millis();
if(currentMillis - previousMillis > 10)


@ ash901226:
That's rather a programming question,
but I fear your void Solenoid(int Pin) function won't work as is.

I understand you do not want to block your whole sketch with a delay ( that's why you use millis() )
Assuming it's called continuously, you'd have to tell when to trigger or how long it's already HIGH.
If you just call it to activate the solenoid, it will never go LOW.

You might create a small class to turn a trigger pulse into a fixed duration.
If you want, you can call that a Solenoid although it's a rather universal task.

Code: [Select]
class Solenoid
  byte _pin;
  unsigned int  _duration; 
  unsigned long _tstart; // the millis() when triggered, or 0 when LOW

  Solenoid (byte pin, unsigned int duration=250);  // constructor, needs a pin number. Optional: activation duration in msec
  void trigger();  // to be called to activate
  void update();  // to be called regularly. Easiest solution to leave it to the user of this class, being responsible to call that once per instance.

That's just a possible definition. Implementation missing here, but usage should be rather clear.
Now you can expand it to some double pin ( "2 position double acting " ) class, asserting that only one of the two positions can be triggered at a time.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131