Book Image

Raspberry Pi Zero Cookbook

Book Image

Raspberry Pi Zero Cookbook

Overview of this book

The Raspberry Pi Zero, one of the most inexpensive, fully-functional computers available, is a powerful and revolutionary product developed by the Raspberry Pi Foundation. The Raspberry Pi Zero opens up a new world for the makers out there. This book will give you expertise with the Raspberry Pi Zero, providing all the necessary recipes that will get you up and running. In this book, you will learn how to prepare your own circuits rather than buying the expensive add–ons available in the market. We start by showing you how to set up and manage the Pi Zero and then move on to configuring the hardware, running it with Linux, and programming it with Python scripts. Later, we integrate the Raspberry Pi Zero with sensors, motors, and other hardware. You will also get hands-on with interesting projects in media centers, IoT, and more.
Table of Contents (17 chapters)
Raspberry Pi Zero Cookbook
Credits
About the Author
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface

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 Elegoo starter kit, but any small 5V stepper motor (larger ones will need their own power supply) will work without additional power. Other than jumper cables, a breadboard, a 10uF capacitor, and your Raspberry Pi Zero, you should be ready to go!

How...