Controlling multiple Solenoid valve

Hi guys,

I’m trying to control multiple solenoid valves with my arduino, but I don’t really know how to program this.

I want to give a string of data like this:
"11111111",
"00000000",
"11111111",

Here there are 8 valves that first all activate and after some time all deactivate and so on, but I have no idea how I can program the ports that should change the value of the valves.

Maybe someone already made this program or something like it.

Plz help me.

Dukel:
Hi guys,

I’m trying to control multiple solenoid valves with my arduino, but I don’t really know how to program this.

I want to give a string of data like this:
"11111111",
"00000000",
"11111111",

Here there are 8 valves that first all activate and after some time all deactivate and so on, but I have no idea how I can program the ports that should change the value of the valves.

Maybe someone already made this program or something like it.

Plz help me.

Can you write a program to control 1 valve?

Thanks for you response,

Sure, sameway as controlling an LED.

But now I want to control 30 solenoids and I need a program dat makes it easy to chance the value of the valve.

Dukel:
Thanks for you response,

Sure, sameway as controlling an LED.

But now I want to control 30 solenoids and I need a program dat makes it easy to chance the value of the valve.

30 Solenoids, wow. How would you control that? Using a Shift Register on an Uno or using a Mega?

How much current for each solenoid? This board I offer can sink 1A per each of up to 32 solenoids. Need a diode across each solenoid coil.
http://www.crossroadsfencing.com/BobuinoRev17/


Shift in 4 bytes to turn them on or off.

digitalWrite (csPin, LOW);
SPI.transfer(byte0); // or the slower shiftOut()
SPI.transfer(byte1); // or these could be 4 bytes in an array
SPI.transfer(byte2); // bit = 1 = output on, sink current thru the solenoid coil
SPI.transfer(byte3);
digitalWrite (csPin, HIGH); // outputs update on this rising edge

BulldogLowell:
30 Solenoids, wow. How would you control that? Using a Shift Register on an Uno or using a Mega?

I’m using a arduino mega and about the shift register I have no idea yet of how to do this in the best way. So maybe shift register or something else.

Do you know other ways to do this?

CrossRoads:
How much current for each solenoid? This board I offer can sink 1A per each of up to 32 solenoids. Need a diode across each solenoid coil.
Cross Roads Electronics


Shift in 4 bytes to turn them on or off.

digitalWrite (csPin, LOW);

SPI.transfer(byte0); // or the slower shiftOut()
SPI.transfer(byte1); // or these could be 4 bytes in an array
SPI.transfer(byte2); // bit = 1 = output on, sink current thru the solenoid coil
SPI.transfer(byte3);
digitalWrite (csPin, HIGH); // outputs update on this rising edge

Thank you for your responce CrossRoads,

I'm not sure witch solenoid valve I'm going to use, but I was thinking of using some mosfets so my arduino can give the signal and an external power gives the needed voltage.
I already knew about the diode over the solenoid, but thanks for your reminder!

The electrical part is not realy my problem, I'm just not sure of how to program this and chance the orther of the valves in an easy was.