loading

Brushed DC Motors are often used to drive robots around, or for variety of other cool Arduino projects. To control the motor with Arduino, you usually need to use a motor driver. There are a lot of different motor drivers available. One of the most popular and affordable ones for very small motors are the L9110S Motor Drivers.

Please be aware that this driver board can drive only small motors, with max working current up to 0.8A. If you need more power and bigger motors, you will need a more expensive and powerful motor driver board.

In this Instructable, I will show you how easy it is to connect and control a DC Motor with a L9110S Dual Motor Driver, by using Visuino.

In the future I also plan to make Instructables on using more powerful driver boards, so stay tuned.

Step 1: Components

  1. One Arduino compatible board (I use Arduino Nano, because I have one, but any other will be just fine )
  2. One L9110S Dual Motor Driver Module
  3. One small brushed DC Motor(It is highly recommended to have a 0.1uF Capacitor soldered to the motor to reduce noise as shown on Picture 3)
  4. One 10K Potentiometer
  5. One small Breadboard (Any breadboard can be used, or any other way to connect 3 wires together)
  6. 6 Female-Female jumper wires
  7. 5 Female-Male jumper wires
  8. Some DC power supply for the motor(Picture 2). I used adjustable power adapter, but a battery or any other DC power supply with the proper voltage will work.

Step 2: Connect the Motor to the Motor Driver, and the Motor Driver to the Arduino

To make is easier to see the rotation of the motor, I have taped a piece of black insulation tape on the motor shaft.

Since the board can control 2 motors - channel A and B, and we use only one motor for simplicity, here we will connect only channel A. Channel B can be connected and used the same way.

  1. Connect the Motor to the motor control connection points of channel A of the L9110S Dual Motor Driver (Picture 1)
  2. Connect Female-Male Ground wire(Black wire) to the Ground pin of the Motor Driver board(Picture 2)
  3. Connect Female-Female Power wire(Red wire) to the Power pin of the Motor Driver board(Picture 2)
  4. Connect Female-Female Speed Control wire(Green wire) to the Speed Control(A) pin of channel A of the Motor Driver board(Picture 2)
  5. Connect Female-Female Direction Control wire(Yellow wire) to the Direction Control(B) pin of channel A of the Motor Driver board(Picture 2)
  6. Connect the other end of the Speed Control wire(Green wire) to the Digital pin 3 of the Arduino board(Picture 3)
  7. Connect the other end of the Direction Control wire(Yellow wire) to the Digital pin 2 of the Arduino board(Picture 3)
  8. Connect another Female-Male Ground wire(Black wire) to the Ground pin of the Arduino board(Picture 3), and leave the Male end unconnected

Step 3: Connect External Power to the Motor Driver Board

  1. Connect the other end of the Power wire(Red wire) from the Motor Driver to the positive(+) of the power source(Picture 1) - In my case a jack that I connect to the adjustable power adapter
  2. Connect another Female-Male jumper wire(Black wire) to the negative(-) of the power source (Picture 1) - In my case a jack that I connect to the adjustable power adapter
  3. Connect the Male ends of the 3 Ground wires(Black wires) - from the Power source, the Motor Driver board, and the Arduinotogether as example with the help of a Breadboard (Picture 2) - In my case I used a small Breadboard

Step 4: Connect the Potentiometer to Arduino

  1. Connect a Female-Female Power wire(Red wire) to the one end pin of the Potentiometer (Picture 1)
  2. Connect a Female-Female Signal wire(Gray wire) to the Wiper(center) pin of the Potentiometer (Picture 1)
  3. Connect a Female-Female Ground wire(Black wire) to the other end pin of the Potentiometer (Picture 1)
  4. Connect the other end of the Ground wire(Black wire) to the Ground pin of the Arduino board (Picture 2)
  5. Connect the other end of the Power wire(Red wire) to the 5V Power pin of the Arduino board (Picture 2)
  6. Connect the other end of the Signal wire(Gray wire) to the Analog pin 0 of the Arduino board (Picture 2)
  7. Picture 3 shows in Red the Arduino Nano pins that were connected in this step. The picture also shows the pins connected in Step 2 in Blue

Step 5: Start Visuino and Select the Arduino Board Type

To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/ .

Please be aware that there are some critical bugs in Arduino IDE 1.6.6.

Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work!

The Visuino: https://www.visuino.com also needs to be installed.

  1. Start Visuino as shown in the first picture
  2. Click on the "Tools" button on the Arduino component (Picture 1) in Visuino
  3. When the dialog appears, select Arduino Nano as shown in Picture 2

Step 6: In Visuino: Add and Connect L9110S Dual Motor Driver Component

The "L9110S Dual Motor Driver" component included in Visuino supports 2 channels. Since we will control only one motor we will connect only one of the channels.

  1. Type "motor" in the Filter box of the Component Toolbox then select the "L9110S Dual Motor Driver" component (Picture 1), and drop it in the design area
  2. Connect the "Direction(B)" pin of the first channel of the DualMotorDriver1 component to the "Digital" input pin of the "Digital[ 2 ]" channel of the Arduino component(Picture 2)
  3. Connect the "Speed(A)" pin of the first channel of the DualMotorDriver1 component to the "Analog" input pin of the "Digital[ 3 ]" channel of the Arduino component(Picture 3)
  4. Connect the "Out" pin of "Digital[ 14 ]/AnalogIn[ 0 ]" channel of the Arduino component to the "In" pin of the first channel of the DualMotorDriver1 component (Picture 4)

Step 7: Generate, Compile, and Upload the Arduino Code

  1. In Visuino, Press F9 or click on the button shown on Picture 1 to generate the Arduino code, and open the Arduino IDE
  2. In the Arduino IDE, click on the Upload button, to compile and upload the code (Picture 2)

Step 8: And Play...

Picture 1 shows the connected and powered up project.

If you position the potentiometer in the middle, the motor will stop. If rotate the Potentiometer in one direction the motor will start rotating, and you can use the potentiometer to adjust the speed. If you rotate the potentiometer past the middle point in the other direction, the motor will start rotating in opposite direction.

Congratulations! You are now in full control of your DC Motor :-)

On Picture 2 you can see the complete Visuino diagram.

Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.com

<p>can you please send the code in a different format, in notes format, or just comment the code somehow because i really need it and cant open the file you provided. thank you in advance</p>
<p>You should be able to open the code in Visuino. I can send generated Arduino code, but it will become obsolete quickly as it will be generated for specific version of the Visuino libraries. The libraries are constantly updated and expanded, and Visuino always generates code for the latest version, so the best option is to download and generate the code yourself with Visuino.</p>
<p>This combo has been my favourite method to control small motors for the past year -I will pass on the link to this to whomever is interested as you have done a good job - Thanks!</p>
<p>Thank you! :-)<br>There is way more to come out soon ;-)</p>

About This Instructable

11,744views

63favorites

License:

More by BoianM:
Add instructable to: