Hi, this is my first post here so please bear with me. I have a Arduino Uno R3, and I am controlling a stepper motor using the A4988 driver.
I am using a 12V AC-DC converter, and stepping-down the voltage to 5V to power the Arduino and logic electronics. The 12V I use to power the motor.
Everything works fine as long as I don't have the Arduino plugged-in to the PC via USB. (I'd like to keep it plugged-in while I work on the code). When connected to the PC, there are weird glitches that happen. The motor gives up halfway through it's movement, it twitches if left ENABLED, the encoder stops being read properly, the driver heats up rapidly, etc.
I wonder if there's something obvious I don't understand about power and the Arduino. Please could someone help de-mystify this for me? I have attached a Fritzing wire schematic to make my problem as clear as possible.
UNO Vin need to be between 7V and 12V it won't work with 5V
The input connections to the DC-DC are backwards.
The power connections on your LCD are shorted.
The GND pin of the A4988 is not connected to GND.
This set-up could not have worked!
There are probably more errors but I stopped at 4
Maybe you should take some time and provide a wiring diagram that shows exactly how you have things connected
Hi Jim, thank you for taking some time to consider my question.
Thanks for pointing this out. Strangely, my setup works when I supply 5V from the Buck to the Vin pin on the Arduino. After reading your comment, I tried supplying the 5V from the Buck to the 5V pin instead, and I had the same problems as when I connect the USB cable.
The picture of the buck converter has two "+IN" instead of a "+IN" and a "-IN". I know the DC-DC converter works as intended because I measured the voltage of the 5V line using a multimeter. Good on you for noticing, though!
I apologize for the small oversight on the diagram. In reality the black wire connects the GND pin of the LCD to the ground of the 5V line. As I stated before: the entire set up works as intended (that includes the LCD) so long as I do not plug in my Arduino to the PC.
In the picture I attached, it shows that the Logic GND of the stepper motor driver is connected to ground on the 5 V rail, and that the motor GND is connected to the ground of the 12V rail through a 100uF capacitor.
As I stated before: the entire set-up works as intended so long as I do not plug in my Arduino to the PC.
The more I think about it, the more I wonder if my Arduino is defective and can't use the 5V correctly from either the usb plug or through my DC-DC buck converter to the 5V pin. Do you know if this is something that can occur?
Thank you once again for taking a look at my problem. I would appreciate it if you would continue to provide constructive criticism of my work which may help me resolve the issue.
Then something is wrong with the board, it should not work with 5V connected to Vin.
Do you have a voltmeter or DMM you can use to test voltages?
I have a multimeter. I used it to confirm that my DC-DC step-down buck converter was supplying 5 V DC.
We want to check if the 5V regulator is shorted.
Disconnect everything from your UNO so we don't accidentally short something.
Set your meter to read resistance and set it to the scale just above the lowest, might be 2K ohm scale
Connect the red to Vin and the black to 5V.
You should not get a reading
Thank you. I am not at home right now, but as soon as I get a chance I will try what you suggested and report back.
No hurry
I disconnected everything from the Arduino. I selected the "2000 ohm" on the multimeter and connected red lead to Vin and the black to 5V. I got a reading of 1016 ohm. Does this mean it's shorted?
After that result I wired-up my second Arduino board, and used the 5V pin to give it power from the step-down converter. It worked flawlessly! And it does not glitch-out when connected to the PC.
So in the end it looks like it was my board that had a defect. It is also possible that I inadvertently shorted something on it and failed to notice.
It may be a lost cause for my board, but at least my project is saved! Thank you Jim for all your help. I will keep at it and keep learning!
That is not good, I suspect you burned out the 5V regulator.
used the 5V pin to give it power
You do realize that is a 5V output and not an input.
That is a silly and pointless thing to do. It also could cause damage. Any resistance measurement on a powered up circuit is meaningless.
A resistance meter passes as small voltage through the leads and measures the current. This voltage can easily be upset by the power running in the system.
Also a resistance measurement on a unpowered chip is only going to be rendered meaningless due to the shorting effect you get from the static protection diodes, so it will just look like you are measuring a diode.
Yes, now that I've tested the setup again using another Arduino board and found no errors, I am pretty confident in that assessment. I probably would still be confused if not for your guidance, so I am very grateful.
As I understand, it can go both ways:
powering arduino

I am regulating the 5V using my DC-DC buck converter, so it should be fine.
Hi Mike, I suppose I could have been clearer when I said I disconnected everything from my Arduino. That also included the power cables. The board was not powered when I performed the diagnostic resistance measurement.
If that is true, then the reason for the problems may still be a mystery. Nonetheless, it has become clear to me that there is something wrong with my Arduino board. I have re-wired everything the same way using a new board and everything works as intended.
Thanks for your warning, Mike. I'll be careful to do my research before using my multi-meter on the board in the future.
From the official Arduino UNO product page.
"5V.This pin outputs a regulated 5V from the regulator on the board. The board can be supplied with power either from the DC power jack (7 - 12V), the USB connector (5V), or the VIN pin of the board (7-12V). Supplying voltage via the 5V or 3.3V pins bypasses the regulator, and can damage your board. We don't advise it."
Some people do it, no problem, others have damaged the board
You already damaged one board.
That is a good point. Then perhaps it would be better for me to use a second LM2596 DC-DC Buck step-down converter just for powering the Arduino. I would set it to output 9V to the Vin pin. Since you know much more than I do, could you please tell me if that is sensible or if you can think of an even better way? I'd like to avoid having two power sources. My AC-DC converter should be able to supply all the power I need on its own.
You can do this:
The two diodes will drop the 12 V to about 10.5V puting less stress on the UNO 5V regulator.
That is nice, I would not have thought to use diodes to reduce the voltage. Thanks!
I am a little uncertain about the grounding. So far the ground of the 12V line and the 5V line have been separated by the DC-DC converter, but using diodes I'll have to connect the arduino GND to the 12V line, right? See picture below:
Sorry if that's a newbie question, I really am trying hard to learn and understand what I am doing.
Also, could you please let me know what software you used to make your wire diagram?
Not really. The IN- and the OUT- on the BUCK are connected together, so the 12 ground and 5V ground are actually connected.
However you should not rely on that as being a good ground connection and instead connect the UNO GND directly to the 12V ground just like you did. Very good!
Ohhh ok, I think I understand a bit more now. Thanks again for all your help, Jim. you're the best!


