What this book covers
Chapter 1, Planning a Robot with Raspberry Pi Pico, introduces Raspberry Pi Pico in relation to other robotics main controllers. It shows the advantages of the CircuitPython programming environment and takes you through making an overview plan for a robot build built around Pico. The chapter provides a robot hardware shopping list for the first half of the book, discussing the parts and trade-offs in choosing them.
Chapter 2, Preparing Raspberry Pi Pico, takes you through getting CircuitPython onto Pico, then taking your first steps in writing code with it. It will also cover soldering headers onto Raspberry Pi Pico so it can connect to robot parts.
Chapter 3, Designing a Robot Chassis in FreeCAD, introduces FreeCAD while turning the overview plan into 3D CAD designs. It shows you how to make drawings from the design for building the robot parts.
Chapter 4, Building a Robot around Pico, shows how you can use CAD drawings with hand tools to craft robot parts by cutting and drilling sheet plastic. It guides you in assembling the parts then wiring and connecting the electronics. This chapter is where the robot is first powered on!
Chapter 5, Driving Motors with Raspberry Pi Pico, introduces you to controlling motors with CircuitPython and Raspberry Pi Pico, showing how motors can be used to make line motions and turns and how speed can be controlled. The chapter then shows you how to pull these together into programmed motion sequences.
Chapter 6, Measuring Movement with Encoders on Raspberry Pi Pico, introduces the first robotic sensor in the book with wheel encoders, showing you how to detect wheel movement in code. The chapter covers the Raspberry Pi Pico PIO peripheral as a powerful way to manage these sensors.
Chapter 7, Planning and Shopping for More Devices, prepares you for the next section of the book with distance sensors, Bluetooth LE, and an inertial measurement unit (IMU), with further advice on choosing the devices and how they will be attached. The chapter provides a shopping list for the latter part of the book. You will revisit FreeCAD part design to make sensor mounts, and then use tools to cut them.
Chapter 8, Sensing Distances to Detect Objects with Pico, takes you through attaching and wiring two distance sensors into the robot. The chapter provides information on I2C communication and then shows you how to program the robot to communicate with the sensors. You will then build code for the robot to autonomously avoid walls.
Chapter 9, Teleoperating Raspberry Pi Pico Robot with Bluetooth LE, makes a comparison of wireless connection options, showing why Bluetooth LE was a suitable design choice. You will connect a Bluetooth LE module to the robot, then extend existing code to output sensor data through this connection, and display the output on a smartphone. You will also see how to drive the robot from a smartphone.
Chapter 10, Using the PID Algorithm to Follow Walls, provides an introduction to the PID algorithm, a fundamental building block for sensor/output control behaviors in robotics. We build a wall-following demonstration using a distance sensor, then show you how to tune the PID with smartphone plots via Bluetooth LE.
Chapter 11, Controlling Motion with Encoders on Raspberry Pi Pico, revisits encoders, showing you how to convert their output into units understandable by humans. You will learn how to combine these sensors with the PID algorithm to control motor speeds and drive in a straight line. You will then program the robot to drive a specified distance in a straight line at a specified speed.
Chapter 12, Detecting Orientation with an IMU on Raspberry Pi Pico, introduces the IMU, a sensor that lets you determine the orientation of the robot. The chapter provides a guide on connecting the sensor and calibrating it. You will use the IMU with the PID algorithm for a behavior that makes a robot always face north. Finally, the chapter shows you how to program the robot to make a specified turn using the IMU.
Chapter 13, Determining Location with Monte Carlo, will show you how to program a robot to determine where it is likely to be in an arena. You’ll use plans in the chapter to build a foam board arena and model this arena in code. You are shown how to visualize this space on a computer using Bluetooth LE with Matplotlib. You will then learn about moving robot poses based on sensor input. The chapter shows how multiple robot behaviors can cooperate in the same application. You will be introduced to using probability algorithms in robot motion, making predictions, and refining them.
Chapter 14, Continuing Your Journey – Your Next Robot, provides a summary of the topics learned in the book, with information on digging deeper into each of them. The chapter provides ideas and research areas for you to extend all the aspects of the robot, and then further suggestions to build more ambitious robots and grow your skills. The chapter also recommends robotics communities you could participate in.