If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Motor controller connection to Arduino

In this video we show you how to determine which wire is which and how to connect them to your Arduino. Created by Karl Wendt.

Want to join the conversation?

  • piceratops ultimate style avatar for user NotMyRealUsername
    Karl, when this playlist finishes, can you make it one of the items in the Khan Academy Store?
    (4 votes)
    Default Khan Academy avatar avatar for user
  • male robot hal style avatar for user The WWE World Heavyweight Champion Trizzy Tre
    why do i keep getting this

    IRrecord.cpp: In function ‘void setup()’:
    IRrecord.cpp:36:3: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp: In function ‘void storeCode(decode_results*)’:
    IRrecord.cpp:55:5: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘DEC’ was not declared in this scope
    IRrecord.cpp:78:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:86:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:89:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:92:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:95:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘DEC’ was not declared in this scope
    IRrecord.cpp:99:5: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘HEX’ was not declared in this scope
    IRrecord.cpp: In function ‘void sendCode(int)’:
    IRrecord.cpp:109:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:113:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘HEX’ was not declared in this scope
    IRrecord.cpp:119:5: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘HEX’ was not declared in this scope
    IRrecord.cpp:131:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘HEX’ was not declared in this scope
    IRrecord.cpp:137:7: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:: error: ‘HEX’ was not declared in this scope
    IRrecord.cpp:144:5: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp: In function ‘void loop()’:
    IRrecord.cpp:154:5: error: ‘Serial’ was not declared in this scope
    IRrecord.cpp:159:5: error: ‘Serial’ was not declared in this scope
    (4 votes)
    Default Khan Academy avatar avatar for user
  • female robot grace style avatar for user divaCassandra1
    Karl, can you create a pdf of the list you are using and put a link up?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • leaf green style avatar for user 迎 ᴄᴏʟᴏʀ ᴛʜᴇᴏʀʏ 迎
    I built one of these- It didn't work perfectly, but I did work.

    Does it matter which brand of blowdryer thing you use?
    (3 votes)
    Default Khan Academy avatar avatar for user
  • purple pi purple style avatar for user Tahmid Azam
    I started one of these but i found the tap light base was too small to fit everything in the height was 3/4 of and inch what was yours?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • hopper cool style avatar for user Garic
    Who is the guy building all the robots?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user An
    At in video 23.Connecting the motor controller to the Arduino, he mentions that pin out locations can be found online. Where exactly is that webpage?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • blobby green style avatar for user Art Havican
    Why didn't you just use different colored wires so you would know which to connect where?
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops tree style avatar for user Sree Vardhan Reddy
    How can i connect motor driver L293D to Areduino.
    (1 vote)
    Default Khan Academy avatar avatar for user
  • piceratops ultimate style avatar for user An
    At in video 23.Connecting the motor controller to the Arduino, he mentions that pin out locations can be found online. Where exactly is that webpage?
    (0 votes)
    Default Khan Academy avatar avatar for user

Video transcript

In this video, we're going to connect our motor controller to our Arduino. We've run the wires from the motor controller underneath the Arduino. We just need to figure out which wires are which so we can determine what pins to connect those wires to. So, we're setting our multimeter to open, and this will allow us to test for continuity. [BEEPING] So when you hear the beep, it means that there's a continuous electrical flow there, and it'll allow us to identify which wire is which. So when we don't hear a beep, it means it's not the same wire. [BEEPING] But when we do, that means that wire is continuous. So we know which wire is which. So we can use our multimeter to tell us which wire is which. So we're going to take that wire there, which is our L1 wire, and we've already created a list of where we want our pin outs to go. So our L1 wire, we're saying, is going to go to pin D10. So when we create our code on our computer, we'll use this list to tell us which pin out is which in the code. And that'll help us make sure that we get all of our functionality all lined up correctly. OK, so we've got our first one done, and now we need to move on to the next one. We're going to use our multimeter again. And so we're just going to go to L2. And so we're going to connect L2 to digital pin 8. And so we'll turn our multimeter to open again, and we'll-- [BEEPING] OK, so we're going to go through and take a look at where L2 is, see if we can figure out which wire that is. [INTERMITTENT BEEPING] OK, so it's our second wire down there. That's where L2 is. And we determined in our list that we created, that L2 was going to be a D8, digital pin eight. So we'll finish connecting the rest of the wires using the same method, just checking your continuity, and then connecting them to the same pin out that is on our list. If you're going to use the same code is as us, make sure that you follow the same pin outs, and we'll post that online. The D9 pin out that's listed in this list here was actually inaccurate, so we crossed that out. Because we were using D9 as you can see at the top there. In the next video, we're going to show you how to wire up the camera and the sound card.