I cant drive my dc motor with arduino and L293D IC

I cant drive my dc motor with arduino and L293D IC , it is connected to 5V 1A powersupply,i tried to build the circuit multiple times but couldn't find the bug, please help.The IC is getting hot so i think the power supply is ok. So i think there is some problem with my code or my circuit


int speedPin=5;
int dir1=4;
int dir2=3;
int mSpeed=90;

void setup() {
  // put your setup code here, to run once:
pinMode(speedPin,OUTPUT);
pinMode(dir1,OUTPUT);
pinMode(dir2,OUTPUT);
Serial.begin(9600);

}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(dir1,LOW);
digitalWrite(dir2,HIGH);
analogWrite(speedPin,255);
delay(25);
analogWrite(speedPin,mSpeed);
delay(5000);
}

Please post a link to its datasheet.

That's a very old, stone age, power wasting driver creating heat. Modern MOSFET based wastes a lot less energy.

1 Amp supply might be too little. It depends on the motor.

Please post schematics.

Please read and use this link: How to get the best out of this forum - Using Arduino / IDE 1.x - Arduino Forum

Link to the datasheet for l293d

The photos of the breadboard are, at best, difficult to decipher. A schematic or circuit diagram of how your circuit is wired would be much more useful.

Images of code are nearly worthless. Please read the forum guidelines to see how to properly post code and some information on making a good post.

Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in a code block.

What are the specifications of the motor (rated voltage, stall current)? Do you have a data sheet for the motor.

Unfortunately, i do not have the datasheet of DC motor
It is a normal toy motor with specs

  1. Operating Voltage Range: 3 to 6VDC
  2. Maximum RPM: 10000
  3. Shaft Diameter: 2 mm
  4. Weight: 15 gm per motor

You are missing the connection from pin 16 (Vcc1) of the L293 to the Uno 5V.

Actually the (Vcc1 ) is connected to the external power supply(5v 1A)
i was not able to mention it in the diagram

In the photograph of your breadboard, there is nothing connected to pin 16.

I see. So that was a waste of my time?

Please add the power supply connection to your diagram.

I was following this video from Paul McWhorter in which he uses the L293D IC
i can use the whole driver setup which i also have but the thing is that other lectures also use this method

Hi, @demondawg
Welcome to the forum.

I think that this means the IC could be cooked.

It should only get warm when driving the motor.

Do you have a DMM? (Digital MultiMeter)

To add code please click this link;

Thanks.. Tom.. :grinning: :+1: :coffee: :australia:
PS. Did you go to the YouTube linked site to get the schematic?
https://toptechboy.com/arduino-tutorial-37-understanding-how-to-control-dc-motors-in-projects/

yes

This Schematic is used in the tutorial

I'll keep that in mind next time
and i have posted the code in the original post

The "schematic" you show does not match the picture you posted (I think you have the IC pins mixed up). Here is a drawing from the internet showing the pin names.
L293D-pinout

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.