Solenoid Circuit in parallel

Hey Im using the solenoid circuit attached except im using a TIP 122 instead. I was wondering if it would be possible to use 6 of these in parallel? I have setup 2 in parallel with 24 volts @ 2.5 amps and only one works. I am using 24v solenoids using 1 amp.

Is it a problem with the circuit or maybe with my code? code below. How does this code work btw. Say, If the serial reads 60 then triggers solenoid strike subroutine will it start back at the top of void loop after or will it continue through the rest of void loop?

/*

//////////////////////////////SOLENOID ORCHESTRA\\\\\\\\\\\\\\\\\

6 24Watt Solenoids controlSolenoid by external MIDI
205 Michael Manning

The circuit:

  • Solenoid 1 to digital pin 8
  • Solenoid 2 to digital pin 9
  • Solenoid 3 to digital pin 10
  • Solenoid 4 to digital pin 5
  • Solenoid 5 to digital pin 12
  • Solenoid 6 to digital pin 13
  • 10K resistors to digital pins

*/

//---------------------------------VARS------------------------------------------

int serialvalue; // value for serial input

int SPins[] = {8, 9, 10, 5, 12 ,13}; //pin array

//---------------------------------SETUP------------------------------------------

void setup(){

for (int thisS = 0; thisS < 6; thisS++) { // initialize pins
pinMode(SPins[thisS], OUTPUT);

}
Serial.begin(9600); // open the arduino serial port
}

//---------------------------------LOOP------------------------------------------

void loop(){

if(Serial.available()) // check to see if there's serial data in the buffer
{
serialvalue = Serial.read(); // read a byte of serial data
Serial.print(serialvalue);

}
and if (serialvalue == 60){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (2);
}

if (serialvalue == 61){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (3);
}

if (serialvalue == 62){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (4);
}

if (serialvalue == 63){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (5);
}

if (serialvalue == 64){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (6);
}

if (serialvalue == 65){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (7);
}

if (serialvalue == 66){
Serial.print(serialvalue); // echo the received serial valu
solenoidStrike (8);
}
}

void solenoidStrike (int pinNumber) {
digitalWrite(pinNumber, HIGH); // set the Solenoid on
delay(80);
digitalWrite(pinNumber, LOW); // set the Solenoid on
serialvalue = 0;
}

will post in electronics too.

Yes, there's a problem with your code.

First, if you post code, please use the -button above the line with all smilies to enclose your program in code tags. That makes your program better readable.

Second, you aren't using the pins you want to use, you switch pins 2 to 8 high and low and don't use your SPins array ever.

Third, your code probably doesn't even compile correctly because of the "and" in the line:and if (serialvalue == 60){

As to why it does what it does, the program reads characters from the serial line and when receiving the characters < = > ? A B or C will hit the solenoid attached the matching pin from 2 to 8. Strange choice of characters, but to each his own.

Korman

the 6o comes from max msp which is receiveing midi notes from ableton.

how would i use the array like you said. I don get it do you have an example?

thanks

Ahhhhhhh ...

dont I feel dumb. Your right im sure it will work now. Thanks.