Computer Science Grade 8 20 min

Motors: Getting Things Moving

Explore motors and how they can be used to create motion. Build a simple motorized car or fan.

Tutorial Preview

1

Introduction & Learning Objectives

Learning Objectives Identify the fundamental difference between sensors and actuators. Explain how electric motors convert electrical energy into mechanical motion. Differentiate between common types of motors used in robotics, such as DC, servo, and stepper motors. Describe the role of a motor driver circuit in controlling motors. Write basic code to control a DC motor's on/off state and direction. Understand the concept of Pulse Width Modulation (PWM) for motor speed control. Have you ever wondered how robots move their arms, or how a drone flies? 🤖 It's all thanks to tiny powerhouses called motors! In this lesson, we'll explore the exciting world of motors, which are essential components in robotics and physical computing. You'll learn what motors ar...
2

Key Concepts & Vocabulary

TermDefinitionExample ActuatorA component that converts an electrical signal into a physical action, such as movement, light, or sound. Motors are a type of actuator.A motor spinning a wheel on a robot is an actuator, as it takes an electrical signal from the robot's brain and turns it into physical rotation. MotorAn electrical machine that converts electrical energy into mechanical energy, typically in the form of rotational motion.The small DC motor inside a toy car that makes its wheels turn. DC MotorA Direct Current motor is a simple type of motor that runs on direct current electricity and typically spins continuously in one direction when power is applied.The motor in a small fan or a basic robot's drive wheels. Servo MotorA type of motor that allows for precise control of...
3

Core Syntax & Patterns

Motor On/Off Control Principle To turn a DC motor on, provide sufficient voltage and current. To turn it off, remove the voltage or break the circuit. Microcontrollers typically use digital output pins (HIGH for ON, LOW for OFF) connected to a motor driver to switch the motor's power supply. This allows the motor to start or stop spinning. Motor Direction Control Principle (H-Bridge) The direction of a DC motor's rotation is determined by the polarity of the voltage applied across its terminals. Reversing the polarity reverses the direction. An H-bridge motor driver uses four switches to allow current to flow in two different directions through the motor, enabling forward and reverse rotation. By setting specific input pins on the driver HIGH or LOW, you can contro...

5 more steps in this tutorial

Sign up free to access the complete tutorial with worked examples and practice.

Sign Up Free to Continue

Sample Practice Questions

Challenging
A line-following robot uses a light sensor, a microcontroller, and a DC motor with a driver. Which statement correctly describes the roles and interaction of these components?
A.The motor (actuator) tells the sensor (input) where the line is, and the microcontroller provides power.
B.The sensor (input) detects the line, the microcontroller (processor) decides how to move, and the motor (actuator) performs the movement.
C.The microcontroller (actuator) senses the line, the motor (processor) decides how to move, and the sensor provides power.
D.The sensor (processor) sends a signal to the motor (input), which then tells the microcontroller (actuator) to move.
Challenging
A student writes code to control motor speed using `analogWrite()`, but connects the motor driver's PWM/Enable pin to a regular digital pin (not a PWM pin). What is the most likely behavior of the motor when they call `analogWrite(motorPin, 100)`?
A.The motor will run at full speed.
B.The motor will not run at all.
C.The motor will run at approximately 40% speed (100/255).
D.The motor will spin backwards.
Challenging
A project requires a small door to open exactly 90 degrees, hold its position against gravity, and then close. Why is a servo motor a better choice for this task than a DC motor with an H-bridge?
A.DC motor cannot be reversed using an H-bridge.
B.servo motor has a built-in control system and gearbox to move to and hold a precise angle, whereas a DC motor would require a complex external sensor and feedback loop to do the same.
C.servo motor uses less power than a DC motor, which is important for a door.
D.DC motor is not strong enough to hold a door against gravity.

Want to practice and check your answers?

Sign up to access all questions with instant feedback, explanations, and progress tracking.

Start Practicing Free

More from Robotics and Physical Computing: Introduction to Sensors and Actuators

Ready to find your learning gaps?

Take a free diagnostic test and get a personalized learning plan in minutes.