i am working on a project to control a small 3 volt toy motor through a piezo. i modeled my circuit off of this: http://luckylarry.co.uk/arduino-projects/arduino-control-a-dc-motor-with-potentiometer-and-multiple-power-supplies/
basically replacing the potentiometer with a piezo sensor that turns the motor to HIGH whenever it is pressed. The code freezes and stops looping when the motor turns on, is this a problem in my code, or the way i have it hooked up?
Basically my circuit works correctly until I hook up a motor to it. The system becomes very unstable the moment I turn the motor on. I will try adding a capacitor to the motor, to protect the system from interference. My code also freezes (the program stops looping completely) and the serial goes unresponsive.