Arduino robot kit – Wiring Diagram 12

I have created this wiring diagram for the connections between the motor controller, motors, and sensor shield. I’ll update it later to include other components.

Robot Wiring Diagram

Wiring Diagram for Arduino Robot kit

And here is an update that includes the servo motor and the range sensor.

Robot Wiring Diagram 2

Wiring Diagram for Arduino Robot kit – updated

And here are the detailed pin assignments for all modules:

Pin Assignment
Arduino Pin Description Motor Controller Range Sensor Servo Motor Line Detector Bluetooth Module
VCC VCC +5V VCC Red V+ VCC
GND GND GND GND Brown G GND
D0 Digital Pin 0 RX TXD
D1 Digital Pin 1 TX RXD
D2 Digital Pin 2 IN4
D3 Digital Pin 3 (PWM) ENB
D4 Digital Pin 4 IN3
D5 Digital Pin 5 (PWM) IN2
D6 Digital Pin 6 (PWM) ENA
D7 Digital Pin 7 IN1
D8 Digital Pin 8 S
D9 Digital Pin 9 (PWM) Orange
D10 Digital Pin 10 (PWM)
D11 Digital Pin 11 (PWM)
D12 Digital Pin 12 Trig
D13 Digital Pin 13 Echo
A0 Analog input 0
A1 Analog input 1
A2 Analog input 2
A3 Analog input 3
A4 Analog input 4
A5 Analog input 5

Disclaimer:

The diagrams above are not the only way you can connect the components so use at your own risk.

12 thoughts on “Arduino robot kit – Wiring Diagram

  1. carvarsa Jan 3,2013 5:46 pm

    You could test your L298N motor driver, by means of the next code. Only use the wiring diagram for the connections, and introduce in the serial monitor from you computer the numbers 1 or 2 to control the direction and letters from A to F to control de velocity.

    //Test the L298N motor driver shield – Arduino UNO

    void setup()
    {
    pinMode(7,OUTPUT); // Dir 1 Motor A
    pinMode(5,OUTPUT); // Dir 1 Motor A
    pinMode(6,OUTPUT); // In arduino UNO it has to be a PMW pin (3, 5, 6, 9, 10, and 11)
    pinMode(4,OUTPUT); // Dir 1 Motor A
    pinMode(2,OUTPUT); // Dir 1 Motor A
    pinMode(3,OUTPUT); // In arduino UNO it has to be a PMW pin (3, 5, 6, 9, 10, and 11)
    Serial.begin(9600); // To begin to comunincate with the serial port
    }

    void loop()
    {
    char c = Serial.read(); // Convert a decimal intridoced in the serial monitor into a character code

    // A motor control

    if (c == ‘1’) digitalWrite(7,HIGH); // Turn on dir 1, Motor A
    if (c == ‘2’) digitalWrite(5,HIGH); // Turn on dir 2, Motor A

    if (c == ‘5’) digitalWrite(6,HIGH); // Max velocity motor A,using the 6 pin as a digital output
    if (c == ‘A’) analogWrite(6,255); // Max velocity, 100%, motor A,using the 6 pin as a PMW analog output (The PMW output goes from 0 to 255, 8 bits, resolution= 100/256=0,39)
    if (c == ‘B’) analogWrite(6,200); // 200/256 = 78,12 % of the Max velocity motor A,using the 6 pin as a PMW analog output
    if (c == ‘C’) analogWrite(6,150); // 150/256 = 58,59 % of the Max velocity motor A,using the 6 pin as a PMW analog output
    if (c == ‘D’) analogWrite(6,100); // 100/256 = 39,06 % of the Max velocity motor A,using the 6 pin as a PMW analog output
    if (c == ‘E’) analogWrite(6,50); // 50/256 = 19,53 % of the Max velocity motor A,using the 6 pin as a PMW analog output
    if (c == ‘F’) analogWrite(6,0); // 0/256 = 0 % of the Max velocity motor A,using the 6 pin as a PMW analog output

    if (c == ‘0’)
    {
    digitalWrite(7,LOW); // Off vel, Pin A
    digitalWrite(5,LOW); // Off vel, Pin A
    digitalWrite(6,LOW); // Off vel, Pin A
    }

    //B Motor control (the commets are the same A motor comments), you can control every motor separately changing for others the numbers 1, 2 and 5 and the letters from A to F

    if (c == ‘1’) digitalWrite(4,HIGH); // On dir 1, Pin A
    if (c == ‘2’) digitalWrite(2,HIGH); // On dir 2, Pin A

    if (c == ‘5’) digitalWrite(3,HIGH); // On Vel Pin A
    if (c == ‘A’) analogWrite(3,255);
    if (c == ‘B’) analogWrite(3,200);
    if (c == ‘C’) analogWrite(3,150);
    if (c == ‘D’) analogWrite(3,100);
    if (c == ‘E’) analogWrite(3,50);
    if (c == ‘F’) analogWrite(3,0);

    if (c == ‘0’)
    {
    digitalWrite(4,LOW); // Off vel, Pin A
    digitalWrite(2,LOW); // Off vel, Pin A
    digitalWrite(3,LOW); // Off vel, Pin A
    }
    }

  2. maen Dec 29,2012 4:48 pm

    I tried “IRrecvDemo” example with pins 11 and 10, and both worked ok. It could be a wiring issue (pins should be G-V-S), or the remote control is not working properly.
    The LED on the module will blink when a signal is received. Any remote control should work but I found that the one that comes with kit generates a code that is easy to understand.

  3. Mike Dec 29,2012 2:38 pm

    I tried to connect the Infrared module (Keyes) on PIN10 (D10) with this library (http://www.arcfn.com/2009/08/multi-protocol-infrared-remote-library.html) but no signal !?! Do you have an idea ? Thx

  4. Mike Dec 27,2012 8:39 am

    Wow !!!Thx a lot : I don’t know how I should have made it without your wiring diagram ! Continue … I’m your fan man ! 🙂

    -Mike

  5. maen Nov 30,2012 12:46 pm

    I have updated the diagram to include the servo motor and the range sensor.

  6. Andrew Nov 29,2012 4:48 pm

    thank you for sensor but i dont understendwhere i needto connect it 🙁

  7. Andrew Nov 29,2012 4:46 pm

    this code from my working car:
    //Motor A
    int dir1PinA = 7;
    int dir2PinA = 5;
    int speedPinA = 6;

    //motor B
    int dir1PinB = 4;
    int dir2PinB = 2;
    int speedPinB = 3;

    unsigned long time;
    int speed;
    int dir;

    void setup ()
    {
    pinMode (dir1PinA, OUTPUT);
    pinMode (dir2PinA, OUTPUT);
    pinMode (speedPinA, OUTPUT);
    pinMode (dir1PinB, OUTPUT);
    pinMode (dir2PinB, OUTPUT);
    pinMode (speedPinB, OUTPUT);
    time = millis ();
    speed = 0;
    dir = 1;
    }

    void loop ()
    {
    analogWrite (speedPinA, speed);
    analogWrite (speedPinB, 555 - speed);

    // set direction
    if (1 == dir)
    {
    digitalWrite (dir1PinA , LOW);
    digitalWrite (dir2PinA, HIGH);
    digitalWrite (dir1PinB, HIGH);
    digitalWrite (dir2PinB, LOW);
    }
    else
    {
    digitalWrite (dir1PinA, HIGH);
    digitalWrite (dir2PinA, LOW);
    digitalWrite (dir1PinB, LOW);
    digitalWrite (dir2PinB, HIGH);
    }

    if (millis () - time> 5000)
    {
    time = millis ();
    speed += 20;
    if (speed> 555) {speed = 0;}

    if (1 == dir)
    {dir = 0;}
    else
    {dir = 1;}
    }
    }

  8. maen Nov 28,2012 1:57 pm

    This post “Arduino robot kit – Range sensor” has some information about the distance sensor. I’ll create a new post soon about controlling the robot with Bluetooth.

  9. Andrew Nov 27,2012 7:03 am

    Can you make next post about Remote Control or Distance sensor?

  10. Andrew Nov 25,2012 3:55 am

    Thanks for the scheme, Your job is grate 🙂 i follow you and my car already can move.

  11. maen Nov 23,2012 4:43 pm

    Thanks! Have you read the previous posts? I think they have all the details.

  12. Björn Nov 23,2012 3:44 pm

    Hi, i think your work is great! You are probably the only one on the net showing how to build this kit from dx. I am looking forward to see your complete code. I am having trouble getting the motors to run, so i am looking forward to see have you solved it! Keep the good work up! -Björn

Comments are closed.