Book Image

Robotics at Home with Raspberry Pi Pico

By : Danny Staple
Book Image

Robotics at Home with Raspberry Pi Pico

By: Danny Staple

Overview of this book

The field of robotics is expanding, and this is the perfect time to learn how to create robots at home for different purposes. This book will help you take your first steps in planning, building, and programming a robot with Raspberry Pi Pico, an impressive controller bursting with I/O capabilities. After a quick tour of Pico, you’ll begin designing a robot chassis in 3D CAD. With easy-to-follow instructions, shopping lists, and plans, you’ll start building the robot. Further, you’ll add simple sensors and outputs to extend the robot, reinforce your design skills, and build your knowledge in programming with CircuitPython. You’ll also learn about interactions with electronics, standard robotics algorithms, and the discipline and process for building robots. Moving forward, you’ll learn how to add more complicated sensors and robotic behaviors, with increasing complexity levels, giving you hands-on experience. You’ll learn about Raspberry Pi Pico’s excellent features, such as PIO, adding capabilities such as avoiding walls, detecting movement, and compass headings. You’ll combine these with Bluetooth BLE for seeing sensor data and remotely controlling your robot with a smartphone. Finally, you’ll program the robot to find its location in an arena. By the end of this book, you’ll have built a robot at home, and be well equipped to build more with different levels of complexity.
Table of Contents (20 chapters)
1
Part 1: The Basics – Preparing for Robotics with Raspberry Pi Pico
7
Part 2: Interfacing Raspberry Pi Pico with Simple Sensors and Outputs
12
Part 3: Adding More Robotic Behaviors to Raspberry Pi Pico

To get the most out of this book

You will need to have knowledge of a few Python basics, such as variables, looping, conditionals, and functions. A well-lit and ventilated desk space is recommended for the robot-building aspects of the book. Access to hand tools will help, although you will be shown which tools to shop for. The robot code examples have been tested on CircuitPython 7.2.0 on Raspberry Pi Pico but should work with later versions. The computer code examples were tested on Python 3.9.

Software/hardware covered in the book

Operating system requirements

Thonny > 3.3 or Mu Editor > 1.1

macOS, Linux, or Windows

Python 3.7 or later

macOS, Linux, or Windows

Matplotlib 3.6.1 or later

macOS, Linux, or Windows

NumPy 1.23.4 or later

macOS, Linux, or Windows

Bleak (Python BLE library) 0.19.0 or above

macOS, Linux, or Windows

Free USB port

macOS, Linux, or Windows

Smartphone/tablet with Bluetooth LE (Bluetooth > 4.0)

iOS or Android

Adafruit Bluefruit LE Connect > 3.3.2

iOS or Android

Bluetooth LE-enabled laptop (or BLE dongle)

macOS, Linux, or Windows

FreeCAD

macOS, Linux, or Windows

Raspberry Pi Pico

CircuitPython > 7.2.0

Raspberry Pi Pico

Thonny comes with a built-in Python 3.x installation. The Tools | Open System shell menu can be used to install packages in Thonny’s Python.

If you are using the digital version of this book, we advise you to type the code yourself or access the code from the book’s GitHub repository (a link is available in the next section). Doing so will help you avoid any potential errors related to the copying and pasting of code.

Help for this book can be found by: