How to power arduino and stepper motor with the same power supply

Hello,
I am currently powering a stepper motor using 12V and a A4988 driver. The arduino is powered by USB but i would like to power it with the same power supply.
To do so, I connected the 12V to the Vin and Ground pin, this works like a charm except one detail:
when I connect the power supply, the driver does not receive any instructions from the Arduino during the fisrt seconds of set up and so my stepper behaves erratically.
What I want to do is have only one power supply and get rid of the this fisrt few seconds of uncontrol.
Thanks in advance, I would appreciate any help :slight_smile:
Axel

I think having a good capacity capacitor across the motor power terminals is a good idea

I thougth of it too, but wouldn't have I the inverse problem when I shut off the system: the capacitor would discharge itself in the motor with the driver not powered

what about the step frequency , what are you using currently.

The A4988 also outputs a 5v to supply the microcontroller , can u try powering the arduino with the 5v from the motor driver board

with the input signal cut off from the MC the stepper motor should not rotate even when connected to a capacitor.

I control my stepper with 1/16 steps, and a delay of 300 microseconds between each. However this is true only when the A4988 is able to control the stepper, which is not the case in the fisrt seconds of powering.

Are you sure the A4988 is able to output 5V? I'd rather think it drains 5V, from the Arduino in my case. Even if it outputs 5V, this would not resolve my problem as the arduino will boot after power is supplied to the A4988

Cutting off the input signal with the enable or sleep pin could be a solution, however I need to control the state of the pin, which I'll do with the Arduino, which would take time to boot, and the problem does not seem resolved

However I thank you and appreciate your help. If I have misunderstood something, feel free to tell me what :slight_smile:

How is this all wired up?
Are you using pins 0, 1 or 13 to do anything? These get changed during the boot up process so it is best to avoid them.

When an Arduino is reset all the pins are set as inputs, before your setup function is run. So the way to avoid having that send out spurious outputs due to interference pickup is to fit a 10K pull down resistor to any pins going to the A4988.

Try those suggestions before worrying about anything else. But don't forget the schematic showing where all the power is going.

The A4988 does not output 5V, it needs feeding with 5V.

So does that mean this board will require 2 power inputs one for the motor and one for the board

No, but the inbuilt regulator on the Arduino's Vin pin has a limited current capacity so whether that is sufficient to drive both the A4988 depends on what else you are expecting it to drive.

Thanks for the idea, I'll look into pull down resistors !

I add that I already fried the regulator of an arduino and a driver with this setup, without particularly knowing why ... maybe a short circuit or something else

You should not have, because the logic circuits of the A4988 only require 8mA, according to the data sheet. But that is for the chip A4988.

It looks like you have a board that contains an A4988 and is not just the chip, have you a link to the board you bought?

It is unlikely that you made a short circuit that blew up both the driver and the Arduino. You weren't making connections when it was powered up were you?

If I must take a guess, I would say that I inverted the polarity, but I searched for it and couldn't find it, maybe I got lost in the mess with all the cables.
Also I wasn't making connection. I just powered up the board and saw smoke coming out of the regulator, then the A4988 would not respond to another Arduino...

I bought the board from ebay, but I think it is the standard one from pololu website

Well you never know, maybe the circuit is the same but it is likely that the components might not be. For example the voltage rating on the capacitors might not be as high on the cheaper board.

So, few weeks later I've found a solution : i got rid of the A4988 driver and replaced it with a tmc2208. The pinout is almost the same, no big modifications involved.
The difference between the two of them is you need to send a LOW signal to the tmc2208 to get it to run, so without any instruction from the arduino, the driver is disabled by default.
Moreover, you get to drive your motor with extreme silence !

ps: a transistor maybe could have done the trick (didn't test it)

In fact a 10K pull down resistor would have done the trick. At almost zero extra cost.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.