I have been trying to do basic speed control of a motor using PWM. So far I was able to use the sweep function to output a changing PWM signal to a speed controller and got the motor to speed up and slow down properly. The problem I am having came when I took the Arduino Uno off the shield and tried to run it straight off a breadboard. I connected both ground pins, the Vcc's and the timing crystal to the correct pins. At this point I was able to probe the PWM output with an oscilloscope and see that it was still working correctly.
BUT when I connect that PWM pin to any other device the signal stops immediately and goes straight to ground. I tried using an optocoupler to isolate that signal from the rest of the circuit but the same thing happens. As soon as the PWM pin gets connected to the optocoupler input the signal drops to ground and stays there. If I undo the connection and reset the arduino the signal comes back.
The only way to get the arduino to maintain the expected PWM output is to hook it up to its own power supply that nothing else is running off of. This works okay in the lab but is not practical for a self contained device.
I can't seem to figure out why the arduino stops the signal if anything else is connected. I have checked to make sure there aren't any other shorts or connections that could be supplying excessive current or anything. Is there some sort of fail-safe in the arduino that stops that output if it detects a current spike or something?
Any help or advice on how to proceed is greatly appreciated. If you need me to supply more information on my circuit just ask. *There are more specifics about the code and circuit in my next post.