Hello all I have worked on Arduino a lot but I just got a new kind of stepper motor that looks very fancy from amazon they look high quality. I found a simple tutorial on the internet about getting them spinning. I compiled it.
// Arduino stepper motor control code
#include <Stepper.h> // Include the header file
// change this to the number of steps on your motor
#define STEPS 32
// create an instance of the stepper class using the steps and pins
Stepper stepper(STEPS, 8, 10, 9, 11);
int val = 0;
void setup() {
Serial.begin(9600);
stepper.setSpeed(200);
}
void loop() {
if (Serial.available()>0)
{
val = Serial.parseInt();
stepper.step(val);
Serial.println(val); //for debugging
}
}
the little circtui board with the four leds is connected to arduinos gnd and 5 volt but i see no indication of it being on. Why is this am i missing something i tried another of my arduino boards and it was the same. Are they defective? thanks
Hi, is anything being printed with the Serial.println(val) command. There is a chance you are seeing nothing because to happens too fast so LEDs might never seem on. if the Serial.print does nothing means its never getting that far; if it does, might mean what I said above.
You need to supply 5V at more amps than Arduino can supply to the 5V & -ve jumpers on the controller. The wiring on circuitdigest.com will more than likely let the magic smoke out of your UNO. (voice of experience)
Sorry to disabuse you but these are nothing fancy or new, they are fairly standard car air-con actuator motors which have the advantage of being cheap geared stepper motors for light duties.
I agree its not great to try and power these from the 5V logic supply, but they ought to work as they are about 100mA per coil I think - i.e. 50 ohm windings. The ULN2003 driving them has built-in free-wheel diodes to protect from inductive kickback, so shouldn't be too uncivilized to the 5V rail, but as I said its not the ideal. The ULN2003 drops a volt or too so powering it from 6V supply maybe worthwhile, such as 4 AA cells.
When using a stepper for the first time don't overdo the step-rate - motors don't accerlate instantly to their top speed, so try around 10 steps a second in the first instance.
For best performance speed-ramping is usually needed, and the Stepper library doesn't support this - try the AccelStepper library maybe?
blink each output pin a few times, and verify that the correesponding LED the driver board blinks. Aldo make sure the jumper is connected where you connect your power and ground - without that jumper, the board won't work.