Controlling a stepper motor using a RPZ and motor drivers

Now that we can handle any device that understands 3V or 5V signals, we'll use the Raspberry Pi Zero to controller a stepper motor. Stepper motors take digital inputs to turn the motor a single "step." A step is a specific rotation amount that the motor will turn for each input. Very precise motors may have hundreds of steps per rotation, which are great for things such as high-resolution 3D printers or CNC routers. The L293D motor driver makes it easy to control these motors with the Raspberry Pi Zero.

Getting ready

For this recipe, you will need an L293D chip and a stepper motor. There is a huge variety of stepper motors to choose from. I went with the 5V 28BYJ-48 motor included in the ...

Get Raspberry Pi Zero Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.