31,19 €
This book will allow you to take full advantage of Raspberry Pi Zero and Raspberry Pi 3 by building both simple and complex robotic projects. The book takes a mission-critical approach to show you how to build amazing robots and helps you decide which board to use for which type of robot. The book puts a special emphasis on designing mobile (or movable) robots using the Raspberry Pi Zero. The projects will show inexpensive, yet powerful, ways to take full advantage. It will teach you how to program Raspberry Pi, control the movement of your robot, and add features to your robots.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 172
Veröffentlichungsjahr: 2016
Copyright © 2016 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the author, nor Packt Publishing, and its dealers and distributors will be held liable for any damages caused or alleged to be caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
First published: February 2014
Second edition: April 2015
Third edition: October 2016
Production reference: 1041016
Published by Packt Publishing Ltd.
Livery Place
35 Livery Street
Birmingham
B3 2PB, UK.
ISBN 978-1-78646-796-6
www.packtpub.com
Author
Richard Grimmett
Copy Editor
Safis Editing
Reviewer
Jon Witts
Project Coordinator
Suzanne Coutinho
Commissioning Editor
Kartikey Pandey
Proofreader
Safis Editing
Acquisition Editor
Tushar Gupta
Indexer
Rekha Nair
Content Development Editor
Merint Mathew
Graphics
Abhinash Sahu
Technical Editor
Hussain Kanchwala
Production Coordinator
Shraddha Falebhai
Richard Grimmett has always been fascinated by computers and electronics from his very first programming project that used Fortran on punch cards. He has a bachelor's and master's degree in electrical engineering and a PhD in leadership studies. He also has 26 years of experience in the Radar and Telecommunications industries and even has one of the original brick phones. Currently, he teaches computer science and electrical engineering at Brigham Young University, Idaho, where his office is filled with many of his robotics projects.
This book is the result of working with many of the wonderful students at BYU-Idaho. It also wouldn’t be possible without the help of my wonderful wife, Jeanne.
Jon Witts has been working in the IT industry since 2002, specifically in educational IT since 2004. He was introduced to Linux back in 2001 through his collaboration with two German artists who were visiting the arts organisation he was then working with. Having studied fine arts and educational technology, he sought to innovate with open and accessible digital technologies within his creative practice and is happiest when deconstructing technology and finding its limits.
Jon has embedded the use of Raspberry Pi computers in his school as an integral part of the delivery of the computer science curriculum, as well as to run various school clubs and projects. Jon is a Raspberry Pi Certified Educator and also helps to organize and run the Hull Raspberry Jam events.
I would like to thank my wife, Sally, and our three daughters for putting up with all the cables and components around the house, and not least for being so tolerant of the need to dodge the robots racing around the kitchen floor!
For support files and downloads related to your book, please visit www.PacktPub.com.
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.PacktPub.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.PacktPub.com, you can also read a collection of free technical articles, sign up for a range of free newsletters and receive exclusive discounts and offers on Packt books and eBooks.
https://www.packtpub.com/mapt
Get the most in-demand software skills with Mapt. Mapt gives you full access to all Packt books and video courses, as well as industry-leading tools to help you plan your personal development and advance your career.
With the introduction of the Raspberry Pi just a few short years ago, a whole new world of do-it-yourself projects have come to life. This inexpensive but powerful processor provides a wide range of possibilities. When married with third-party hardware and free open source software, the opportunities are endless.
This book provides a step-by-step guide to at least some of these projects. Each chapter will introduce you to a new and different type of project. Each project will have very specific challenges and opportunities to learn new and cool ways to use the Raspberry Pi. Now, these chapters are really just an introduction to the topic; each of these projects would take an entire book to cover all the different aspects.
The book will hopefully inspire you to take the many different skills you have learned and mix and match them into entirely different projects with new and creative capabilities. Explore, for that is the overall theme of this book and of the Raspberry Pi.
Chapter 1, Getting Started with the Raspberry Pi, covers the details of setting up a useful development environment on the Raspberry Pi. The chapter begins with a discussion on how to connect power and continues through setting up a full system that is configured and ready to begin connecting any of the amazing devices and software capabilities to develop advanced robotics applications.
Chapter 2, Building Your Own Futuristic Robot, talks about the amazing things you can do with the Raspberry Pi, such as control a wheeled robot. This chapter will show you how to add a motor control so you can build your very own autonomous mobile robot. Additionally, one of the amazing features of today’s computer system is the ability to input commands and provide output without a screen or keyboard. A few years ago, the concept of a computer that can talk and listen was science fiction, but today it is becoming a standard part of new cell phones. You’ll take a standard toy R2D2 and turn it into a responsive robot.
Chapter 3, Building a Wall-E Robot, talks about another impressive robotic project, which is a robot modeled after Wall-E—a robot with a tracked base and articulating arms. Servos can be controlled using the Raspberry Pi and some additional USB-controlled hardware. Our robot will also use a Microsoft Kinect to not only have vision but depth perception as well.
Chapter 4, Building a Robotic Fish, shows you how to build your very own robot that can swim and show you the world under the water—wouldn’t a swimming robot be cool?
Chapter 5, Creating a Robotic Hand with the Raspberry Pi, talks about how you have a full toolkit of possibilities now, and how you can use them to build and control a robotic hand that can see and respond to the world around it. In this case, you’ll program your hand to follow the movements of your hand using a webcam.
Chapter 6, A Self-Balancing Robot, discusses the many recent robotic toys that were built on the concept of self-balancing two-wheeled platform. This chapter shows you how to build a robot that can balance and move using only two wheels.
Chapter 7, Adding the Raspberry Pi to a Quadcopter, introduces you to the concept of building a robot that can fly. A robot that can walk, talk, or move is cool, but one that can fly is the ultimate.
This book is for hobbyists and programmers who are excited about using the Raspberry Pi 3 and Raspberry Pi Zero. It is for those who are taking their first steps towards using these devices to control hardware and software and write simple programs that enable amazing projects. No programming experience is required, just a little computer and mechanical aptitude and the desire to build some interesting projects.
To download the requisite software list, please refer to the following links: https://www.packtpub.com/sites/default/files/downloads/RaspberryPiRoboticProjectsSoftwareList.pdf
Feedback from our readers is always welcome. Let us know what you think about this book—what you liked or disliked. Reader feedback is important for us as it helps us develop titles that you will really get the most out of.
To send us general feedback, simply e-mail [email protected], and mention the book's title in the subject of your message.
If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, see our author guide at www.packtpub.com/authors.
Now that you are the proud owner of a Packt book, we have a number of things to help you to get the most from your purchase.
We also provide you with a PDF file that has color images of the screenshots/diagrams used in this book. The color images will help you better understand the changes in the output. You can download this file from https://www.packtpub.com/sites/default/files/downloads/RaspberryPiRoboticProjectsThirdEdition_ColorImages.pdf.
Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you find a mistake in one of our books—maybe a mistake in the text or the code—we would be grateful if you could report this to us. By doing so, you can save other readers from frustration and help us improve subsequent versions of this book. If you find any errata, please report them by visiting http://www.packtpub.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details of your errata. Once your errata are verified, your submission will be accepted and the errata will be uploaded to our website or added to any list of existing errata under the Errata section of that title.
To view the previously submitted errata, go to https://www.packtpub.com/books/content/support and enter the name of the book in the search field. The required information will appear under the Errata section.
Piracy of copyrighted material on the Internet is an ongoing problem across all media. At Packt, we take the protection of our copyright and licenses very seriously. If you come across any illegal copies of our works in any form on the Internet, please provide us with the location address or website name immediately so that we can pursue a remedy.
Please contact us at [email protected] with a link to the suspected pirated material.
We appreciate your help in protecting our authors and our ability to bring you valuable content.
If you have a problem with any aspect of this book, you can contact us at [email protected], and we will do our best to address the problem.
Welcome to the exciting world of Raspberry Pi! Since its introduction just a few years ago, it has gained a huge following of Do-It-Yourselfers, who use the small but versatile processor family to build a wide variety of projects, and for good reason. The entire set of Raspberry Pi offers a range of solid performance at a low cost. With the addition of inexpensive additional hardware and free, open source software, the Raspberry Pi can be used to produce a wide range of projects, including robots that can roll, walk, fly, and swim.
The Raspberry Pi can do amazing things, but first you'll need to understand how to access all of this capability. In this chapter, you'll learn about the following subjects:
There are several versions of the Raspberry Pi, but there are two versions that you can choose to do the projects in this book. The first is the Raspberry Pi Zero, the smallest and least expensive of the Raspberry Pi processor boards. It boasts a Broadcom BCM2835 application processor that features a 1 GHz ARM11 core and 512MB of LPDDR2 SDRAM. The board also has a microSD card slot, a mini HDMI socket for 1080p60 video output, micro USB sockets for data and power, and a 40-pin GPIO header in a small form factor.
The other choice is the Raspberry Pi 3, a slightly larger version, but with higher performance and more hardware connections built right into the board. The Raspberry Pi 3 offers a 1.2 GHz 64-bit quad-core ARM Cortex-A53 CPU (~3 x the performance of the Raspberry Pi Zero). In contrast to the Raspberry Pi Zero, it has a built-in microSD card slot, a standard HDMI socket for 1080p60 video output, a micro USB socket for power, a built-in four-port USB connector, and a 40-pin GPIO header. It also provides Integrated 802.11n wireless LAN and Bluetooth 4.1. If you are not sure which board is right for you, it may make sense to read through this chapter, see how to power up and configure both, and then decide which is right for you.
The Raspberry Pi 3, with more hardware available as part of the standard product, is similar, but a bit easier to configure, than the Raspberry Pi Zero, since almost all the hardware you need is available right on the Raspberry Pi 3.
Here are the items you'll need to set up the Raspberry Pi 3:
Before you get started, let's get familiar with the Raspberry Pi 3. Here is an image of the hardware:
Here are the connections labeled for your information:
One of the first things you'll need to do is provide power for the board.
One of the first issues you'll want to consider is how to power the board. To do this, you need to connect through the USB power connection. There are two choices for providing power to the Raspberry Pi Zero:
In both cases, make sure that the unit can supply enough current. You'll need a supply that can provide at least 1000 mA at 5V. Do not plug in the board just yet; you first need to connect the rest of the hardware and configure the micro SD card. However, you are now ready to connect the rest of the hardware.
The next step is to connect a keyboard, mouse, and display to the Raspberry Pi 3. For the Raspberry Pi 3, this is very straightforward: simply plug the USB connectors of the keyboard and mouse into one of the four USB connectors on the Raspberry Pi 3.
Now, you'll also need a display. There are a number of different video standards; here is an image of some of the most common ones, for reference:
There is an HDMI connector on the Raspberry Pi 3. You can connect directly to an HDMI display using an HDMI cable. If your display has a DVI connector, you can purchase an HDMI to DVI cable.
You are almost ready to plug in the Raspberry Pi 3. Even though your hardware configuration is complete, you'll still need to complete the next section to power on the device. So, let's figure out how to install an operating system.
Now that your hardware is ready, you need to download and image an operating system to a microSD card. The Raspberry Pi 3 provides a lot of different choices. You'll stick with Linux, an open source version of Unix, on your Raspberry Pi 3. Linux, unlike Windows, Android, or iOS, is not tightly controlled by a single company. It is a grassroots effort from a wide community, mostly open source and, while it is available for free, it grows and develops a bit more chaotically.
A number of different versions of Linux have emerged, each built on a core set of similar capabilities referred to as the Linux kernel. These core capabilities are all based on the Linux specification. However, they are packaged slightly differently, and developed, supported, and packaged by different organizations. The Raspberry Pi community has become standardized on Raspbian, a Debian distribution of Linux for the Raspberry Pi. So, you are going to install and run Raspbian on your Raspberry Pi 3.