Main content
Electrical engineering
Course: Electrical engineering > Unit 7
Lesson 5: Bit-zee Bot- Bit-zeeeeeeeeeee
- Bit-zeeeeeeeeeee (long version)
- Parts for Bit-zee and It-zee
- Tools for Bit-zee and It-zee
- Introduction
- Planning and propulsion
- Parts
- Chassis/frame
- Wheel mounts and fenders
- Component mounting holes
- Batteries/power
- Battery wires
- Power wires and on/off switch
- Motors/propulsion
- Motor controller functions
- Motor controller
- Motor controller connections
- Arduino connections
- Digital camera connections
- Digital camera connections II
- 5 volt power distribution board
- Digital recorder/player connections
- Power connector for the Arduino
- Prototype board
- Motor controller connection to Arduino
- Camera connection to the Arduino
- Bumper switches
- LED eyes
- IR sensor
- Chassis modifications
- Camera wiring update
- Programming
© 2023 Khan AcademyTerms of usePrivacy PolicyCookie Notice
Motor controller functions
This video outlines in simple terms why a motor controller is needed and what it does. Created by Karl Wendt.
Want to join the conversation?
- I know this is off topic but why is it called Bit-zee bot? is it like english with a french accent? like bit-ZEE bot for bit-the bot?(8 votes)
- At, what programming language do you write the code in? 1:18(5 votes)
- The official Arduino IDE is for programming in C/C++.(6 votes)
- where do you get the yellow connecting wire(4 votes)
- amazon has one for $4. i found them there!(3 votes)
- This video ends with a statement saying the next video will show how to connect all the components. What happened to the next video, are you still working on it?(4 votes)
- Well, you probably ditched this question but lets pretend we are 3 months in the past.
Well, look at the Khan Academy Projects page on youtube. If its not there than he will post them on youtube and the KA team will put it on the KA website.
(2 votes)
- How much would this project all together cost (approximation would be fine)?(2 votes)
- Hi there, I am using raspberry pi in my project and I want to conrol SG90 Servo motor with it but I have some problem with it because my python program does not work well
could you help me ?
my python program is
///////////////////////////////////////////////
import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BOARD)
GPIO.setup(7,Gpio.OUT)
p = GPIO.PWM(7,50)
p.start(7.5)
try:
while True:
p.ChangeDutyCycle(7.5)
time.sleep(1)
p.ChangeDutyCycle(12.5)
time.sleep(1)
p.ChangeDutyCycle(2.5)
time.sleep(1)
except KeyboardInterrupt:
p.stop()
GPIO.cleanup()
/////////////////////////////////////////////(1 vote)- What are you trying to run the program on?(1 vote)
- were do u buy motor controler(1 vote)
- kevin is your theory correct(1 vote)
- How do u memorize all these stuff?(1 vote)
- If you understand something, you don't need to memorize that much. It's like walking - you don't have to remember which leg to move next.(1 vote)
- Karl, have you tried using a step-down transformer for the arduino?(3 votes)
Video transcript
All right, so this is our
motor, and this is our battery. And we know that if we switch
the connections on the battery, we can change the
direction of the motor. But all we can do
right now is put the motor in some sort of a
housing and have it run around. And then we have to
manually change everything. So what we want to do based
on our goals or objectives for this project was we want
to be able to control the motor and have it turn on and off and
go backwards and forwards when we want it to. So what we've done is we've
selected a microcontroller. This particular one is
called an Arduino Uno. And you can get these online. I got this particular
one for about $20. There are variations
that you can get that are as cheap as
$10 or $12, all the way up to $70 or $80, depending
on what you want it to do and how much work
you're willing to do to put the board together. So this one comes preassembled. It's ready to go. It's got the connector for your
computer so it's easy to use. And that's why I selected
this particular one. So Arduino is an open
source microcontroller. And it comes with a compiler. So you can download the
compiler and write your code, upload it to the Arduino,
and cause your robot to move and do different things. So the Arduino can take
information from sensors and use that information to tell
parts of the robot what to do. So we know we've got
a motor that moves. And we know we have
a power source. And we have brains to make it
move, but there's an issue. We can't hook the motor
directly to the Arduino because the Arduino wants to run
on a lot less current than what the motor wants to run on. So the motor's going to
burn the Arduino out. We have to have a way to switch
the high current of the motor, control it, in other words, a
way to turn the high current on and off and a way to control the
direction of that high current, the polarity of it, without
directly affecting the Arduino. So we need another
device to do that, and that device is called
a motor controller. So I've already built
this motor controller up. And I'm going to show
you how to make it. It's a Solarbotics
motor controller. And I'll talk a little
bit about what it does. So it basically controls
the speed and direction of our motor. And so it switches that the
higher power of the batteries and allows more current to flow,
and it takes signal information from the Arduino, which is
a low-voltage, low-current signal. And so the low
voltage, low current comes into the motor
controller and says, hey, turn the motor
on in this direction. And then the motor
controller let's power from the battery flow
through the motor controller to the motor without
damaging the Arduino. And so it lets us run the motor
on a higher amount of power than we could if we tried to run
it through the Arduino itself. So the way it does that is
signals come from the Arduino, and they go into these
little ports here. And those ports
are-- the signals are interpreted by
this logic chip here, which is an L298 chip. And that allows us to
control the power going from the battery to the motor. Now, there's also a chip here. This is a fiv5-volt power
supply, regulated power supply chip. And this allows us
to take 5 volts out of the motor controller
to power the Arduino. So we can take that 5 volts
out from this terminal block right here and connect
it to the Arduino. So this also allows us to run
multiple different voltages. So the motor is
going to be pulling 12 volts from the
batteries, but the Arduino will be pulling only 5
volts from this supply here. So then we also have
these diodes on board. And the diodes,
they're flyback diodes, and they prevent voltage from
coming back from the motor and damaging other
parts of the circuit. And when you stop a
motor fast or when your reverse its direction, you
can get a pulse of electricity that comes back down
the line and can affect other parts of the board. So because diodes act as valves
and only allow the electricity to flow in one direction,
it protects your board. So then we also have
some resistors here. You can see these resistors. These two resistors are designed
to protect the LEDs here. And these LEDs are
Light-Emitting Diodes, and they indicate the direction
or the polarity of the current. And that will
indicate the direction that the motor is turning. So that's what
they're there for. And these resistors protect
them from getting too much power and burning out. And then we have a little
tiny capacitor here that's a high-frequency
filtering capacitor. And then we have an
electrolytic capacitor, and that probably
helps to smooth out some of the
variations in current. We have two more
resistors back here, and they are protect various
aspects of our chip back here, I believe. So we have our terminal blocks. And these terminal blocks,
that's where the power goes. So the motor will be connected
to the terminal block. This motor will be connected to
the terminal block like that. And the power from
the battery will come in to the
terminal blocks here. And I'll show you how to
connect all this and wire it up. And in the next video, we're
going to build this little guy and show you how it works.