stepper motor

hi guys this is my first post :) :) i had a weird problem i tried to control a DVD stepper motor with arduino+l293d.i wire it properly i guess but before i connect the VCC2(pin 8) the motor start to spin in randomly (pin3=a+;pinb+;pin11b-;pin14a-) and this is my code ::help plz

int motorPin1 = 8; int motorPin2 = 9; int motorPin3 = 10; int motorPin4 = 11; int delayTime = 50;

void setup() { pinMode(motorPin1, OUTPUT); pinMode(motorPin2, OUTPUT); pinMode(motorPin3, OUTPUT); pinMode(motorPin4, OUTPUT); }

void loop() { digitalWrite(motorPin4, HIGH); digitalWrite(motorPin3, LOW); digitalWrite(motorPin2, LOW); digitalWrite(motorPin1, LOW); delay(delayTime); digitalWrite(motorPin4, LOW); digitalWrite(motorPin3, HIGH); digitalWrite(motorPin2, LOW); digitalWrite(motorPin1, LOW); delay(delayTime); digitalWrite(motorPin4, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin2, HIGH); digitalWrite(motorPin1, LOW); delay(delayTime); digitalWrite(motorPin4, LOW); digitalWrite(motorPin3, LOW); digitalWrite(motorPin2, LOW); digitalWrite(motorPin1, HIGH); delay(delayTime); }

Hi, Welcome to the forum.

Please read the first post in any forum entitled how to use this forum. http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code. It will be formatted in a scrolling window that makes it easier to read.

What is happening, if you have your circuit connected correctly, the motor is finding a power supply through the logic circuitry of the 293 which is already powered by the Vcc1 pin.

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Does your code work with Vcc1 and Vcc2 connected to power?

Tom... :)

You should arrange the power so that you cannot apply Vss (logic supply) unless Vs (motor supply) is already present - the chip isn't designed to operate with logic supply and no motor supply, it routes heavy currents from the logic supply to the motor windings and risks being fried if you do this.

this is my circuit of dvd stepper motor +l293d

v2=12v even if i don't conect it to 12v the motor spin