Go Down

Topic: unipolar motor problem (Read 420 times) previous topic - next topic


My six wire unipolar motor vibrates, but does not respond, not matter which sketch is uploaded.  I have switched wires and played with the sketch pin numbers in every way imaginable.  Is this a software problem? I am using a 5v mini pro board powered by an 8 amp, 7 volt supply. 

Code: [Select]

#include <Stepper.h>

#define STEPS1 200
#define STOP 0

Stepper stepper1(STEPS1, 6,7,8,9);//bipolar

int sonarPin = A0;
int sonarVal =0;

void setup()
void loop()
  sonarVal = analogRead (sonarPin);
    if (sonarVal < 900)
      stepper1.step(STOP);  ////not responding to analog input
    if (sonarVal > 900)


You don't tell us what motor, what voltage or current, what the winding resistance is, nor
how you have wired up your circuit.  We have no useful information yet...

However the big clue seems to be that you don't mention a motor driver - are you trying to
drive a stepper motor direct from Arduino pins?  If so you may already have fried your Arduino,
there is _no way_ the Arduino can power a motor like this by itself.

Two reasons:  Arduino _absolute maximum_ output current 40mA.  Typical motor current: 300 to 2000mA

Also motors are inductive loads - inductive loads destroy semiconductors unless flyback diodes are
present in the right places to prevent inductive high-voltage spikes.

Also if you are trying to use the 5V rail from the Mini Pro as power source you cannot draw large current
since the on-board regular is tiny.  100 to 200mA is probably the limit.

In general powering motors from a separate supply to its control electronics is a wise choice.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up