IntroductIon Welcome to learn robotIcs WIth raspberry pI In thIs book you and I WI ll go on an excItIng adventure through electronIcs code and robotIcs I’ll shoW you hoW to use the raspberry pI mInIcomputer to buIld your very OWN customIzable robot from the ground up
Along the way we’ll undertake a series of projects that will give your robot awesome abilities from remote control to following lines to recognizing objects and more By the end of this book you’ll be equipped with the programming programming and engineering skills to embark upon years of robotics and computer science fun and should have the basic understanding you need to make your craziest robot ideas come to life This book also introduces many other areas of computing along the way including coding in one of the most popular programming languages around Python This is the perfect first step for anybody with an interest in computers and technology Why Build and learn aBout roBots Robots are all around us They build the products you use every day They save lives in surgery They even explore Mars and the rest of our solar system As tech improves humans rely on robots more and more to make our lives easier better and safer With the rise of artificial intelligence it won’t be long until things like driverless cars and smart robotic companions are the norm There has never been a better time to learn about robotics whether that’s just to satisfy your own curiosity or to embark on a future lucrative career And besides if you understand even just a little bit about robots you’ll have a much better chance at surviving the robot uprising Just kidding By building robots you gain experience and understanding in a vast range of areas Making things Check Electronics engineering engineering Check Software programming Check This book is the perfect introduction to all three But beyond all that I can boil down why you should build robots into a single statement because it’s fun There is something uniquely intriguing and exciting about watching something you have made run around on the floor avoid obstacles or flash lights Robotics hooked me into the world of computer science when I was 13 years old and it hasn’t let go since
Why the raspberry pi The Raspberry Pi is a 35 credit card size computer that was created to provide people with an inexpensive introduction to programming programming and electronics Despite its small size and low cost each Pi is a fully functional computer that can do pretty much everything you would expect from running programs to word processing and web browsing Raspberry Pi is a great platform to learn robotics with It’s cheap small easily powered and incredibly accessible You can program a Pi in almost any language you can imagine and embed it into all sorts of electronics projects A Pi hits just the right sweet spot between power and simplicity meaning you can create robots without limitations Since it was launched out of Cambridge UK in 2012 the Raspberry Pi has gained a massive worldwide following and community community Millions of people share their progress projects and ideas online which makes it easy for beginners to improve and learn from someone who knows more There are also many in-person events where you can chat and show off your achievements These are usually lovingly called Raspberry Jams and they take place around the globe What is in this Book This book is project-based and revolves around a two-wheeled robot that I’ll show you how to make from scratch You’ll improve this robot project by project adding components and coding new functionality At each stage of the book I’ll provide comprehensive instructions and explanations of each build and the program behind it You can also download the full code and resources for free from https nostarch com raspirobots Any updates or further notes from the book can also be found there Take a look at what’s in store for you in each chapter Chapter 1 Getting Up and Running takes you on a tour of the Raspberry Pi and its features I also show you how to install the operating system and set it up for use over your local network using SSH In this chapter you’ll meet the terminal and write your first Python program
Chapter 2 Electronics Basics introduces electricity what it is and how we can harness it You’ll find two beginner projects in this chapter that are great for starting off your adventures before you start making robots By the end you’ll be able to make circuits that blink an LED and respond to a button Chapter 3 Building Your Robot begins your robotic journey Here you’ll start to build your robot We’ll build the base with motors and wheels and you’ll find lots of guidance about the different parts of your robot and how to wire it up Chapter 4 Making Your Robot Move gives your fully constructed constructed robot the power of movement with complete remote control using a Nintendo Wiimote You’ll use Python code to make your robot move first in a simple pattern and then by just tilting and orienting a Nintendo Wiimote Mario Kart style Chapter 5 Avoiding Obstacles gives you your first taste of robotic autonomy In this project you’ll use an ultrasonic distance sensor to give your robot the ability to sense and avoid obstacles in its way You’ll never crash again Chapter 6 Customizing with Lights and Sound allows you to customize your robot with super-bright lights and speakers You’ll be able to program your own dazzling light shows and connect a 3 5 mm speaker to your Raspberry Pi so that your robot can emit noises like a car horn Chapter 7 Line Following shows you how to use sensors and code to make your robot follow a black line It will be racing around a track all by itself in no time at all Chapter 8 Computer Vision Follow a Colored Ball is the most advanced project of this book and introduces image processing one of the most high-tech areas of computer science In this chapter chapter your robot will use the official Raspberry Pi Camera Module and computer vision algorithms to recognize and follow a colored ball no matter where it is in your robot’s environment