Control two DC motors without frying my board again. Advice required.

Hello,

I fried my first Uno yesterday. Going to buy a new one but was hoping someone could give me advice on my circuit so I don’t fry the next one.

I constructed my circuit basically the same as in the attached image.The only extra inclusions were that I also had the USB power cable in and I had an IR reciever connected, Vs to +5v rail, G to ground and signal to an input pin.

I used an L293D IC h-bridge and two * 457-re360 6-15v DC motors, my external supply was first 6v, working great using PWM to control speed in forward and reverse, and then swapped for 15v (fried arduino with 15v supply after a few short uses).

I can take a coulple of guesses at what might have happened but I would be lying if I said I was sure what happened. After a bit of research (after the fact) I see that the bridge was under rated for the motors. And also that the motors starting and stall currents were a lot higher than I realised.

What I am looking for is a best guess on what went wrong and if possible a diagram and maybe a parts suggestion for safely powering these two motors and guarding against similar problems.

Thanks

I’m confused as to why the Arduino got fried I must say. When you say though that you had 15V connected, was that only to pin 8 on the L293 as the motor’s supply?

That circuit looks good to me: 5V to L293 pin 16 for its logic, and 12V to its pin 8 for the motors. Motor outs are the ones above and below the grounds, and the other 3 pins on each side for motor control.

If the motor was drawing too much current for the L293 it should have fried the L293, not the Arduino.

But let’s see your ACTUAL circuit, with your connections including the IR sensor, and also your code?

Here’s OP’s pic:

f226041a62043ea6b249a99c3f32b362acb036aa.jpg

Thanks for the quick reply Manor.

The IC was getting hot every time I used it. I have a feeling it may have fried that first and created a short back to arduino? But that is just a guess.

I took the circuit apart hoping in vain that the arduino might be okay without it. But I will put it back together the way I had it and post a picture (I realise that is not ideal but best I can do).

Sorry I can't post the code. I had a bad day yesterday as my Windows also crashed and I had to restore back to a point before I created the program... The folder directory is there but it is empty. I know how that sounds... I can say I made sure to guard against having the forward and reverse pins activated at the same time for each motor. And that the code was working fine up until, well, disaster.

I see that the motor stall current is 3x that which an L293D can handle, so not surprising it was running hot. But I don't have the knowledge to say if that current could in turn have "got back" to the Arduino somehow.

So I set it back up and took a couple of photos and tried to post them but they are both over the attachment size restriction even when zipped :confused: .

But judging by what you are saying, if I had a correctly rated bridge and assuming it was wired correctly (which I think it was), there should not have been any way for the arduino to fry.

Well I'd be surprised if the fault got back through the L293, but I don't really have the knowledge to say how the overload on the chip might have got back to the Arduino.

Rather than a photo of the rig which may be tricky to folow, why not hand draw the circuit and try upload a pic of that?

Yeah I can try a drawing… (not sure how good it will be but ha ha). Don’t know what fancy tool was used to create the diargam I attached in the original post so it will have to by hand drawn.

So I considered not attaching this as it is so bad ha ha.

Same issue with hand drawing so I just did it in MS paint (first and last time I will try that).

IC Connections

pin 1 to +5v
pin 2 to arduino pin 6
pin 3 to motor1
pin 4 to ground
pin 5 to ground
pin 6 to motor 1
pin 7 to arduino pin 5
pin 8 to +15v

pin 9 to +5v
pin 10 to arduino pin 9
pin 11 to motor2
pin 12 to ground
pin 13 to ground
pin 14 to motor2
pin 15 arduino pin 10
pin 16 to +5v

IR connections

Ground to ground
Vs to +5V
Singal to arduino pin 3

OP’s pic:

cfe61c371bd9d954f798d56da971c868f3162a37.png

Yeah you’d be better off with Crayola :wink: but that pic and the description do seem ok to me.

So you’ll need to wait and see if anyone else has any ideas.

Ha ha yeah.

Cheers for looking.

Judging by what you said, it doesn't seem like I was missing any safety devices (diodes or pull down resistors etc that should have been in there) and it should have been okay if the components were rated correctly.

Lesson learned at least.

Hopefully someone will still read this…

So I am thinking of getting a couple of these modules: https://m.aliexpress.com/item/32777561981.html

I can only see a little info about them but there is a truth table. Basically it says that there are 4 signal input pins, two for forward and 2 for reverse (attached a copy).
The question is, why do both input pins (for forward or reverse) need PWM and not just one signal the one pwm.

Cheers.

scottbnoob: The question is, why do both input pins (for forward or reverse) need PWM and not just one signal the one pwm.

Perhaps they mean you can PWM either, not both, whichever is more convenient, since breaking either S1 or S4, or S2 or S3 will break the circuit and breaking 2 switches in series won't break it any better.

Yeah hopefully you are right. I will be short on pins if not, I noticed that I can't even use one of the pwm pins while using IR (pin 11 I think), even just declaring in pinmode sends the readings all over the place :) . Anyway nothing to do now but to wait for them (and my new board ha) to arrive