Go Down

Topic: multiplexing transistors to control stepper motor (Read 599 times) previous topic - next topic

anfractuosities

So I am trying to control a 24v stepper motor by multiplexing transistors.

I don't quite know how to explain this but here we go...

I have 2 sets of transistors, one set is using the digital pins (top set) to pass voltage to the base of another set(bottom set) that is passing 24v to the motor.

I have the collector pins of the first first set connected together and also connected to digital pin 8.

The base pins of these transistors are connected to digital pins 2,3,4, and 5.

The emitter pins are connected to the base pins of the corresponding transistor in the bottom row.

The collector pins of the bottom row are each connected to the 24v, and the emitter pins, to the corresponding stepper motor pins.


Here is the code tat I am running, though I get no result....upon replacing the bottom row of transistors with LEDs, I can make them light up individually, so I think the circuit should work, but alas...

Code: [Select]

int p1 =  2;    
int p2 = 3;
int p3 = 4;
int p4 = 5;
int row = 8;

void setup()   {                
 pinMode(p1, OUTPUT);    
 pinMode(p2, OUTPUT);    
 pinMode(p3, OUTPUT);    
 pinMode(p4, OUTPUT);      
 pinMode(row, OUTPUT);    
}

void loop()  {
digitalWrite(row,HIGH);
digitalWrite(p3,LOW);
digitalWrite(p4,LOW);
digitalWrite(p1, HIGH);
digitalWrite(p2, HIGH);
digitalWrite(row,LOW);

digitalWrite(row,HIGH);
digitalWrite(p2, HIGH);
digitalWrite(p3, HIGH);
digitalWrite(p1,LOW);
digitalWrite(p4,LOW);
digitalWrite(row,LOW);

digitalWrite(row,HIGH);
digitalWrite(p3, HIGH);
digitalWrite(p4, HIGH);
digitalWrite(p1,LOW);
digitalWrite(p2,LOW);
digitalWrite(row,LOW);

digitalWrite(row,HIGH);
digitalWrite(p1, HIGH);
digitalWrite(p4, HIGH);
digitalWrite(p3,LOW);
digitalWrite(p2,LOW);
digitalWrite(row,LOW);
}


I am new to this, so any help would be appreciated :)

Grumpy_Mike

I think what you are describing is not multiplexing of transistors but a H-Bridge. Look that up and see if this is what you are doing.  Like Richard said a schematic would make it all clear.

Go Up