INTRODUCTION

WELCOME TO LEARN ROBOTICS WITH RASPBERRY PI! IN THIS BOOK, YOU AND I WILL 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 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? 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 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. 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 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 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.

WHO IS THIS BOOK FOR?

Learn Robotics with Raspberry Pi is a book for anybody who is interested in robots, programming, and electronics. No assumptions are made about ability, and I steer well clear of confusing, unexplained jargon throughout. People of all ages and backgrounds can learn something from the easy-to-follow projects and guidance.

WHERE SHOULD YOU BUY PARTS?

Over the course of this book and the projects it contains, you’ll need various bits and pieces: electronic components, making materials, and a few more tools. Don’t worry, though—everything is affordable and widely available. There will be specific advice in each chapter, but in general everything you need can be picked up online on sites such as eBay and Amazon.

All of the electronic components in the book can be purchased from online shops like eBay (https://www.ebay.com/) or dedicated online electronics stores such as Adafruit (https://www.adafruit.com/), Pimoroni (https://shop.pimoroni.com/), The Pi Hut (https://thepihut.com/), CPC Farnell (http://cpc.farnell.com/), and RS Components (http://uk.rs-online.com/web/). This list is by no means exhaustive and you may find cheaper, closer online retailers in your own country. You might even be fortunate enough to have a local electronics hardware store where you can grab your stuff!

I’ll introduce and explain the exact parts you’ll need in each pro­ject, but here’s a full list of everything you’ll use in the book:

Chapter 1

  • Raspberry Pi 3 Model B+
  • 8GB+ microSD card
  • HDMI cable, USB keyboard/mouse
  • 5 V micro USB power adapter

Chapter 2

  • 400-point breadboard
  • An LED with appropriate resistor
  • M-F/F-F/M-M jumper wires
  • Momentary push button

Chapter 3

  • A chassis for your robot (I make mine out of LEGO)
  • Two brushed 5 V to 9 V motors with tires
  • Six AA battery holder
  • Six AA batteries (I recommend rechargeable)
  • LM2596 buck converter module
  • L293D motor driver chip

Chapter 4

  • Nintendo Wii remote
  • For earlier models: Bluetooth dongle for Pis prior to Model 3/Zero W

Chapter 5

  • HC-SR04 ultrasonic distance sensor
  • A 1 kΩ resistor and a 2 kΩ resistor

Chapter 6

  • NeoPixel stick with headers
  • A small 3.5 mm speaker

Chapter 7

  • Two TCRT5000-based infrared line-following sensor modules

Chapter 8

  • An Official Raspberry Pi Camera Module
  • A colored ball

You’ll also find these tools/materials handy along the way:

  • Variety of screwdrivers
  • Hot-glue gun
  • Multimeter
  • Soldering iron
  • Wire stripper
  • Sticky tack/Velcro/3M Dual Lock

LET’S GET STARTED!

In short: robots and Raspberry Pi are awesome. Now that that’s out of the way and we’re acquainted, it’s time to get going! Just turn the page to begin your robotic adventures . . .

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.130.31