Stepper motor stopped responding when it used to work fine

Hello Everyone,

I am a bit confused. Currently, I am working on a project that uses Arduino Uno, an EasyDriver, and a stepper motor. The stepper motor is attached to a metal plate that will cover a camera lens at certain times.

When I would first run the code, the stepper motor would turn just fine, as it was supposed to. A few days later it seemed to be fighting to rotate and now, it doesn't seem to respond at all. I did change the code a bit so in order to make sure it wasn't an issue with the code I ran other people's test codes for stepper motors controlled by an Arduino. Still nothing happened/I got no response from the stepper motor.

Is it normal for a stepper motor to just go bad? I know it's wired correctly because, like I said, it worked before and I have not touched the circuitry. Any suggestions would be greatly appreciated.

Thank you

Which motor? What power supply are you using to the EasyDriver? Have you checked it is adequate for the load? Have you measured its voltage when in use for instance?

Stepper motors have nothing to go wrong - after years of use a bearing might sieze up if you are very unlucky. One loose connection in the motor wiring however and you may fry the EasyDriver though, the motor is highly inductive so you have to ensure solid connections and never unplug it when the driver is powered up (that's a classic way to blow a motor driver)

The motor is a Mercury Motor SM-42BYG011-25 16/2011. Originally when it turned it was only hooked up to the computer via USB and worked fine. Also, I have not measured its voltage while it is in use.

I haven't unplugged it directly while it was powered on, it's a pretty simple set up (not mine originally).

The usual advice. Post your code. And tell us what power supply you are using for the motor (volts and amps).

I have some of those motors. Try this simple stepper code. However the Easydriver defaults to microstepping and my code assumes full steps so you may need to increase the number of steps in the code.

...R Stepper Motor Basics

Thank you for the resources! Code will be posted momentarily.

Alright, plot twist...now I am actually getting the error message "Problem uploading to board avrdude: stk500_recv(): programmer is not responding"

I am not sure why because it seemed to upload fine before (I promise this was working at one point, not perfectly, but it was working).

Probably best for me to sort this issue out first before I try to tackle any hardware issues. :(

I'll be back with the code and everything, thanks.

That's a 12V motor, so you'll need 18V or more to drive it properly from a chopper driver - you haven't said what voltage your power supply for the thing was...

Alright so back on track now.

Let me clarify, when this motor first functioned properly I used no external source (just plugged the Arduino into the computer via USB). All was fine. Then it seemingly began to weaken, after several weeks so I figured it would be good to use an external source. The external source I used has the following specs:

center positive
output:12V dc and 600 mA

After using this power supply, still nothing happened. Could I have made it worse or fried something? Why would it have worked before on just USB power and now seems to be struggling?

Thank you.

P.S. I’ve attached the main code.

sketch_aug12a.ino (13.8 KB)

Robin,

I tried your example code (the corrected version which you posted) and nothing happened when I compiled the code. Is there something I could be missing?

Thank you again for your advice and patience everyone.

babycoder: Let me clarify, when this motor first functioned properly I used no external source (just plugged the Arduino into the computer via USB). All was fine. Then it seemingly began to weaken, after several weeks so I figured it would be good to use an external source. The external source I used has the following specs:

center positive output:12V dc and 600 mA

Before looking at the code I need to clarify this.

It sounds as if you are saying that the Arduino and the motor were powered from the computer USB connection. I find that very hard to believe. It may well have caused damage to the Arduino.

Then it sounds like you disconnected the Arduino from the USB connection and powered the motor and the Arduino with a 12v supply plugged into the Arduino barrel jack.

If neither of these interpretations is correct, please provide a better description of both situations. The best thing, by far, would be to make pencil drawings showing all the connections and post photos of the drawings.

...R

I will post an actual picture and make a drawing shortly! Thank you.

I have attached pictures of the actual set up, drawings still to come. The little grey cord plugs into a Mac mini via USB.

Unfortunately I’m no artist. PLEASE let me know if anything is unclear.

Thank you all again so much.

Are my eyes deceiving me or are your wires just pushed into the holes and not soldered?

They are soldered, underneath the board.

babycoder: Unfortunately I'm no artist.

I don't expect artistry. But your drawings are too cluttered to be able to make sense of them and some of the writing is upside-down.

Don't stack the components in the drawing even if they are stacked in real life.

If the yellow thing is the Easydriver, why is the motor not connected directly to it ?

(By the way I have only looked at the drawings)

...R

Hi there,

Thanks for the advice, I will redraw the components unstacked and post shortly.

I think these attached drawings will be much clearer! Is it possible that I should re-solder? Some connections could have come loose although they don’t seem it. I haven’t changed the wiring from when this actually worked, so I’m not sure my problem lies in the wiring.

Perhaps the issue lies in the code? I’m not sure. Hopefully these drawings give you a better overall picture of what I have going on.

Thanks

Why do I have to have my hard-disk cluttered with 4 versions of the same image?

What is M+ and what is RAW ?

You have not shown where the motor power comes from? What power supply are you using (volts and amps).

...R

Sorry for the confusion/annoyance, I just figured I'd provide a key in case too many things in the drawing got cluttered. Also, I could not get it all in one picture without it being super small, so I took several.

M+ is the power input to the Easy Driver. RAW is like the VIN pin/raw input voltage.

I am using a 12 V, 600 mA power supply. Before, this external power supply seemed unnecessary as everything once functioned properly with only the Arduino Uno connected to the computer via USB.

Thanks :)