adamsstephen
Published

Controlling an L9100 Motor Driver Board Using Arduino

This project shows you how to successfully control a robot arm using the L9110 motor board, without using up all your Arduino outputs.

AdvancedFull instructions provided6,925
Controlling an L9100 Motor Driver Board Using Arduino

Things used in this project

Hardware components

Arduino UNO
Arduino UNO
×1
Arduino Mega 2560
Arduino Mega 2560
×1
Arduino 101
Arduino 101
×1
Arduino Due
Arduino Due
×1
Resistor 1k ohm
Resistor 1k ohm
×11
7403 NAND gate IC
×3
7404 Hex inverter IC (generic)
×1
Wire Cable - By the Foot
OpenBuilds Wire Cable - By the Foot
×1
Male Header 40 Position 1 Row (0.1")
Male Header 40 Position 1 Row (0.1")
×1
Maker Essentials - Various Headers
Pimoroni Maker Essentials - Various Headers
×1
14 pin DIL IC Sockets (Generic)
×4
Chocolate Block Connector 5 amp (generic)
×1
Heat Shrink Tubing to cover Header connections
×1
3 volt power supply (2xAA cells in holder)
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Pliers
Soldering iron (generic)
Soldering iron (generic)
Solder Reel

Story

Read more

Schematics

Circuit Diagram

Circuit design for logic board, Arduino, motor board and Robotic Arm

Code

Controlling DC Motors using L9110 driver board using Ardunio

Arduino
Program to test one motor at a time using logic board
[code]
int Motor[8] ; // Array for all Motor Output pins, one more than required

void setup() {
  Motor[1] = 4; // Set output numbers for ports
  Motor[2] = 5;
  Motor[3] = 6;
  Motor[4] = 7;
  Motor[5] = 8;
  Motor[6] = 9; // Set up Port for LED on Head of Arm.
  Motor[7] = 10; // Forward / Reverse selection for ALL motors
  // Switch connected to GND and A0, to locally turn off motors while testing.
  pinMode(Motor[1], OUTPUT); // Open Port to operate Motor on Pincers Forward = In Reverse = Out
  pinMode(Motor[2], OUTPUT); // Open Port to operate Motor Up= High  Reverse = Down
  pinMode(Motor[3], OUTPUT); // Open Port to operate Motor Forward = Forward Reverse = Backward 
  pinMode(Motor[4], OUTPUT); // Open Port to operate Motor Wrist Forward = Up Reverse = Down
  pinMode(Motor[5], OUTPUT); // Open Port to operate Motor base Rotate Forward = Right Reverse = Left
  pinMode(Motor[6], OUTPUT); // Open Port to operate LED on head of Arm HIGH = ON LOW = OFF
  pinMode(Motor[7], OUTPUT); // Open Port for Forward / Reverse selection for ALL motors 
}
void loop() {
    digitalWrite(Motor[6], LOW); // Turn off LED.
    if (analogRead(A0)< 1){ // switch ON
    digitalWrite(Motor[1], HIGH); // Turn on Motor 1. HIGH turns it on! Pincers
    digitalWrite(Motor[7], LOW); // HIGH is Forward, Reverse is OFF.
   Serial.println(analogRead(A0));
}
    if (analogRead(A0) > 200  ){    // switch OFF
    digitalWrite(Motor[1], LOW); // Turn on Motor 1. HIGH turns it on!
    digitalWrite(Motor[7], LOW); // HIGH is Forward, Reverse is OFF.
   Serial.println(analogRead(A0));
}
    delay(200); // debounce the switch action
}
[/code]
 

Credits

adamsstephen

adamsstephen

0 projects • 7 followers

Comments