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);
}
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.
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
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.