Arduino Nano: Control Brushed DC Motor with L9110S Driver Board and Visuino

Written by: admin@makezilla

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 theL9110S 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.

Please note that the annotation on some of the pictures in this Instructable will work correctly on some browsers only after you click on the image to expand it.

Please make sure you click on the image to see the annotation showing the correct spot on the image!

Step 1: Components

Picture of Components5691cf772e7fb67ef70000a8.jpeg5691cf552e7fb63f800003dc.jpeg

  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

Picture of Connect the Motor to the Motor Driver, and the Motor Driver to the Arduino5691cf0345bceb48a2000ce8.jpeg5691cf1145bceb48a2000ce9.jpeg

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 theMotor Driver board(Picture 2)
  3. Connect Female-Female Power wire(Red wire) to the Power pin of theMotor 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 theDirection 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 theDigital pin 3 of the Arduino board(Picture 3)
  7. Connect the other end of the Direction Control wire(Yellow wire) to theDigital 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

Picture of Connect External Power to the Motor Driver Board5691cf6d50e1b6eaa4000a50.jpeg

  1. Connect the other end of the Power wire(Red wirefrom the Motor Driverto 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 thePower source, the Motor Driver board, and the Arduino together as example with the help of a Breadboard (Picture 2) - In my case I used asmall Breadboard

Step 4: Connect the potentiometer to Arduino

Picture of Connect the potentiometer to Arduino5691cf8d15be4d1787000981.jpeg5691db2d4fbade0a86000ac7.jpeg

  1. Connect a Female-Female Power wire(Red wire) to the one end pin of thePotentiometer (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 ware 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

Picture of Start Visuino and select the Arduino Board typeSelectBoard.png

To start programming the Arduino, you will need to have the Arduino IDEinstalled 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 1.6.5, otherwise this Instructable will not work!

The Visuinohttps://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) inVisuino
  3. When the dialog appears, select Arduino Nano as shown in Picture 2

Step 6: In Visuino: Add and connect L9110S Dual Motor Driver to component

Picture of In Visuino: Add and connect L9110S Dual Motor Driver to componentComponentConnect1.pngComponentConnect2.pngComponentConnect3.png

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 theDualMotorDriver1 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 DualMotorDriver1component to the "Analog" input pin of the "Digital[ 3 ]" channel of theArduino component(Picture 3)
  4. Connect the "Out" pin of "Digital[ 14 ]/AnalogIn[ 0 ]" channel of the Arduinocomponent to the "In" pin of the first channel of the DualMotorDriver1component (Picture 4)

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

Picture of Generate, Compile, and Upload the Arduino codeArduino IDE.png

  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 of And play...VisuinoDiagramCrop.png

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 Visuinohttps://www.visuino.com

http://www.instructables.com/files/orig/F99/700U/IJ7WNJ7Q/F99700UIJ7WNJ7Q.zip

Leave a Reply