Controlling Solenoid Cylinder

Hi everybody,

At my work, I have a gate that opens /closes using pneumatic piston.
The air Piston has 2 air entries, so if I want to open the gate I open air passage to one side and the other side of the piston I just open to atmosphere.

To do that, I use Solenoid Cylinder with two 24V Solenoids (two Solenoids from each side, because there is no return spring there).
It takes something like 10 seconds to open and close the gate and I want to write automation that will run opening / closing test of gate for some time.

Before the software, I need the electrical circuit that will do the switching between one 24V solenoid and another, and how I connect that to Arduino. Can you help me with that, guys ?

Thank you.

Probably, yes.

Please post a link to the specs or datasheet for the solenoids you plan to use, and any other electrical/electronic components involved.

Tell us about your level of experience with electronics, coding, engineering etc.

Also please read the forum guide in the sticky post at the top of most forum sections.

Ok, so :

In my other life I was a electrician practical engineer and I have no problem with coding (though I wrote little code to Arduino).
It was long time ago but I think I can do the research and understand, so I need a direction.

This is Solenoid Datasheet:
https://www.festo.com/tw/en/a/download-document/datasheet/566458

I have Eleigo Starter Kit Mega 2560 project, so I will use the resistors, transistors and other parts from there.

I thought about duplicating twice the next circuit (for each Solenoid) :

image

Its taken from here :
http://www.martyncurrey.com/controlling-a-solenoid-valve-from-an-arduino/

The thing is, I have transistor PN2222 and S8050 from the kit, and I wonder if the current from the Solenoids wouldn't fry them .

According to Datasheet, the coil is 24V and 1W, that means that max current is 0.04A.
I am not sure which current I should look at transistor datasheet but they don't look like they can work with 0.04 A current from Collector to Emitter.

I'm sceptical about that, seems low. But maybe I am more familiar with coils made for 5V or 12V. 24V coils would need less current. I was hoping the data sheet would specify the solenoid coil resistance. I would suggest you measure it with multimeter. If the resistance is, for example, 150R, then the current will be 24/150 = 0.16A.

With an npn transistor, it's the Collector current you need to check. And you are right, if the solenoid current really is 0.04A or 0.16A then 2n2222 would be fine.

Hmm, the same result .

So, from Datasheet of Solenoid :
Power is 1W from what is written there . So I thought that I=P/U = 1w/24V = 0.04 A.

From measuring the resistance, as you said : I got 540 Ohm resistance on a Solenoid.

So, I=U/R=24/540=0.04A .

Same result.

Ok, so S8050 (that's the other Transistor I have in the beginner box) collector current is :

It's 1.5A, that means I'm ok to work with that transistor, right ?

Then next question, what is the resistor I should connect to the Base of that transistor?

The base is connected according to the circuit I posted above to the digital Arduino output (5V?) .
I vaguely remember that I should use this characteristics of transistor :

image

So maybe I should pick Ib such, that the transistor will work in the linear range.
For example, Ib=1mA. So how I pick that base resistor so the base current will be 1mA ?

OK, that seems conclusive.

Yes, I think either of the transistors you have would be ok. Of the 2, I would choose the PN2222 because that's a general purpose whereas S8050 is meant to be used together with an s8550 in a push-pull configuration, like in an audio amplifier. But as far as I know it will also work.

No, you are not using the transistor as an amplifier, you are using it as a switch. Therefore you want to be in the saturation region, not the linear region. That will minimise the voltage drop and power dissipation of the transistor.

As a rule of thumb, 10% of the collector current flowing into the base should put it into the saturation region, so aim for a base current of around 4mA, since the collector current will be 40mA.

Arduino Mega is a 5V board, so the digital pins will output 5V. If you use a 1K resistor in series with the transistor base, that would give around 5/1000 = 5mA, probably a little less because of the base-emitter voltage drop, but that should be enough. The exact values are not critical when using the transistor as a switch.

AS I read the valve specifications, it is a piloted solenoid valve that has one solenoid to move the valve to one position and a second solenoid to move the valve the opposite direction. Only a short pulse is necessary as the air pressure will do the actual work.

So, is your project design for TWO of the valves and you will write code to coordinate the positions of the valves? Seems a bit strange as your compressed air will just escape from the valves when the solenoid is not opening or closing the gate.

No no, I meant using one valve to control the gate.

It's just that the valve I have, has two solenoids to shift positions, so I meant controlling those two solenoids to move the valve from one to other position with delay of like 10 seconds.

Like this :
image

OK, So you made a whole lot of sense to me.
Next question is : Because this valve has two solenoids, I need to give a pulse of 24V (or a constant 24V?) to one, and the second Solenoid should be 0V.
Then in order to switch, I set the first Solenoid to 0V, and give a 24V pulse to the second Solenoid.

I thought about just making two different circuits described above, and connect a Base of each Transistor of the respected circuit to Digital Arduino output.

Is that a correct way, or I can make other circuit that will switch using only one Arduino Digital Output (to cascade several Transistors or something of this sort?).

Thank you very much!

I'm not clear on that, I'm not familiar with this type of valve and the data sheet didn't give much detail, and the diagram you posted above is meaningless to me. But it makes no sense to me to have 2 solenoids in the valve if the voltage to one of them needs to be constant. It would be simpler to have one solenoid and a return spring. So I suspect a pulse will work, but I have no idea how long the pulse needs to be.

So I recommend you experiment. Begin with a long pulse, say 2 to 5 seconds, to open/close the valve. If, after the pulse has ended, the air starts to leak out, then it needs to be constant voltage.

If you find out that it does need to be constant voltage, then, yes, there would be a way to use a single Arduino output pin, but extra circuitry would be required, so would it be worth it to save a couple of Arduino pins? I doubt it, for your project.

Since you DO NOT need an Arduino to test it, can we assume you have tested your valve and it will allow the piston to move both directions for you?

Hi guys, I'm on my way to finish the circuit. My question is :
In the picture above the first picture), 12V of Power Supply connected to Arduino GND pin.
What is the reason, should I also connect 24V of my power supply to arduino GND Pin ?

Additional question, the Arduino works by connecting it to PC USB. Can I still use an Arduino pin connected to base to control the 24V solenoid ?

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.