HTE - L293D H-Bridge Motor Driver

Overview

For Fullscreen: https://www.youtube.com/watch?v=bxZ2_UWCEik

This tutorial will show you how to use a L293D H-Bridge Motor Driver, connect it to the Quantum system, and create a simple demo using it.


What is a L293D H-Bridge?

The L293D H-Bridge is an electronic circuit that is commonly used for bi-directional motor driving applications. The L293D chip is a 16-pin ic which allows you to control a set of two dc motors simultaneously in any direction. It can provide bi-directional currents up to 600 mA at voltages from 4.5 to 36 V. You’ll notice that there is a half circle at one end. It is used to orientate the chip and determine the pins.

The master pins are “Enable 1, 2” and “Enable 3,4”. If they on high the other pins with the same numbers will work or if it is low the pins wont work. So through these pins you control the circuit. Output 1 will connect to the Builder Base and control a dc motor which is connected at Output 2. For this Input 1 and 2 have to be activated. Same for the pins on the right side of the bridge. Vcc 1 and Vcc 2 are used to power up the bridge and the connected motors.


Assemble the Circuit

Picture

Name

Quantity

Link

Picture

Name

Quantity

Link

 

1 - 6V DC Motor

2

One is included in the Component Kit

You can purchase the others here

 

L293D

1

One is included in the Component Kit, but you can purchase the second here

 

Male to Male and Male to Female jumper wires

15-20

Included in Component Kit

Or you can purchase it here

 

Power Supply Kit

1

You can purchase it here

Q-Client Builder Base

1

Q-Client

If you have all the parts listed above, we can go ahead and build the circuit.

This is the circuit diagram for the tutorial. The circuit should be looking like this:

We also made a more condensed version of the circuit:


Pair the Builder Base

Now we want to pair the Builder Base with our Q-Server. In order to do so, go to the Homescreen of your Q-Server.

Next click on the lift side symbol labeled “Clients”. Switch to the “Unpaired” tab at the top middle of the screen.

You should see your unpaired Builder Base. If not, check if you have plugged in the power supply for the Builder Base. Now move to the three dots below “Actions” and click “Pair”.

Once your Client is paired, click the “Setup” button.

Now you can edit your Client. Give him a Name you want and also a location where you are going to use it. Hit “Save” when you finished.


Build the Firmware

So once the Builder Base is paired and set up, we can start building our firmware. Move to the “Firmware” tab on the left side of your Q-Server interface. Hit “+ Create New”.

You will be prompted to give your new firmware a name. We named ours “H-Bridge”.

Once you created the new firmware, hit the “+ Add Hardware” button on the top, next to the “Actions” button.

We are going to search for a motor. You can use the search bar or scroll down till you find it. After this, you can give it a name and then click on “Add Hardware”. We named ours “Pump” and “Fan”. Next we need to configure the firmware. Click on the “Pump” bar:

Select the right pins which connect the bridge to the Builder Base. Do this for the “Pump” and “Fan” firmware.

Next we have to upload the firmware file to our Builder Base. Click on the three dots below “Actions” and click on “Upload”:

Choose the correct Builder Base and hit “Upload”. You should see a progress bar pop up at the right side of your screen.


Build the App

While the firmware is uploading, we can build the application for our Button. Move to the “Apps” tab on the left side. Click on “Create New” and give it a name you want. We named ours again “H-Bridge”. Hit “Create”.

You will find yourself on the Canvas.

For this tutorial we will need two “Motor” hardware objects, three “Button” interface objects and two “Slider Percent” interface objects. Make sure to name each object and also label it so you can see later on which button is which.

Both “Slider Percent” connect to the Speed port of the motor to control it. The buttons are used to turn the dc motor of the fan or pump clockwise or counterclockwise.

Click “Save App” on the top right. You will return to the first screen of the “Apps” tab. Now click the play button on the bar located at the right side.

Now we have to map the hardware and interface objects we have put together before to the actual hardware of the circuit. Connect “Fan” to the “H-Bridge Fan” and the “Pump” to the “H-Bridge Pump”.

 

 

Once you done click “Save + Run”.


Run the App!

Click on the “Dashboard” icon in the top right corner.

Click on the icon to open it. It should look like this.

Let’s have a look:

As you can see we can now control the pump and fan. We can control the speed by using the slider percent and we can also let the fan turn clockwise oder counterclockwise with the buttons.

This is how you connect and use a L293D H-Bridge with the Quantum System. We also learned how to practically use it to power two dc motors at the same time. For more information about the H-Bridge have a look at https://quantumintegrate.atlassian.net/wiki/spaces/QFR/pages/15269922.

Happy Making!