PWM stands for Pulse Width Modulation. It controls motor speed by changing the amount of time the power is ON versus OFF.
Click to reveal answer
beginner
How does PWM control the speed of a DC motor?
PWM changes the motor's speed by adjusting the duty cycle, which is the percentage of time the signal is HIGH in each cycle. More HIGH time means faster motor speed.
Click to reveal answer
beginner
Which Arduino function is used to generate a PWM signal?
The Arduino function analogWrite(pin, value) generates a PWM signal on the specified pin. The value ranges from 0 (always OFF) to 255 (always ON).
Click to reveal answer
intermediate
Why can't we use analogWrite to get a true analog voltage?
Because analogWrite creates a digital PWM signal that switches ON and OFF rapidly. The motor or device averages this to behave like an analog voltage.
Click to reveal answer
beginner
What is the typical range of PWM values for controlling motor speed on Arduino?
PWM values range from 0 to 255. 0 means motor is stopped, 255 means motor runs at full speed, and values in between control speed proportionally.
Click to reveal answer
What does a PWM duty cycle of 50% mean for motor speed?
AMotor runs at full speed
BMotor runs at double speed
CMotor is stopped
DMotor runs at half speed
✗ Incorrect
A 50% duty cycle means the power is ON half the time, so the motor runs roughly at half speed.
Which Arduino function is used to send a PWM signal to a motor?
AdigitalWrite()
BanalogWrite()
CpinMode()
Ddelay()
✗ Incorrect
analogWrite() sends a PWM signal by varying the duty cycle.
What happens if you set PWM value to 0 on Arduino motor control?
AMotor runs at full speed
BMotor runs at half speed
CMotor stops
DMotor reverses direction
✗ Incorrect
PWM value 0 means the signal is always OFF, so the motor stops.
Why is PWM preferred over a simple resistor to control motor speed?
APWM provides efficient speed control without heat loss
BPWM wastes more power
CResistors are cheaper
DPWM is slower to respond
✗ Incorrect
PWM controls speed efficiently by switching power ON and OFF rapidly, reducing heat loss compared to resistors.
What is the maximum PWM value you can use with Arduino's analogWrite()?
A255
B1023
C100
D500
✗ Incorrect
Arduino's analogWrite() uses values from 0 to 255 for PWM duty cycle.
Explain how PWM controls the speed of a DC motor using Arduino.
Think about how changing the time the motor gets power affects its speed.
You got /4 concepts.
Describe why PWM is more efficient than using a resistor to control motor speed.
Consider what happens to energy when power is switched ON and OFF quickly.
You got /4 concepts.
Practice
(1/5)
1. What does PWM do in motor speed control on an Arduino?
easy
A. It changes the motor's voltage permanently.
B. It switches power on and off quickly to control speed.
C. It changes the motor's direction.
D. It measures the motor's speed.
Solution
Step 1: Understand PWM function
PWM (Pulse Width Modulation) controls speed by rapidly switching power on and off.
Step 2: Compare options
Only It switches power on and off quickly to control speed. correctly describes PWM's role in speed control, others describe different functions.
Final Answer:
It switches power on and off quickly to control speed. -> Option B
Quick Check:
PWM controls speed by switching power on/off [OK]
Hint: PWM controls speed by fast power switching [OK]
Common Mistakes:
Thinking PWM changes voltage permanently
Confusing speed control with direction control
Believing PWM measures speed
2. Which Arduino function is used to set motor speed with PWM?
easy
A. pinMode(pin, OUTPUT)
B. digitalWrite(pin, value)
C. analogWrite(pin, value)
D. delay(value)
Solution
Step 1: Identify PWM function
analogWrite(pin, value) sets PWM signal on a pin with value 0-255 controlling speed.
analogWrite value ranges 0 (off) to 255 (full speed). 128 is about half of 255.
Step 2: Interpret speed from value
Value 128 means roughly half the power, so motor runs at about half speed.
Final Answer:
Motor runs at about half speed -> Option D
Quick Check:
128/255 ≈ half speed [OK]
Hint: PWM 128 means about half speed [OK]
Common Mistakes:
Thinking 128 means full speed
Assuming motor is off at 128
Believing speed can be doubled
4. Identify the error in this code snippet for motor speed control:
int speed = 300;
analogWrite(6, speed);
medium
A. Speed value is out of PWM range (0-255).
B. Pin 6 cannot be used for PWM.
C. analogWrite requires three arguments.
D. Variable speed must be declared as float.
Solution
Step 1: Check PWM value limits
analogWrite accepts values from 0 to 255. 300 is outside this range.
Step 2: Verify other options
Pin 6 supports PWM, analogWrite takes two arguments, and int is fine for speed.
Final Answer:
Speed value is out of PWM range (0-255). -> Option A
Quick Check:
PWM value must be 0-255 [OK]
Hint: PWM values must be 0 to 255 only [OK]
Common Mistakes:
Using values above 255 for PWM
Thinking analogWrite needs 3 arguments
Believing PWM pins are limited incorrectly
5. You want to smoothly increase motor speed from 0 to full over 5 seconds using PWM on pin 10. Which code snippet achieves this?
hard
A. for(int speed=0; speed<=255; speed++) { analogWrite(10, speed); delay(20); }
B. analogWrite(10, 255); delay(5000); analogWrite(10, 0);
C. for(int speed=255; speed>=0; speed--) { analogWrite(10, speed); delay(20); }
D. digitalWrite(10, HIGH); delay(5000); digitalWrite(10, LOW);
Solution
Step 1: Understand smooth speed increase
Gradually increasing PWM value from 0 to 255 in small steps with delay creates smooth speed change.
Step 2: Analyze code snippets
for(int speed=0; speed<=255; speed++) { analogWrite(10, speed); delay(20); } uses a for loop from 0 to 255 with delay(20)ms, totaling about 5 seconds. Others either jump speed or use digitalWrite which is not PWM.