Using a 12V lead acid battery as the external power.
Everything works fine when the motor is off, but whenever I run the motor up to about 25% power, the serial monitor freezes and I get a USB device malfunctioned error on my computer. This also kills my mouse, and if I try to do any more communication I get an error telling me COM3 port already in use. Strangely, serial communication is the only thing to malfunction, I'm testing the setup by cycling the motor through periods of 0-100% power and the motor continues to work even after communication cuts off.
I've tried attaching a 9V battery to the arduino power input, as well as using a different computer without any luck. Any advice?
I attached a 0.1uF capacitor across the motor and a 470uF capacitor on the arduino power rails, and I can now make it to about 60% power before losing communication. So I guess the solution is a bigger capacitor.
tyrantbb:
I attached a 0.1uF capacitor across the motor and a 470uF capacitor on the arduino power rails, and I can now make it to about 60% power before losing communication. So I guess the solution is a bigger capacitor.
If it is really wired according to your diagram I can't see how anything on the Arduino could be overloaded.
From your experience with the capacitors the motor seems to be causing interference. Is your diode working properly?
Does it make any difference if you move the motor relative to the Arduino? If you could put an equivalent resistive load in place of the motor (perhaps a suitable bulb) it might help to prove that.