Arduino digital I/O pins dropping form 5V to 1.2V when i connect a second stepper motor

So, I'm trying to control stepper motors with set up angles. I'm using 12V unipolar stepper motors, with ULN2003 as driver.

I started with one motor and one angle, works, added another angle, works. I was confident so i add another motor and everything messes up, neither of my motors worked. Got the problem, the arduino pins that i use were outputting 1.2V or less. I made a new program only doing digitalWrite(x, HIGH); to test only the pin output voltage. The first four pins, the ones i used in the first motor were right and outputted 5V, the other were ranging from 1.2 to 0.3

I replaced everything that could have failed. I have my mind drained so I could use a little help.

Code for the multiple tests

#define Motor1A 2
#define Motor1B 3
#define Motor1C 4
#define Motor1D 5

#define Motor2A 6
#define Motor2B 7
#define Motor2C 8
#define Motor2D 9

int wait = 100;

void firstMotor() {
  digitalWrite(Motor1A, LOW);
  digitalWrite(Motor1D, HIGH);
  delay(wait);
  digitalWrite(Motor1D, LOW);
  digitalWrite(Motor1C, HIGH);
  delay(wait);
  digitalWrite(Motor1C, LOW);
  digitalWrite(Motor1B, HIGH);
  delay(wait);
  digitalWrite(Motor1B, LOW);
  digitalWrite(Motor1A, HIGH);
  delay(wait);
  digitalWrite(Motor1A, LOW);
}
void secondMotor() {
  digitalWrite(Motor2A, LOW);
  digitalWrite(Motor2D, HIGH);
  delay(wait);
  digitalWrite(Motor2D, LOW);
  digitalWrite(Motor2C, HIGH);
  delay(wait);
  digitalWrite(Motor2C, LOW);
  digitalWrite(Motor2B, HIGH);
  delay(wait);
  digitalWrite(Motor2B, LOW);
  digitalWrite(Motor2A, HIGH);
  delay(wait);
  digitalWrite(Motor2A, LOW);
}

void setup() {
  Serial.begin(9600);
  pinMode(Motor1A, OUTPUT);
  pinMode(Motor1B, OUTPUT);
  pinMode(Motor1C, OUTPUT);
  pinMode(Motor1D, OUTPUT);
  pinMode(Motor2A, OUTPUT);
  pinMode(Motor2B, OUTPUT);
  pinMode(Motor2C, OUTPUT);
  pinMode(Motor2D, OUTPUT);
  /*
  digitalWrite(Motor1A, HIGH);
  digitalWrite(Motor1B, HIGH);
  digitalWrite(Motor1C, HIGH);
  digitalWrite(Motor1D, HIGH);
  digitalWrite(Motor2A, HIGH);
  digitalWrite(Motor2B, HIGH);
  digitalWrite(Motor2C, HIGH);
  digitalWrite(Motor2D, HIGH);*/
}

void loop() {
  firstMotor();
  delay(500);
  secondMotor();
  delay(500);
}

Schematics for everything
Using external power supply for the drivers, shared grounding with arduino

Image

Schematic image didn't upload ugh

Run the simple Blink sketch on each of the pins that are iffy.

What happens ? :thinking:

A real schematic will help a lot.

Max current is 20 mA for a digital output and total board I/O current 200 mA.

A breadboard simply cannot supply enough power for the motors.

Use a power distribution block or make you own power distribution board.

Power externally.

power distrubition blocks.


Also, how is power from the Uno getting to the breadboard? Powering the motors from an Uno is not something that's going to workout well.

Hi, @juanfran54
Welcome to the forum.

How are you powering the steppers?
Are you using the 5V from the UNO?
If so, stop, the 5V UNO supply cannot power very much.

Can you please post link to specs/data of the steppers?

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?
Hand drawn and photographed is perfectly acceptable.
Please include ALL hardware, component names and pin labels.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

I power the motors from an external regulated power supply, forgot to put that in the schematic my bad

Late response here, but made it work.
The original code that i was using kept the last pin of the steppers on "HIGH" and with 2 motors drawing power from my little power supply that i was using, i think wasn't enough for everything (side note that power supply is handmade), so pluged in another, checked the groundings and the secuence of the steppers and got it running.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.