ASK AN EDUCATOR! – “How can I control a solenoid or motor with an H-Bridge?”

Garrett asks:

how do i send/control the L293DNE motor driver to power a SOLENOID or just a dc motor

This is a really good question, and quite a popular topic. The L293D or DNE, depending on the manufacturer, is a Quadruple Half H-Driver or H-Bridge IC that allows for the control of high current loads from a low current source. The advantage of this chip over just using a transistor or MOSFET is in the fact that you can control the polarity of your motor when used as a full H-Driver.

If you are looking to just control a solenoid, I would recommend using a transistor. Specifically one that can handle the relatively high current loads like a TIP120 or equiv. This transistor with a base resistor will be able to drive ~1A from just about any microcontroller. This can also be used to drive your motor and I actually ran a post earlier which gives a much more in depth overview.

Regarding your L293D, below is a circuit diagram that illustrates 3 possible configurations for driving a motor. The one the left shows the IC being used as a full H-Bridge. The pins are configured as follows:

  • Pin 1 (1/2 Enable) – Channel 1/2 enable HIGH = ON
  • Pin 2 (1A) – Channel 1 logic control
  • Pin 3 (1Y) – Motor Lead
  • Pin 4 – GND
  • Pin 5 – GND
  • Pin 6 (2Y) – Motor Lead
  • Pin 7 (2A) – Channel 2 logic control
  • Pin 8 (Vcc2) – Motor Power Supply

To turn CW, make 1A HIGH and 2A LOW. To turn CCW, make 1A LOW and 2A HIGH.

The diagram on the top and bottom right show how you can control your motor in one direction. The top right diagram shows the motor being controlled on the HIGH side and the bottom right diagram shows the motor begin controlled on the LOW side. The control scheme is essentially the same as above, though you will only be controlling one of the logic control lines.

I hope this has helped to answer you question and clarify the use of the L293D!

Don’t forget, everyone is invited to ask a question!

Click here!

“Ask an Educator” questions are answered by Adam Kemp, a high school teacher who has been teaching courses in Energy Systems, Systems Engineering, Robotics and Prototyping since 2005.

Filed under: educators — by akemp, posted May 30, 2012 at 10:07 am


Try Adafruit's new iPhone & iPad app for makers! Circuit Playground! "Incredibly handy for anyone working in electronics. Perfect for engineers and non-engineers alike."
Looking for engineers, makers and the builders of dreams? Try our Adafruit job boards.
Join our weekly Adafruit SHOW-AND-TELL at 9:30pm ET every Saturday night! Then at 10pm, ASK-AN-ENGINEER with Ladyada and the Adafruit team!

1 Comment

  1. I love the CAPTCHA!

    Comment by ~ — May 30, 2012 @ 4:20 pm

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

www.flickr.com
adafruit's items Go to adafruit's photostream
www.flickr.com
items in Adafruits More in Adafruits pool