Let's Make Robots!

L293D/SN754410 on Arduino

I have a handful of these chips and have never been able to consistently drive a decent 6v motor off of one using the Arduino as a controller.  Can anyone point me to a known working circuit (preferrably with PWM speed control but not necessarily) either as a scematic or Fritzed (or I suppose a good photograph.)  I'd love to be able to make a custom shield instead of dumping more money into R3 or the ladyada versions that the HongKong knockoff shops are selling.  (Chris the Carpenter, I'm kind of hoping you have something here...)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

I think you should also check how much current your "Decent 6V" motor draws. L293D IC's are not designed to drive "Decent" motors.

I hope this isn't just another case of the old inadequate power supply problem again. If your batteries aren't up to it then it will not run "consistently".

The whine from the motor. Is this happening when you apply pwm? perhaps the frequency is higher than the driver can handle. The max on the L293D is 5 khz.

Diodes aren't needed for the L293D and I think the argument is still ongoing whether you should use them with the SN754410.

It would probably help if you attached the sketch you are using and a clear picture of your connections.

 

Four schottky diodes for each motor.  Two connected to each output pin, across the power supply with the output pin between the diodes.

Like this.

Yeah, I came across that early on.  Thanks!  (BTW, what the hell did that guy do to his breadboard?  I've had a few sockets melt but wow-that cap must have a little fission reactor in it.)

Another thing about 293's and driver boards based on them.

the L293 is a relatively low current device.  Only .6a per channel as I recall.  You may have to piggyback a couple to get enough current to drive your motors.

An easy way to tell--Do they start out OK, and then you start having trouble?  (Carefully)  Touch them.  Are they hot?  They're being over driven.

The 754410's can handle more current but lack built in protection diodes that the L293's have.

Thanks DWR. I read that on ladyada, but She doesn't go into detail. I think the 293 I'm using is a D, but TI's block diagram is confusing. How should external diodes(assuming I need them on my motors) be configured into the 754410 circuit? One each between the motor Vcc and ground at each H bridge out line?

I have never used external diodes with the SN754410NE chips that I have. Never burned one. But I'm not saying that it can't happen. Still, for most hobby motors that draw under 1A you don't need diodes. I've seen people stack a few chips for more amps with no external diodes and nothing bad happened. 

Firsr, thanks Birdmun. I know, it's very strange, Chris. The circuit I use is very similar to Birdmun's but Instead of inverters Each input pin gets its own Arduino digital pin. I usually write a sketch that either alternates the outputs high/low on a delay or on the throw of a switch with a pull down on one of the remaining digital pins. I have a 6v test motor with breadboard pins on it for the test. It usually works as planned for about 10-20 high/low cycles then stops. I can hear a whine in the motor that changes with the high/low cycles but there is no movement in the motor. The motor still works with Vcc applied directly, but the chip seems to stop working for a day, and only works again if I pull everything off the board and start over. I've never seen anything like it. That's only with the 293-I've never even gotten the 754410 to make the motor whine. Incidentally, would a 74hc14 work in place of the cd4069 in the Circuit Birdmun posted? Thanks for the application of your experience to my problem, guys. (The main reason I want to build my own shield is to determine which pins control what for shield coordination.)

Could you post your code and a diagram of how you have the circuit set up? It sounds like you are trying to write your own PWM, rather than using analogWrite on the Arduino. That means your issue could be code related. 

However, providing both code and defining how everything is connected will really help.

Many had problems when using breadboards. Try to wire things directly. Use a socket for the L293 on a protoboard and solder all wires, for the motor you can use a screw connector. If the behaviour is the same, I'd say the motor draws more than the current limit of the L293 so the chip goes into thermal protection, which does not happen with the SN754410 because of the higher current limit.