i am cuurently doing a project on making a line follower using l293d ic and arduino.here's the problem. i connected the two enable pins to pwm pins in arduino and uiploaded th code to drive both motors forward. But even without connecting power for motor to ic , the motors start turning. i dont know why this happens .but when i remove the enable pins it runs on the power(9v) for motor and i am not able to control speed.I WANT TO RUN THE MOTORS ON SEPARATE POWER(9V) other than the enable but still be able to control their speeds.please help me out... I have used a nine volt 6f22 battery(its written on it :'for transistor radios') i used another one to power the arduino. motors used are rated 12 volts. connections are standard using l293d ic.all grounds of ic and external power are shorted together with ground from arduino.enables are connected to pwm pins on arduino and inputs are connected to digital pins.hope this helps to clarify my doubt.
Post your circuit diagram and your code and detail of the motors. There's no point us trying to guess what you have done.
Another point for you to consider.
You used 2 terms together that often disappoint - ‘motor’ and ‘9V’
You might be using an adequate power supply but let’s check.
When you say ‘9V’, do you mean a smoke detector battery? If so, you should know that they are completely inadequate for running motors or any other application that draws that much current.
The voltage will sag when you run the motor and things will not work as you expect.
However, if you are talking about 6 AA batteries to provide 9V, then you are in better shape.
Of course, this advice isgiven without knowing anything about your motor current requirements, since you did not provide a link to the motor specs, but the smoke detector battery is always the wrong choice for motors.
Oh, and don't cross-post forum.arduino.cc/index.php?topic=514149
I have used a nine volt 6f22 battery(its written on it :'for transistor radios')
But it does not say "for high current drain devices such as motors"...