What Happened
I'm working on a project to run two peristaltic pumps from an Uno. The previous version used DC motors and L298N's, but I am attempting to upgrade it by using stepper motors and A4988's. I haven't used these motor controllers before, so was using a solderless breadboard while following some basic tutorials and was able to get one functioning how I want. During this, the Arduino was being powered through the barrel jack with a 12V/3A source; VMOT was connected to Vin; and VDD to the 5V pin. I checked the pins with a multimeter, and the voltages were all as expected, and the current limiters were set to 1A. The pump was able to run for a while with no issues.
After that, I drew up a diagram for how to lay it out on a smaller breadboard and soldered everything together.
Once that was done, I disconnected the motors and once again checked the voltages on each pin to make sure I didn't miss soldering a connection. When doing that, one lead of the multimeter might have caused a short (smell) and I quickly unplugged the barrel jack, but saw some smoke come from the arduino just after it was unplugged.
The Question
I know that a lot of people/examples (like this and this) recommend putting a 100 uF capacitor across VMOT and GND of the A4988's as close as possible to the inputs, to smooth out voltage spikes. However, those all use a separate power supply than what is used to power the Arduino. Before I just replace the burnt out board (I have some Nanos and a Mega lying around that could also do the trick, with some rewiring or an external voltage regulator), I want to eliminate the possibility that the way I'm powering everything is the cause of the burn out, so I don't just immediately ruin another board. Is it bad practice to use the onboard voltage regulator this way? By using Vin to run the motors and 5V to control the logic?
How or Why?
(All this after is extra, and really a secondary question/curiosity)
And is there a way to salvage the board, or figure out exactly what went wrong? The board can still be powered by USB or barrel jack, but the COM port doesn't show up when connected to my laptop to upload a new sketch. I was working through this answer to try and figure out what actually burnt out.
- With both USB and barrel jack power (12V/0.5A) the "on" LED lights up, and Vin/3V3 read correctly on a multimeter. 5V read correctly on USB power, but when on barrel jack power its actually outputting about 9V. However, for both methods of powering the board, the voltage regulator itself has a 5V difference. From this point on, I just used the USB for power while troubleshooting.
- The power-on LED does not flash when initially connected or the reset button is pressed, and TX/RX do not light up at all. That question indicates this could be bootloader problems or a damaged main processor chip.
- Using a Mega 2560 board to try and burn the bootloader to the Uno, the "Burn Bootloader" process fails with the error message:
avrdude: Device signature = 0x000000 avrdude: Yikes! Invalid device signature. Double check connections and try again, or use -F to override this check.
avrdude done. Thank you.
Failed chip erase: uploading error: exit status 1
- Device signature 0x000000 seems to be a default message that indicates the board is not actually connected, which makes sense seeing as my computer wasn't able to identify that it was plugged in with the USB.
- This leaves it at a possibly damaged Atmega328P. If I had another Uno, I would try swapping out those chips from the good and bad board to see if it fixes the issue, and if so I would just get a new Atmega instead of trashing the whole board.
But I've spent more time than its worth now trying to salvage the board, hence the main question asked previously. To rephrase that: do I need to use an external voltage regulator secondary power supply to provide 5V to the Arduino while giving 12V to the A4988's, or is it fine to give 12V to the board and run Vin to the motor controllers?
