Dual Power for Uno, easydriver 4.4 and 24v stepper…..Wiring questions???

Dual Power for Uno, easydriver 4.4 and 24v stepper…..Wiring questions???

Hello, firs off I am just getting started with the electronics side of my project and also really just getting my feet wet in electronics in general too.

Basically I am working toward using a combination of arduino UNO, easydrivers and stepper motors to different cnc related projects, but at this point I am just doing proof of concept mini projects to establish how everything is going to work for myself.

I know that these are some fairly basic questions but at this point I am very shall we say “gun shy” seeing as one of the first things I did was fry my first arduino uno by plugging a COLD(not actually plugged in) 30v power supply into it. (I was just trying to see if the connector was the right size for the arduino, but I am guessing the transformer or capacitors must have had enough juice to fry something??? Any ideas???) So basically I am in a position where I do not have a lot of extra money and I have already had to go out and buy a new arduino uno at the shack for $35 so I want to be sure from here on out that I am not going to fry anything.

First question:

My basic setup is arduino uno sending signals to an easydriver v4.4 wired into a mitsumi M42SP-6TA stepper motor(from an old Compaq printer).

My first setup using a 12V 750mA wall power adapter plugged directly into the arduino uno and then I follow wiring seen in this quick start guide

https://www.sparkfun.com/tutorials/400

and used the code here too. All I got were some barely audible wines and some very minor motor jumps when the power was plugged in. Now I am not sure of the motor wiring but I tried as many combinations as I could and I used a millimeter to find which wires went together so I don’t know if that was my issue but NO arrangement worked.

Any suggestions? Am I just underpowered?

Seccond Question:

My plan in trouble shooting is to go to a bigger power supply for the easy driver and then run the arduino separately either off of the usb or a separate power supply, or possibly just use a dual power supply.

The issue is that I want to make sure I am wiring it correctly so I don’t blow another arduino or my easydriver.

Any suggestions or help?

Third Question:

I also have a seed studio motor shield v1(I think) that I got at radio shack. Now this is actually a arduino shield in the since that it stacks on top of it, and it has a power jumper that I think either allows it to be powered by the arduino or power the arduino?

For testing my setup should I just use this, although I have 3 easydrivers and they will be used for more final projects?

If I use this do I leave the jumper in place to power the shield and arduino separately or do I remove the jumper?

Any simple wiring directions?

Thank you for reading and helping me with my issues. I know they are very basic and the answers are out there I just got overloaded with conflicting info and am worried I will fry another arduino or even my easydriver.

I would also be interested in some different code to test my idea and test stepper motors in general so if anyone has any suggestions that would be great.

THANKS AGAIN!!!!

You seem to have posted the wrong link.

I'm guessing that the Easydriver pages on the Sparkfun website explain how things should be wired. So it is not clear from your post what's causing you trouble.

Have you any information about the specifications for the stepper motor? Can you post a link to them? Can you post a picture of the motor (not too large, please)?

In general the easy drivers are the right thing to control a stepper motor, but without having details of the motor you have it is impossible to be certain.

...R

Sorry if my post/question is unclear…to be honest maybe I am not 100% clear on what I want/need, but I guess that’s why I am here for advice. I tried winging it and that ended in a fried uno so now I am just very leery of connecting power unless I am 100% sure its not going to damage things.

I fixed the link so that should maybe make things a little more clear, and I have two very slightly different stepper motors that I am playing around with although I can not find the pinout or exact spec sheets for either but I have found some info for similar versions.

Mitsumi stepper Motor 1: M42SP-6TA

Label ON MOTOR:
STEPPING MOTOR MITSUMI
M42SP-6TA
LOT NO.T 00925- 10(OHMS)

Mitsumi stepper Motor 1: M42SP-5A

Label ON MOTOR:
STEPPING MOTOR MITSUMI
M42SP-5A 7.5 STEP
LOT NO.T X00926- 5(OHMS)

I actually just found this video, in which this guy is doing exactly what I am trying to do except he is using a different arduino, stepper driver and his motor is the M42SP-5 and mine is the M42SP-5A.

I am going to try this using my Seed Studio Motor shield as it has the same chip (L298N) as his board is using and my uno with the motor shield running off a 12v power supply and then the arduino running off the usb power.

The question I have for this configuration is if I need to remove the jumper j4 on the motor shield seeing as I am using two power supplies.

Ill see if this works but then I will need to eventually wire my uno and easydriver with separate power and I just want to make sure I am doing it correctly.

I will try to draw up my wiring configuration for my next post and any other suggestions or help would be great.

Thanks Again

PS I can put pics of my steppers if need be too…

I think I am confused in a different way now. The link shows the use of an easy driver stepper motor driver board (which is likely to be an excellent choice) but you seem to be thinking of using an L298 driver board which is primarily intended for DC motors and is a poor choice for driving a stepper motor. It is more complicated to connect to the Arduino and it doesn't allow you to drive the motor with high voltages. The easydriver will have a small potentiometer that you adjust to set the maximum current to suit your motor.

Have you asked Google if it can find details for your motors?

It would be useful to know the maximum current that they can take. And since you know the coil resistance the nominal voltage would enable you to calculate that - if you can find that somewhere.

How many wires are connected to your motors? 4 or 6 wires is likely to make the motor easier to use than 5 wires.

You will need to measure the resistance between the different wires to figure out which wires belong to which coils.

...R

Yea, sorry not trying to confuse you, I have 3 easydrivers that I plan on using for my actual project, a cnc router/mill, but I also have a Seed Studio Motor Shield v1.2 and that does have the h-bridge.

I had originally purchased a few of the Motor shields for my projects as they are available locally but once I realized they were not as good for my needs I ordered my easydrivers. At this point I am just testing steppers that I have and testing a single axis design to test my rods and so on so all I really need is my stepper to step back and forth and change speeds for proof of concept. I went to Motor shield over the easydriver as I don’t want to risk blowing the ed just testing the steppers and sled components but I CAN use the ED to test also.

As for the motors, they are 4 wire bi-polar, 24v motors. All I can find is the spec sheets for very similar motors from the same company but different versions and it does not have the pinout. Here is the specs from the spec sheet without posting the whole pdf.

Item M42SP-5 M42SP-5K
Rated Voltage DC 24V
Working Voltage DC 21.6~26.4V
Rated Current/Phase 800mA(PEAK) 850mA(PEAK)
No. of Phase 4 Phase
Coil DC Resistance 6.3?/phase±10% 6.2?/phase±10%
Step Angle 7.5°/step

Excitation Method
2-2 Phase excitation (Bipolar driving)
2-2 Phase excitation (Bipolar driving)
Insulation Class Class E insulation
Holding Torque 109.8mN•m 85.0mN•m
Pull-out Torque 72.7mN•m/600pps 65.0mN•m/800pps
Pull-in Torque 91.5mN•m/200pps 76.0mN•m/200pps
Max. Pull-out Pulse Rate 1050pps 1,380pps
Max. Pull-in Pulse Rate 630pps 600pps

P

I have to run but ill check back later hopefully I am making a little since now. Thank you so much for the help.

Your motor seems to slightly exceed the current limit of the easydriver boards. You will need to adjust the max current to make sure it is below the limit of the driver board. I'm not sure if the board can easily supply its max current without additional cooling.

The Easydriver boards will be much easier to use.

Be aware, that with a coil resistance of 6.3 ohms it only takes a steady state voltage of about 5v to reach the maximum allowed current if you don't use an easydriver board.

...R

So my plan is to eventually buy some nema 17 or 23 motors but for the time being I was just going to use these for testing different concepts and so on. Do you think I should just go ahead and buy some new motors now due to the issue you pointed out? From what you can tell are these motors going to be a disadvantage to work with?

Also using these motors do you have any suggestions as far as the power supply I should be using? I would guess a 24v would be optimal but what about something like a laptop power supply? I have one that is rated at 65W, 18.5v and 3.5 amps, obviously I would have to make sure that my uno is completely wired separately(this is one of my questions how to safely do this) but could this power say both of these motors for short periods of time to test maybe 2 axis or something, not talking about actually running a full cnc program or anything but with the easydriver would this be feasible?

Thanks again for all the help

I really hope my questions are not to elementary for you and the board.

OK, so I got both steppers moving both directions(one at at time) using a 12v power supply to the seed motor shield v1.2(this regulates +5v to the uno with j4 jumper). I used the code provided on the wiki page for the shield.

By the way this shield uses an H bridge where as the easydriver uses a different chip from what I understand. As suggested above the easydriver is way better for my application but this works for my short term testing.

Will post wiring and links to code if anyone is interested. I know if I came across this post 3 days ago I would have wanted the info.

Anyway next I am going to hook them up to my test axis to test hardware components, then ill move on to wiring the arduino to the easydrivers and testing multiple axis at once.

Although I think I have found the info I need to wire dual power supplies with the uno/ed configuration I am still concerned about being sure I am not exceeding the uno as I will using one power supply that I think will exceed its limitations and I sure do not want to fry another one!!!

Any suggestions or info would be greatly appreciatioed.

Thanks again to Robin2 for all the help!!!

The easydrivers will be fine for testing and learning - much better than the Shield. I think their max voltage is 20v.

I am concerned that the shield with 12v might allow too much current through the motors and damage them.

The motors may be fine for the longer term - I certainly wouldn't replace them until I had found them to be insufficient. But a more powerful driver board would probably be desirable - higher voltage and current capability. I suspect the BigEasyDriver would be OK.

If the motors can't power your final project you will probably need ones that take 3 amps or more and then you will need more expensive non-hobby stepper driver boards. You will see some on Ebay that can control 3 or 4 motors. Most of them use the same Arduino connections as the easydriver - but are quite different from the motor shield.

...R

Yea, just from playing around with these little motors that I actually got for free, they sure have a lot of torque and holding power, at least more so than I thought, although I have no experience with stepper motors.

The fact that they are not the exact same motor worries me when it comes to programs like mach3 and processing actual g-code as it seems to me that unless I adjust for the different motors when setting things up I may get inaccurate results from driving different motors like they are exactly the same...anyway though for now they seem to be working for my purposes.

My other concern is the fact that, well at least what I understand, they need 24v to really get their max power and from what I can tell unless I go to a better driver board this will be a problem.

Another questions here too, do you see any problem running the easydriver board off of a power supply rated at 19.5v 4.62amps?

Also I am trying to write a simple test program that steps 5 revolutions in each direction and then single steps one full revolution and from messing around with the supplied arduino stepper sketches I have come up with the below code, but seeing as I have not written any code since my high school years, and then it was code for TI calculators, I cant get the single step portion to work and I know my 5 step code is just the stupidest way to do that. Keep in mind though that I have NO education in code at all, everything is self taught from just playing around with existing code.

//Stepper test sketch
//this code is meant to be a simple sketch to test stepper motors and the mechanics they are connected to by stepping five rotations in ove direction nand then 5 in the other and then single stepping one full rotation.
//The 5 rotations in each direction work fine but I know the code can be improved a bunch and the single step code does not work and as you can see only takes one step and then starts all the way over.

Created 11 Mar. 2007
Modified 30 Nov. 2009
by Tom Igoe
Modified 4 July 2012
By R. Dumouchelle
Modified 18 April 2014
by A. Flood

#include <Stepper.h>

const int stepsPerRevolution = 48; // change this to fit the number of steps per revolution
// for your motor

// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,11,12,13);

int stepCount = 0; // number of steps the motor has taken

void setup() {
myStepper.setSpeed(200);//set speed in (x)rpm
// initialize the serial port:
Serial.begin(9600);
pinMode(9,OUTPUT);
pinMode(10,OUTPUT);
digitalWrite(9,HIGH);
digitalWrite(10,HIGH);
}

void loop() {
// step five revolution in one direction:
Serial.println("5 rev clockwise");
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
myStepper.step(stepsPerRevolution);
delay(500);

//step five revolution in the other direction:
Serial.println("5 rev counterclockwise");
myStepper.step(-stepsPerRevolution);
myStepper.step(-stepsPerRevolution);
myStepper.step(-stepsPerRevolution);
myStepper.step(-stepsPerRevolution);
myStepper.step(-stepsPerRevolution);
delay(500);

myStepper.step(1);
Serial.print("steps:" );
Serial.println(stepCount);
stepCount++;
delay(500);
}

Any Help with my code would be great along with my other issues. BTW I am going to try to find some basic arduino programming info today as I know this is very beginner stuff I am asking about.

Motors that do the same number of steps per revolution will be interchangeable. And there should be an easy ability with most code to allow for different step angles.

The higher voltage is only needed to maintain torque at higher speeds. It forces the current to get to its maximum quicker.

The easydriver should be fine with that power supply. Excess amps are just ignored - better to have too many than too few.

I haven't studied your code carefully. I am not familiar with the stepper library or with driving via a motor shield. I think if you comment out all the lines to do with moving whole revolutions (lines 23-38) the single steps will work. If so I leave it as an exercise to figure out why.

For a working system (as opposed to a quick and dirty demo) you will need to get rid of the delay() function calls and replace them with the technique in the Blink Without Delay example sketch.

When you post code please use the code button (with the # symbol) so it looks like this.

I have written a more extensive demo of that technique in this Thread (in the first post).

The aim should be that every iteration of loop() your code tests to see if it is time to cause a motor to step, and if so, cause it to make one step. It gets a little more complicated if you want to coordinate the movement of 2 or more motors to (say) cause a tool tip to follow a diagonal.

...R

Thanks for the help, I did go ahead and comment out everything except the single step full revolution part to make sure that it worked and it did, so I just had to go back to my TI 83 programming experience and used an if then or at least arduinos version of one which is an if else.

Well the code below is what I came up with and it is working well, however, it seems that as it starts the single step function it takes one step back then starts its single step revolution??? Also I am still trying to figure a way to do the 5 revs each way in a better way if anyone has any suggestion.

//Stepper test sketch
//this code is meant to be a simple sketch to test stepper motors and the mechanics they are connected to by stepping five rotations in ove direction nand then 5 in the other and then single stepping one full rotation.
//The 5 rotations in each direction work fine but I know the code can be improved a bunch and the single step code does not work and as you can see only takes one step and then starts all the way over.
 
 
// Created 11 Mar. 2007
// Modified 30 Nov. 2009
// by Tom Igoe
// Modified 4 July 2012
// By R. Dumouchelle
// Modified 21 April 2014
// by A. Flood
 

 
#include <Stepper.h>
 
const int stepsPerRevolution = 48;  // change this to fit the number of steps per revolution
                                    // for your motor
 
// initialize the stepper library on pins 8 through 11:
Stepper myStepper(stepsPerRevolution, 8,11,12,13); 

int stepCount = 0;         // number of steps the motor has taken

 void setup() {
 myStepper.setSpeed(200);//set speed in (x)rpm
  // initialize the serial port:
  Serial.begin(9600);
  pinMode(9,OUTPUT);
  pinMode(10,OUTPUT);
  digitalWrite(9,HIGH);
  digitalWrite(10,HIGH);
}
 
void loop() {
  
 if(stepCount==stepsPerRevolution) {
     
    Serial.println("5 rev clockwise");
  myStepper.step(stepsPerRevolution);
  myStepper.step(stepsPerRevolution);
  myStepper.step(stepsPerRevolution);
  myStepper.step(stepsPerRevolution);
  myStepper.step(stepsPerRevolution);
  delay(500);
   
    Serial.println("5 rev counterclockwise");
  myStepper.step(-stepsPerRevolution);
  myStepper.step(-stepsPerRevolution);
  myStepper.step(-stepsPerRevolution);
  myStepper.step(-stepsPerRevolution);
  myStepper.step(-stepsPerRevolution);
  delay(500);}
  
    else
    
    
      myStepper.step(1);
  Serial.print("steps:" );
  Serial.println(stepCount);
  stepCount++;
  delay(500);
   
}

I would also like to have a little LCD that I can read the output on and I am not looking to go out and buy one, however I have a bunch of electronics that I use for parts, so does anyone have any suggestions as to where I could find a good, easy to use simple lcd?

I have this really nice 4-5 inch color one from a telephone with Teletype capabilities but I cant for the life of me find any info on it nor can I even find the pinout..

Thanks again!!!!

Ok, so I have had some time to get back to this after leaving off last with success using the seed studio motor shield v1.2 to drive all of my different steppers(I have 4 of them all from old printers), but now I am moving back to the easydriver to continue the proof of concept using it to control the steppers, but I am still having NO luck!!!

I fear that my problem may be that the steppers I have all need more than 750ma to operate therefor the easydriver will not work?

When I was using the motor shield the L298 would get crazy hot very quickly and start to shut down and malfunction. I am not really good with a multimeter but I tried measuring the amperage at the 4 motor connections and with a 12v power supply I was getting what seemed to be peaks of 2+ amps, but again I was not really sure what I should be measuring, i.e. where to put the +probe and where to put the -probe.

When I am trying to use the easydriver the main chip seems to get CRAZY hot very quickly when I run 12v and I don't seem to be getting any fluctuations in the amperage to the motor wires, but again I may be reading it or measuring it incorrectly....

Can anyone give me any help in trying to trouble shoot my easydriver setup and stepper motors to see why I am getting NO movement?

With an easyDriver board (or any that just needs step and direction signals) the following short sketch should work. It uses no library so it should be easy to follow. You may have to adjust the pin references to match your connections, or vice versa.

// testing a stepper motor with a Pololu A4988 driver board
// on an Uno the onboard led will flash with each step
// as posted on Arduino Forum at http://forum.arduino.cc/index.php?topic=208905.0

byte directionPin = 9;
byte stepPin = 8;
int numberOfSteps = 100;
byte ledPin = 13;
int pulseWidthMicros = 20;  // microseconds
int millisbetweenSteps = 25; // milliseconds


void setup() 
{ 

  Serial.begin(9600);
  Serial.println("Starting StepperTest");
  digitalWrite(ledPin, LOW);
  
  delay(2000);

  pinMode(directionPin, OUTPUT);
  pinMode(stepPin, OUTPUT);
  pinMode(ledPin, OUTPUT);
  
 
  digitalWrite(directionPin, HIGH);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
  delay(3000);
  

  digitalWrite(directionPin, LOW);
  for(int n = 0; n < numberOfSteps; n++) {
    digitalWrite(stepPin, HIGH);
    delayMicroseconds(pulseWidthMicros);
    digitalWrite(stepPin, LOW);
    
    delay(millisbetweenSteps);
    
    digitalWrite(ledPin, !digitalRead(ledPin));
  }
  
}

void loop() 
{ 

}

If the motor doesn't move then the likelihood is that the easyDriver can't provide enough current. Have you the current limit set correctly? I would expect the easyDriver to get very hot (hot enough to burn your finger) but it should survive plenty long enough to see if the motor works.

The L298 gets hot because there is too much current flowing - it has no current limiting feature. You need to keep the voltage down to 5 or 6 volts - and DO NOT power it from the Arduino 5 volts. (My code won't work with the L298).

...R

Thanks for the code, but yea, still no luck...

I can tell something is happening because the motors are getting enough power to "hold", i.e. the shaft is much harder to turn than when no power is supplied, I thought maybe I was wiring the motor wrong but again no luck with trying all the other iterations.

I just find it hard to believe that out of all four of my motors not a single one will run...

I just feel like I am doing something wrong!!!

Is there any way to tell from hooking them up to the L298 and measuring with a multimeter what kind of voltage and current they need to operate seeing as I can actually get them to move via the h-bridge?

OFFandON:
Is there any way to tell from hooking them up to the L298 and measuring with a multimeter what kind of voltage and current they need to operate seeing as I can actually get them to move via the h-bridge?

If the motors have a max current of 850mA I would expect them to move with a current of 750mA or so - though I have no means to test that.

I don't remember how much current the L298 can handle, but more than 750mA I think.

If you want to try the L298 you need a lower supply voltage. You have the max current and coil resistance so you can work out the max voltage with Ohms law. You may need an even lower voltage to keep within the current limits of the L298. And you also need to take account of the voltage drop across the L298 itself - they are not efficient devices.

Looking back at your earlier post perhaps you only have the specs for "similar" motors. If so, checking the coil resistance with a multimeter may help to confirm if your motors are the same.

If you intend to use the motor(s) in a project why not take a leap of faith and buy a stepper motor driver than can easily handle the full motor current. Drivers using an A4988 chip should be suitable.

...R