Please help guys, not sure what I am doing wrong, I have two banks of 8 AA batteries one powering the Arduino and another one powering the Dual Step Motor Shield 1.1, I have finally managed to get the motor spinning however the controller circuit board gets extremely hot to touch, not matter what I do this happens. I have tried just running the motor with one bank of batteries (btw my controller is piggibacked on the Arduino) through the arduino one thing that that it takes the motor a second or more to start spining however the circuit still gets very hot am I missing something obvious.
You should read the sticky note at the top of this forum. There are no links to the hardware you used and you didn't provide the code you used for this. It might have been a good idea to post a drawing (or photo) of all the wiring you've done.
How should we help you without the necessary information? That's why there's a sticky note everyone should read before posting.
These are the pictures of the setup, code and hardware I use.
Hardware used
Controller
http://robotics.org.za/index.php?route=product/product&product_id=170
Arduino Uno


//Copyright 2012 Igor Campos
//
//This file is part of CustomStepper.
//
//CustomStepper is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//CustomStepper is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with CustomStepper. If not, see http://www.gnu.org/licenses/.
#include <CustomStepper.h>
//Full constructor, just the first 4 parameters are necessary, they are the pins connected to the motor,
//the others are optional, and default to the following below
//the 5th paramater is the steps sequence, where the 1st element of the array is the number of steps
//it can have a maximum of 8 steps
//the 6th parameter is the SPR (Steps Per Rotation)
//the 7th parameter is the RPM
//the 8th parameter is the rotation orientation
CustomStepper stepper(2, 3, 4, 5, (byte[]){8, B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);
boolean rotate1 = false;
boolean rotatedeg = false;
boolean crotate = false;
void setup()
{
//sets the RPM
stepper.setRPM(12);
//sets the Steps Per Rotation, in this case it is 64 * the 283712/4455 annoying ger ratio
//for my motor (it works with float to be able to deal with these non-integer gear ratios)
stepper.setSPR(4075.7728395);
}
void loop()
{
//when a command is finished it the isDone will return true, it is important to notice that
//you can't give one command just after another since they don't block the execution,
//which allows the program to control multiple motors
if (stepper.isDone() && rotate1 == false)
{
//this method sets the direction of rotation, has 3 allowed values (CW, CCW, and STOP)
//clockwise and counterclockwise for the first 2
stepper.setDirection(CCW);
//this method sets the motor to rotate a given number of times, if you don't specify it,
//the motor will rotate untilyou send another command or set the direction to STOP
stepper.rotate(2);
rotate1 = true;
}
if (stepper.isDone() && rotate1 == true && rotatedeg == false)
{
stepper.setDirection(CW);
//this method makes the motor rotate a given number of degrees, it works with float
//you can give angles like 90.5, but you can't give negative values, it rotates to the direction currently set
stepper.rotateDegrees(90);
rotatedeg = true;
}
if (stepper.isDone() && rotatedeg == true && crotate == false)
{
stepper.setDirection(CCW);
//this will rotate until you stop it with another comand or set the direction to STOP
stepper.rotate();
crotate = true;
}
//this is very important and must be placed in your loop, it is this that makes the motor steps
//when necessary
stepper.run();
}
Please edit your post and insert code tags to make it readable and avoid that the forum system is changing it.
Do you have a link to the datasheet of the motor you're using?
I have requested the data sheet for the motor and will send it as soon as I get it, also not sure what you meant by to insert a code tag.
//Copyright 2012 Igor Campos
//
//This file is part of CustomStepper.
//
//CustomStepper is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//CustomStepper is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with CustomStepper. If not, see <http://www.gnu.org/licenses/>.
#include <CustomStepper.h>
//Full constructor, just the first 4 parameters are necessary, they are the pins connected to the motor,
//the others are optional, and default to the following below
//the 5th paramater is the steps sequence, where the 1st element of the array is the number of steps
//it can have a maximum of 8 steps
//the 6th parameter is the SPR (Steps Per Rotation)
//the 7th parameter is the RPM
//the 8th parameter is the rotation orientation
CustomStepper stepper(2, 3, 4, 5, (byte[]){8, B1000, B1100, B0100, B0110, B0010, B0011, B0001, B1001}, 4075.7728395, 12, CW);
boolean rotate1 = false;
boolean rotatedeg = false;
boolean crotate = false;
void setup()
{
//sets the RPM
stepper.setRPM(12);
//sets the Steps Per Rotation, in this case it is 64 * the 283712/4455 annoying ger ratio
//for my motor (it works with float to be able to deal with these non-integer gear ratios)
stepper.setSPR(4075.7728395);
}
void loop()
{
//when a command is finished it the isDone will return true, it is important to notice that
//you can't give one command just after another since they don't block the execution,
//which allows the program to control multiple motors
if (stepper.isDone() && rotate1 == false)
{
//this method sets the direction of rotation, has 3 allowed values (CW, CCW, and STOP)
//clockwise and counterclockwise for the first 2
stepper.setDirection(CCW);
//this method sets the motor to rotate a given number of times, if you don't specify it,
//the motor will rotate untilyou send another command or set the direction to STOP
stepper.rotate(2);
rotate1 = true;
}
if (stepper.isDone() && rotate1 == true && rotatedeg == false)
{
stepper.setDirection(CW);
//this method makes the motor rotate a given number of degrees, it works with float
//you can give angles like 90.5, but you can't give negative values, it rotates to the direction currently set
stepper.rotateDegrees(90);
rotatedeg = true;
}
if (stepper.isDone() && rotatedeg == true && crotate == false)
{
stepper.setDirection(CCW);
//this will rotate until you stop it with another comand or set the direction to STOP
stepper.rotate();
crotate = true;
}
//this is very important and must be placed in your loop, it is this that makes the motor steps
//when necessary
stepper.run();
}



Your stepper motor has four wires so it's a bipolar stepper motor. Your shield is designed for bipolar stepper motors. The CustomStepper library and your code is written for unipolar motors -- this is bad.
You need a different library, for example the AccelStepper library. Using that library the constructor for two motors (I'm assuming you'll add a second one later) would look like:
AccelStepper stepper1(AccelStepper::FULL2WIRE, 2, 3);
AccelStepper stepper2(AccelStepper::FULL2WIRE, 6, 7);
If you can put your finger on the chip (or the motor) and hold it there for a couple seconds it's not "too hot", but a heatsink would still be a good idea.
I can't tell you how much you have helped me thank you. The issue with heat was that it got so hot to the point that you couldn't keep your finger on the chip for a second, will try with this new program do you think that there is an issue with how much power I am supplying to the boards and also if I wanted to install a small fan how would I connect it as this setup would be running for hours and hours and I don't want to cause damage.
With your previous program you were toggling the MS1 and MS2 pins (which set the microstepping) along with your STEP and DIR pins. Apparently that rapid toggling of those pins causes the chip to overheat. Otherwise, the heat should be controllable by adjusting the trimmer to a lower current setting.
The chip has overheat protection and should shut off at 165oC, btw. Not that you want to push it.
Awesome again thank you very much, I am currently dismantling one of my old laptops and will salvage the heat sink from it, and a fan I assume I would connect the wire to a 5 v source on the board, can you please explain to me why there is a switch on the motor controller that flips between 5 v and 3.5 v.
Is my assumption correct on this, if the board is supplied with 12 v, motor is using 2.8 v and lets say that a small computer fan uses and I am just guessing here 2 v, is it correct to assume that there is still 12-2.8-2=7.2v left over to power lets say another motor or an LCD screen.
The 5V / 3.3V switch is so you can match the voltage of the logic signals between the controller (your Arduino) and the stepper board. You're using it with an Uno so it should be set at 5V. Some of the Arduino clone boards sold by Iteadstudio, the maker of this stepper driver board, are switchable between 5V and 3.3V logic signals hence they probably added it to stay compatible with their own products.
Thank you I am learning so much, now what do you think about my assumptions in my previous question.
Your assumptions are not correct. Generally a peripheral device like a motor or fan will run at a voltage different than the "logic" voltage. In your case, you're supplying four 1.5V batteries to power the Uno, which it converts to 5V to run both boards' logic signals, and then you're supplying a second four-battery pack to power the motor which then runs on the full 6V. If you were to run a fan it would be connected in parallel with either the board or motor's battery pack and then be switched using a transistor. Wired in parallel both the motor and fan would still be seeing 6V.
Chagrin:
With your previous program you were toggling the MS1 and MS2 pins (which set the microstepping) along with your STEP and DIR pins. Apparently that rapid toggling of those pins causes the chip to overheat. Otherwise, the heat should be controllable by adjusting the trimmer to a lower current setting.The chip has overheat protection and should shut off at 165oC, btw. Not that you want to push it.
I was just wondering what you meant by when you said that the heat should be controllable by adjusting the trimmer to a lower current setting.
Adjusting the blue potentiometers on the board by turning them counterclockwise (I believe - that might be backwards) should reduce the current supplied to the motors and the chip should also run cooler.
I have done how you instructed me but it doesn't feel like it makes any difference, however I have devised a small heat sink so it's all good in that regard, I have tried using the Accelstepper library but my problem is that no matter what code I try to run I get an error message saying 'AF_Stepper' does not name a type and pretty much on code available there it is saying the same thing, it is probably me, the only thing that I would like it to do for now it just bloody spin forward at 30 rpm.
// AFMotor_ConstantSpeed.pde
// -*- mode: C++ -*-
//
// Shows how to run AccelStepper in the simplest,
// fixed speed mode with no accelerations
// Requires the AFMotor library (https://github.com/adafruit/Adafruit-Motor-Shield-library)
#include <AccelStepper.h>
#include <AFMotor.h>
AF_Stepper motor1(200, 1);
// you can change these to DOUBLE or INTERLEAVE or MICROSTEP!
void forwardstep() {
motor1.onestep(FORWARD, SINGLE);
}
void backwardstep() {
motor1.onestep(BACKWARD, SINGLE);
}
AccelStepper stepper(forwardstep, backwardstep); // use functions to step
void setup()
{
Serial.begin(9600); // set up Serial library at 9600 bps
Serial.println("Stepper test!");
stepper.setSpeed(50);
}
void loop()
{
stepper.runSpeed();
}
MrACP1911:
my problem is that no matter what code I try to run I get an error message saying 'AF_Stepper' does not name a type
The class 'AF_Stepper' is not a standard class included by the IDE so it must be defined by an external library. You have included AccelStepper.h and AFMotor.h and I would expect to find the AF_Stepper class defined in one or other of those.
Locate the Arduino directory where your sketches are stored. Locate the libraries directory under there. It should contain a directory named AccelStepper containing AccelStepper.h (and some other files) and a directory named AFMotor containing AFMotor.h (and some other files). Check that both .h files are present and that one of them contains the declaration for the AF_Stepper class.
I was able to locate both of those files however I am unsure what to do with them, do I just copy it into the original code or do I just copy and paste a certain part, please explain as you are dealing with a complete novice here.

