In the previous chapter, we covered how to measure temperature, humidity, light, and moisture. In this chapter, we will turn our attention to the control of motors and servos, which are common devices for creating physical movement and motion. The core concepts, circuits, and code you will learn in this chapter will open up a world of physical automation and robotics using your Raspberry Pi.
We will be learning how Pulse Width Modulation (PWM) is used to set the angle of a servo, and how we use an H-Bridge IC to control the direction and speed of a DC motor. We will look at stepper motors and how they can be controlled for precise movement.
Here is what we will cover in this chapter:
- Using PWM to rotate a servo
- Using an H-Bridge IC to control a motor
- Introduction to stepper motor control