Camera motion control with Dragon Stop Motion

I build a motion conrol device with a stepper wired like this:

I'm using a 12V unipolar stepper (6 wires, 0.16 A per winding. I plugged in a 12V power adapter with 1 A.

After few seconds the ULN2803 gets really hot and the motor stops running.

What could cause the problem?

I use Dragon Stop Motion to control it, with the following script:

/*
Arduino sketch that moves an unipolar stepper motor
every time Dragon Stop Motion sends a "PF" (Position Frame) command.
A linear slider solution and a simple stepper motor interface capable of moving a DSLR is shown at
Using the Canon HF100 PAL HD Camcorder: DIY camera motion control
2009, Martin Koch

Function:
move(steps, direction, hold_load)
steps: 200 steps = 360°
direction: true = cw, false = ccw
hold_load: true = leave motor current on

*/
//Arduino digital output numbers
#define D0 13
#define D1 12
#define D2 11
#define D3 10
byte inbyte = 0;

void setup() {
pinMode(D0, OUTPUT);
pinMode(D1, OUTPUT);
pinMode(D2, OUTPUT);
pinMode(D3, OUTPUT);
pinMode(D12, OUTPUT);
Serial.begin(56000); //open the serial port
}

void loop() {
/*
Read one byte (one character) from serial port.
If Dragon Stop Motion sends the character "P"
it must be the "PF" (Position Frame) command.
Lets move the camera to the next position.
*/
inbyte = Serial.read();
if (inbyte == 'P') move(20, false, false); //Move 20 steps, clockwise?, hold_load?
}

void move(int number_of_steps, boolean clockwise, boolean hold_load) {
int output_pattern = 0;
int steps_so_far = 0;
do {
switch (output_pattern) { // Full steps
case 0: //1100
digitalWrite(D0, HIGH);
digitalWrite(D1, HIGH);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
break;
case 1: //0110
digitalWrite(D0, LOW);
digitalWrite(D1, HIGH);
digitalWrite(D2, HIGH);
digitalWrite(D3, LOW);
break;
case 2: //0011
digitalWrite(D0, LOW);
digitalWrite(D1, LOW);
digitalWrite(D2, HIGH);
digitalWrite(D3, HIGH);
break;
case 3: //1001
digitalWrite(D0, HIGH);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, HIGH);
break;
}
delay(15); //15 ms give 10 revolutions per minute
steps_so_far += 1;
if (clockwise) output_pattern -= 1; else output_pattern += 1;
if ( output_pattern > 3 ) output_pattern = 0;
if ( output_pattern < 0 ) output_pattern = 3;
} while (steps_so_far < number_of_steps);
if (!hold_load) {
//If the stepper motor doesn't have to hold the load when it stands still
//turn off any motor current to keep it cool
digitalWrite(D0, LOW);
digitalWrite(D1, LOW);
digitalWrite(D2, LOW);
digitalWrite(D3, LOW);
}
return;
}

I hope someone can help!
thanks

I'm afraid I can't see anything wrong; it looks like you've got everything hooked up right. Just some things to think about:

  • Are you sure the motor is only 0.16A per winding? If it's 1.6A per winding then that would explain the overheating.
  • Bad ULN2803? Do you have another (though you may end up destroying that too....)
  • Is anything on the Arduino getting hot?
  • The ground connection from the ULN2803 back to the power jack: make that a direct wire from the ULN2803 to the power jack (as close as possible). The part of the breadboard that is "shared" between the ULN2803 ground path back to the jack and the Arduino ground path should have as little in common as possible.

--
The Quick Shield: breakout all 28 pins to quick-connect terminals

thanks for the quick answer!

Its defenitely 0.16A per winding. The Arduino is not getting hot.
I'll test another ULN2803 and a shorter ground wire from the power jack.

It is also possible that the wiring from the stepper to the ULN2803 is wrong?

It is also possible that the wiring from the stepper to the ULN2803 is wrong?

I suppose, but I have trouble believing that's causing overheating.

--
The Gadget Shield: accelerometer, RGB LED, IR transmit/receive, speaker, microphone, light sensor, potentiometer, pushbuttons

It was a bad ULN2803!

Thanks for your help!!