Motor driver L293D not working properly

My L293d motor driver is not working properley due to some isue if i am writing a code for the motors to move forward they. are moving forward but with an ir sensor connected and the code for if ir sensor detects an object then both the wheels should move but it is only able to move one motor at a time is it an issue with the battery or driver module.
i am not able to post the code.

Imagine yourself in the shoes of forum members. How can we possibly help you without knowledge of your circuit and your code? We do not have psychic powers.

2 Likes

Do you mean that someone has forbidden you to post your code, or that you are unable to understand how to post your code?

1 Like

So, did you test the IR sensor with separate code, so you know it works? Since one motor works, what is different in your code for the second motor?

You say one motor runs then the other motor runs. What changes between the times? Have you measured the voltage of the battery while doing the test? What results do you get?

Likely a power issue, but first hand draw where all the wires start and end, label them, then take a picture. BEFORE you post the picture, look at it and make sure a stranger can read it, then post it.
Also post all your code using the following

Sounds like you have only enough power for one motor. Show the details of your project, including the sketch. (use the <code> button to paste your code when directed).

1 Like

Can you post an annotated schematic showing exactly how you assembled this project. Be sure to show all connections, and power sources. Post a link to the motor's technical information.

yes the ir sensor works but if the code is for both the motors to move forward without any input of the ir sensor the motors are moving forward but when i connect an ir sensor than only one motor is able to move forward.

sorry

here is the connection diagram

for motor driver i am using arduino 5v and gnd

You cannot power motors through the Arduino. It cannot provide enough current. You must use a separate power supply for your motors.

2 Likes

@PaulRB i gave the ir snsor pwer from a 5 v battery pack and the motor driver power from the arduino it is working

It's your Arduino. Good luck with that.

here is the final connection diagrm