Arduino : How to Control DC Motors With L293D Motor Driver

46,605

108

11

About: Arduino, Raspberry Pi, esp8266, Tutorials, Projects

This instructable is the written version of my "Arduino : How To Control DC Motors with L293D Motor Driver" YouTube video that I've uploaded recently. I strongly recommend you to check it out.

My YouTube Channel

Step 1: Tutorial

Dual H-Bridge Motor Driver for DC or Steppers - 600mA - L293D

This is a very useful chip. It can actually control one motor independently. We will use in its entirety the chip in this tutorial. Pins on the right hand side of the chip are for controlling a one motor. Pins on the left hand side of the chip are for controlling second motor.

You can run four solenoids, two DC motors or one bi-polar or uni-polar stepper with up to 600mA per channel using the L293D.

Step 2: Hardware Required

  • Arduino
  • Dual H-Bridge L293D Motor Driver
  • DC Motors
  • Breadboard
  • Wires
  • Batteries

Step 3: Circuit & Connection

Each chip contains two full H-bridges (four half H-bridges). That means you can drive four solenoids, two DC motors bi-directionally, or one stepper motor. Just make sure they're good for under 600 mA since that's the limit of this chip.

There's a PWM input per driver so you can control motor speed. Runs at 5V logic. Good for motor voltages from 4.5V up to 36V! This wont work well for 3V motors. The motor voltage is separate from the logic voltage.

The L293D has two +V pins (8 and 16). The pin '+Vmotor (8) provides the power for the motors, and +V (16) for the chip's logic.

Normally we can connect both of these to the Arduino 5V pin. We used a powerful motor, or a higher voltage motor. So we provided the motor with a separate power supply using pin 8 connected to the positive power supply and the ground of the second power supply is connected to the ground of the Arduino.

Step 4: Code

Step 5: If I Was Helpful

First of all, I would like to thank you for reading this guide ! I hope it helps you.

If you want to support me, you can subscribe my channel and watch my videos.

Visit My YouTube Channel

Share

    Recommendations

    • Colors of the Rainbow Contest

      Colors of the Rainbow Contest
    • Arduino Contest 2019

      Arduino Contest 2019
    • Woodworking Contest

      Woodworking Contest

    11 Discussions

    0
    None
    SamB243

    1 year ago

    How do i change the speeds of the motors?

    0
    None
    Jigneshk5NiallM9

    Reply 1 year ago

    You have to check for the current ratings of your motor because L293D can supply max current of 600mA per channel

    0
    None
    DerekS87NiallM9

    Reply 1 year ago

    Max source voltage for the L293D is 36v and any voltage over 5v has to come from an outside power source.

    0
    None
    Gary1997

    Question 1 year ago on Step 5

    Driver IC for 6 motors

    0
    None
    MukeshK86

    2 years ago

    can i use this procedure to run brushless motor of 1800 kv?

    1 reply
    0
    None
    aditya14MukeshK86

    Reply 1 year ago

    no you cant use a bldc motor with l293d

    0
    None
    vincent44

    2 years ago

    do you have a code to include a sharp ir sensor ? thanks

    0
    None
    MertArduinoahmet_024102

    Reply 2 years ago

    Yorumun için bende sana teşekkür ederim. Ama "Hocam" sıfatını hak edecek bir şey yaptığımı düşünmüyorum. Ben sadece hobi olarak ilgileniyorum. Gerçek emekçilere haksızlık olmasın ;) Geçen gün sana bir adres yolladım, arduino başlangıcı ile ilgili. Hemen hemen tüm konulara oradan ulaşabilirsin bilgine.

    0
    None
    ahmet_024102MertArduino

    Reply 2 years ago

    evet gördüm. güzel eğitim dökümanları var teşekkürler
    burda iyi paylaşımlar yapıyorsun eyvallah.
    bende led üzerine bilgiliyim. led hakkında ne sorarsan cevap veririm. led tabela kayan yazı vs. elektronik mekatronik vs. otomasyon vs. biz burda türkçe yazıyoruz yabancılar kızıyordur :):)

    have ı nice day diyimde bari kızmasınlar :)