What is the purpose of an H-Bridge like L293D or L298N in motor control?
An H-Bridge allows you to control the direction of a DC motor by changing the polarity of the voltage applied to it. It can make the motor spin forward or backward safely.
Click to reveal answer
beginner
How do you make a motor spin forward using an H-Bridge?
You set one input pin HIGH and the other input pin LOW. This creates a voltage difference that makes the motor spin in one direction.
Click to reveal answer
beginner
What happens if both input pins of the H-Bridge are set to LOW?
The motor stops because there is no voltage difference across it. This is called stopping the motor.
Click to reveal answer
intermediate
Why do we need to connect the enable pin on the L293D or L298N?
The enable pin turns the motor driver channel ON or OFF. Setting it HIGH allows the motor to run; setting it LOW disables the motor output.
Click to reveal answer
beginner
What is the role of the Arduino pins connected to the H-Bridge inputs?
Arduino pins send signals (HIGH or LOW) to the H-Bridge inputs to control the motor's direction and speed (if PWM is used).
Click to reveal answer
Which pin configuration makes the motor spin backward using an H-Bridge?
AInput1 = LOW, Input2 = HIGH
BInput1 = HIGH, Input2 = HIGH
CInput1 = HIGH, Input2 = LOW
DInput1 = LOW, Input2 = LOW
✗ Incorrect
Setting Input1 LOW and Input2 HIGH reverses the voltage polarity, making the motor spin backward.
What does setting both input pins to HIGH do to the motor?
AMotor brakes or stops
BMotor spins backward
CMotor spins forward
DMotor runs at half speed
✗ Incorrect
Both inputs HIGH apply the same voltage to both motor terminals, causing the motor to brake or stop.
What is the function of the enable pin on an L293D motor driver?
AControls motor speed by PWM
BTurns the motor driver channel ON or OFF
CChanges motor direction
DSupplies power to the motor
✗ Incorrect
The enable pin activates or deactivates the motor driver channel, allowing or stopping motor operation.
Which Arduino command sets a pin to output mode?
ApinMode(pin, INPUT);
BdigitalWrite(pin, HIGH);
CanalogWrite(pin, 255);
DpinMode(pin, OUTPUT);
✗ Incorrect
pinMode(pin, OUTPUT) configures the Arduino pin to send signals to control devices like motors.
If you want to stop the motor immediately, what should you do with the input pins?
ASet one input HIGH and the other LOW
BSet both inputs LOW
CSet both inputs HIGH
DDisconnect the motor
✗ Incorrect
Setting both inputs HIGH applies the same voltage to both motor terminals, causing the motor to brake and stop immediately.
Explain how you control the direction of a DC motor using an H-Bridge like the L293D.
Think about how changing voltage direction changes motor spin.
You got /4 concepts.
Describe the role of the enable pin on an L293D or L298N motor driver and why it is important.
Consider how you can start or stop the motor without changing input pins.
You got /4 concepts.
Practice
(1/5)
1. Which of the following correctly describes how to make a motor spin forward using an H-Bridge (L293D/L298N) with two Arduino pins pinA and pinB?
easy
A. Set both pinA and pinB HIGH
B. Set pinA LOW and pinB HIGH
C. Set both pinA and pinB LOW
D. Set pinA HIGH and pinB LOW
Solution
Step 1: Understand motor direction control
To spin the motor forward, one pin must be HIGH and the other LOW to create current flow in one direction.
Step 2: Apply pin states for forward spin
Setting pinA HIGH and pinB LOW makes the motor spin forward.
Final Answer:
Set pinA HIGH and pinB LOW -> Option D
Quick Check:
Forward spin = pinA HIGH, pinB LOW [OK]
Hint: Forward spin means one pin HIGH, other LOW [OK]
Common Mistakes:
Setting both pins HIGH or LOW thinking motor spins
Confusing which pin should be HIGH for forward
Assuming both pins LOW spins motor forward
2. Which Arduino code snippet correctly sets pin1 HIGH and pin2 LOW to spin a motor forward using an H-Bridge?
easy
A. digitalWrite(pin1, LOW); digitalWrite(pin2, HIGH);
B. digitalWrite(pin1, HIGH); digitalWrite(pin2, LOW);
C. digitalWrite(pin1, HIGH); digitalWrite(pin2, HIGH);
D. digitalWrite(pin1, LOW); digitalWrite(pin2, LOW);
Solution
Step 1: Recall correct pin states for forward
Forward spin requires first pin HIGH and second pin LOW.
Step 2: Match code to pin states
Code in digitalWrite(pin1, HIGH); digitalWrite(pin2, LOW); sets pin1 HIGH and pin2 LOW correctly.
Final Answer:
digitalWrite(pin1, HIGH); digitalWrite(pin2, LOW); -> Option B
Quick Check:
Pin1 HIGH, Pin2 LOW = forward spin [OK]
Hint: HIGH then LOW means forward spin [OK]
Common Mistakes:
Swapping HIGH and LOW values
Setting both pins HIGH or LOW
Using analogWrite instead of digitalWrite
3. What will be the motor behavior when the following Arduino code runs?
digitalWrite(3, LOW);
digitalWrite(4, HIGH);
medium
A. Motor spins backward
B. Motor spins forward
C. Motor stops
D. Motor speed changes but direction stays same
Solution
Step 1: Identify pin states and their meaning
Pin 3 is LOW and pin 4 is HIGH, which reverses the current flow compared to forward spin.
Step 2: Determine motor direction
This pin combination makes the motor spin backward.
Final Answer:
Motor spins backward -> Option A
Quick Check:
LOW then HIGH = backward spin [OK]
Hint: LOW then HIGH means backward spin [OK]
Common Mistakes:
Assuming LOW then HIGH is forward spin
Thinking motor stops when pins differ
Confusing speed control with direction
4. The following code is intended to stop the motor, but it does not. What is the error?
digitalWrite(5, HIGH);
digitalWrite(6, HIGH);
medium
A. Pins must be set to LOW and HIGH to stop
B. Pins should be set to INPUT to stop motor
C. Both pins HIGH causes motor to brake, not stop
D. digitalWrite cannot be used to stop motor
Solution
Step 1: Understand stopping motor with H-Bridge
To stop the motor, both pins should be LOW to cut power and stop current flow.
Step 2: Analyze given pin states
Both pins are set HIGH, which causes the motor to brake but not coast to a stop.
Final Answer:
Both pins HIGH causes motor to brake, not stop -> Option C
Quick Check:
Stop motor = both pins LOW, not HIGH [OK]
Hint: Stop motor by setting both pins LOW [OK]
Common Mistakes:
Setting both pins HIGH thinking motor stops
Using INPUT mode instead of LOW
Confusing brake with stop
5. You want to write Arduino code to spin a motor forward for 3 seconds, then stop for 2 seconds, then spin backward for 3 seconds using pins 7 and 8 with an L298N. Which code snippet correctly implements this?