Learning Arduino: Pulse Width Modulation
1h 17mIntermediate2015-09-30
Authors

Rae Hoyt
Creative soul with a technical mind
Course details
Pulse width modulation (PWM) is an essential skill for connecting Arduino microcontrollers to motors or lights, providing a way to approximate analog voltage levels with digital signals. Using PWM, you can control and program the brightness of lights and the speed of motors—bringing your projects to life. Join Rae Hoyt in this course and learn how to harness the power of PWM to drive digital circuits. She shows how to use the built-in PWM libraries and functions, troubleshoot code and hardware, and use analog input controls to drive servos, motors, and RGB LEDs. Take the practice challenges along the way to test your learning and see how far your Arduino skills are progressing.
Learning objectives
Using basic PWM output
Adjusting the brightness of LEDs
Color mixing with RGB LEDs
Using analog inputs to drive output
Testing components with a multimeter
Using the map function
Debugging code efficiently with the serial monitor
Controlling servos and motors
Learning objectives
Using basic PWM output
Adjusting the brightness of LEDs
Color mixing with RGB LEDs
Using analog inputs to drive output
Testing components with a multimeter
Using the map function
Debugging code efficiently with the serial monitor
Controlling servos and motors
Skills covered
ArduinoMicrocontrollersHardwareDeep Dive (X:Y)
Concepts
0. Introduction
- 01 - Welcome
- 02 - What you should know
- 03 - Using the exercise files
- 04 - Challenges
1. Introduction to Pulse-Width Modulation (PWM)
- 05 - Exploring the fundamentals of PWM
- 06 - Using basic PWM output
- 07 - Faking PWM on a non-PWM pin
- 08 - Challenge - Matching PWM and non-PWM LED brightness
- 09 - Solution - Matching PWM and non-PWM LED brightness
2. Using Analog Inputs to Drive PWM Output
- 10 - Introducing various analog inputs
- 11 - Understanding the basics of analog input
- 12 - Finding logic bugs in your code
- 13 - Testing components with a multimeter
- 14 - Using the map function
- 15 - Challenge - Understanding the math behind the map function
- 16 - Solution - Understanding the math behind the map function
3. LED and PWM
- 17 - Fading an LED with PWM with code
- 18 - Calibrating an analog input to fade an LED precisely
- 19 - Challenge - Programming an LED that reacts to brightness
- 20 - Solution - Programming an LED that reacts to brightness
- 21 - Using an RGB LED
- 22 - Mixing colors on an RGB LED using three analog inputs
- 23 - Challenge - Fading through the rainbow with PWM
- 24 - Solution - Fading through the rainbow with PWM
4. Motor Control
- 25 - Comparing DC motors, servos, and stepper motors
- 26 - Implementing basic servo control
- 27 - Controlling a servo with an analog input
- 28 - Controlling a continuous rotation servo with an analog input
- 29 - Controlling DC motor speed with an analog input and transistor
- 30 - Diving deeper into H bridge control
- 31 - Controlling a DC motor with an H bridge
- 32 - Challenge - Controlling a DC motor with an H bridge and potentiometer
- 33 - Solution - Controlling a DC motor with an H bridge and potentiometer
Next steps
- 34 - Conclusion
Related courses
- Learning Arduino: Interfacing with Hardware
- Learning Arduino: Foundations
- Learning Arduino: Interfacing with Analog Devices
- Machine Learning Foundations: Prototyping with Edge Impulse
- Arduino: Prototyping
- Machine Learning Foundations: Prototyping on the Edge
- Programming Foundations: Programming for Kids
- Introduction to MicroPython and Physical Computing