Go Down

Topic: Stepper (ESM.6088.42) connection to Arduino (Read 161 times) previous topic - next topic


Oct 24, 2020, 03:24 pm Last Edit: Oct 24, 2020, 03:26 pm by flice
Hello everyone,

I am trying to make said Stepper work and am failing terribly.
I am using an Arduino Uno R3 with a DRV8824/DRV8825 as a driver. The whole wiring and setup should not be problematic, it worked nicely with a smaller NEMA 17 (only 4 leads, see ppt-file blow). The code is simple enough:

Code: [Select]
#define MS0 9
#define MS1 10
#define MS2 11
#define DIR 3
#define STEP 4
#define Breakdown 11
#define Breakup 12
#define Trigger 2
#define Delay 500

void setup() {
  pinMode(MS0, OUTPUT);
  pinMode(MS1, OUTPUT);
  pinMode(MS2, OUTPUT);
  pinMode(DIR, OUTPUT);
  pinMode(STEP, OUTPUT);
  pinMode(Breakdown, INPUT);
  pinMode(Breakup, INPUT);
  pinMode(Trigger, INPUT);

void loop() {
  digitalWrite(MS0, HIGH);
  digitalWrite(MS1, HIGH);
  digitalWrite(MS2, HIGH);
  digitalWrite(DIR, HIGH);
 while (digitalRead(Trigger) == LOW) {
      digitalWrite(STEP, HIGH);
      digitalWrite(STEP, LOW);

Breakup and Breakdown are switches not used in this testing setup. The motors connection specs are attached.

Here are the problems:
The program will not run unless Arduino is connected to the PC via USB. Initially, I had a useless SerialRead in there, but I really see no reason, why the program shouldn't run without the USB cable as it is now. Power is coming through Vin, which is connected to the same 12V/2A Source applied to the shield/driver. Again, worked beautifully for the smaller motor, but with the same problem.

Secondly, since I couldn't figure out the leads from motor to driver, I decided to only connect one coil at a time, work my way through. Only blue and yellow, only blue and black, etc., connected to either A1/A2 or B1/B2. If done this way, the motor turns, but the direction changes upon triggering randomly. I turn on the power, press the switch, the motor turns. I stop pressing, it stops. I press it, it runs. Every time. But somnetimes it turns clockwise and sometimes counterclockwise. Is this normal? Do I need to connect all the wires for the code to work? That doesn't seem to make sense at all to me, why would the direction change? All I can think is that the Arduino is not applying the full 5 V to DIR, but if I change the DIR to LOW it's the same thing. Connectiong all wires (the way I understand) makes the motor vibrate loudly. Could be different coisl trying to turn in different directions, I suppose.

I cannot figure this out and can't find any similar problems on the interwebs. I'd appreciate a nudge in the right direction.
Thanks a bunch,


Oct 25, 2020, 12:54 am Last Edit: Oct 25, 2020, 01:00 am by JCA34F
Connect your motor according to the "Bipolar Seriell" in the first picture. Connect K2 and K3 together, K6 and K7 together. Connect K1 and K4 to A1 and A2, K5 and K8 to B1 and B2.


I cannot figure this out and can't find any similar problems on the interwebs. I'd appreciate a nudge in the right direction.
What is in the PDF files?

If they are pictures please just make them visible in your Post so we don't have to download them. See this  Simple Image Posting Guide

Two or three hours spent thinking and reading documentation solves most programming problems.


The USB-problem was a faulty GND connection - which the USB then provided. 

The pdfs are, as stated above, the documentation of the motor. They are not pictures. I was just trying to provide information. Is there a better way to do that?

I tried the setup you describe, but I will be careful to do as you suggest. Maybe the GND problem also messed with the motor. 

Thank you for your help!


It's running like a kitten, thank you SO much!!!

Go Up