<p>Learn how to use a Raspberry Pi in conjunction with an Arduino to build a basic robot with advanced capabilities. Getting started in robotics does not have to be difficult. This book is an insightful and rewarding introduction to robotics and a catalyst for further directed study. </p> <p>You'll
Beginning Robotics with Raspberry Pi and Arduino: Using Python and OpenCV
✍ Scribed by Jeff Cicolani
- Publisher
- Apress
- Year
- 2021
- Tongue
- English
- Leaves
- 369
- Category
- Library
No coin nor oath required. For personal study only.
✦ Synopsis
Communicate between the Arduino and the Raspberry Pi
Use Python to program the logic and behavior of the robot
Track a ball using a basic USB webcam and OpenCV
✦ Table of Contents
Table of Contents
About the Author
About the Technical Reviewer
Introduction
Chapter 1: Introduction to Robotics
Robotics Basics
Linux and Robotics
Sensors and GPIO
Motion and Control
Raspberry Pi and Arduino
Project Overview
The Robot
Bill of Materials (BOM)
Summary
Chapter 2: An Introduction to Raspberry Pi
Downloading and Installing Raspberry Pi OS
Raspberry Pi OS with OpenCV
The “Hard” Way
The “Easy” Way
Connecting Raspberry Pi
Configuring Your Pi
Users
Securing Root
Change the Default Username
Going Headless
Remote Access
Remote Desktop with xrdp
SSH with PuTTY
Finding Your Device on a Network
Summary
Chapter 3: A Crash Course in Python
Python Overview
Downloading and Installing Python
Python Tools
The Python Shell
The Python Editor
The Zen of Python
Writing and Running a Python Program
Hello World
Basic Structure
Program Parts
Indentation
Comments
Running a Program
Programming in Python
Variables
Data Types
Strings
String Manipulation
Numbers
Lists
Tuples
Dictionaries
None Type
A Final Note on Variables
Control Structures
if Statements
Loops
for Loop
while Loop
Functions
Defining a Function
Passing Arguments
Default Values
Return Values
Adding Functionality Through Modules
Importing and Using Modules
Built-In Modules
Extended Modules
Custom Modules
Classes
Creating a Class
Planning
Initial Sample Robot Class
Initial Sample Robot Class
Styling
Blank Lines
Commenting
Naming Conventions
Summary
Chapter 4: Raspberry Pi GPIO
Raspberry Pi GPIO
Pin Numbering
Connecting to the Raspberry Pi
Limitations of Raspberry Pi’s GPIO
Accessing GPIO with Python
Simple Output: LED Example
Hooking Up the Circuit
Writing the Code
Pulse Width Modulation (PWM)
Hooking Up the Circuit
Writing the Code
Simple Input
Push-Button Example
Hooking Up the Circuit
Writing the Code
Sonic Rangefinder Example
Hooking Up the Circuit
Writing the Code
Summary
Chapter 5: Raspberry Pi and Arduino
Raspberry Pi’s GPIO in Review
Real-Time or Near-Real-Time Processing
Analog Input
Analog Output
Arduino to the Rescue
Using Arduino
Installing the Arduino IDE
Connecting an Arduino
Programming Arduino
The Arduino IDE
Icons and the Menu
Creating a New Sketch
Saving a Sketch
Opening Existing Sketches
Board and Port Selection
Cheating with Examples
Using Tabs and Multiple Files
Sketches
Hello, Arduino
Anatomy of a Sketch
A Brief Introduction to the Arduino Language
Including Other Files
Variables and Data Types
Characters and Strings
The String Object
Numbers
Arrays
Control Structures
if and else
while Loops
for Loops
Functions
Working with Pins
Digital Operations
Analog Input
Analog Output (PWM)
Pulsing LED
The Circuit
The Code
Objects and Classes
Serial
Connecting to Serial
Sending Serial Data
Receiving Serial Data
Arduino to Pi and Back Again
Installing PySerial
Sending Data to the Raspberry Pi
Sending Data to the Arduino
Pinguino
Setting Up the Circuit
The Code
Arduino
Raspberry Pi
Summary
Chapter 6: Driving Motors
Motors and Drivers
Types of Motors
DC Motors
Brushless Motors
Stepper Motors
Servos
Motor Properties
Voltage
Amperage
Motors and Amps
Motor Drivers
Working with Motor Controllers
Adafruit DC & Stepper Motor HAT
Some Assembly Required
Hooking Up the Motor Controller
Using the Motor HAT
Enabling I2C
Installing the Library
The Code
Turning a Single Motor
Turning Two Motors
L298N Generic Motor Driver
H-Bridge Motor Controller
Using the L298N
Arduino Code
Hooking Up the L298N
Turning One Motor
Turning Two Motors
Summary
Chapter 7: Assembling the Robot
Assembling the Chassis
Choosing a Material
The Whippersnapper
Mounting the Electronics
Wiring
Mounting Sensors
The Finished Robot
Making the Robot Mobile
The Plan
Sensors
Motors
Behavior
The Code
Arduino Code
Raspberry Pi Code
Summary
Chapter 8: Working with Infrared Sensors
Infrared Sensors
Types of IR Sensors
Reflectance Sensors
Line and Edge Detection
Rangefinders
Interrupt Sensors
PIR Motion Detectors
Working with IR Sensors
Connecting an IR Sensor
Mounting the IR Sensors
The Code
Arduino Code
Python Code
Understanding PID Control
Control Loops
Proportional, Integral, and Derivative Control
Proportional Control
Integral Control
Derivative Control
Bringing Them Together
Implementing the PID Controller
The Code
Raspberry Pi Code
Summary
Chapter 9: An Introduction to OpenCV
Computer Vision
OpenCV
Installing OpenCV
Installing the Prerequisites
Installing OpenCV with pip install
Compiling OpenCV from Source Code
Selecting a Camera
Installing the Camera
OpenCV Basics
Working with Images
Displaying an Image
Capturing Images
Opening an Image File
Capturing Video
Viewing the Camera
Recording Video
Reading Video from a File
Image Transformations
Flipping
Resizing
Working with Color
Color Spaces
Color Filters
Blobs and Blob Detection
Finding a Blob
The Parameters
The Filters
filterByColor
filterByArea
filterByCircularity
filterByInertia
filterByConvexity
Blob Tracking
Ball-Chasing Bot
Summary
Chapter 10: Conclusion
Types of Robotics
Tools
Software
Choosing an IDE
Design Software
2D Drawing
Circuit Board Design
3D Design
Hardware
Basic Tools
Specialty Tools
Makerspaces
Summary
Index
📜 SIMILAR VOLUMES
<p>Learn how to use a Raspberry Pi in conjunction with an Arduino to build a basic robot with advanced capabilities. Getting started in robotics does not have to be difficult. This book is an insightful and rewarding introduction to robotics and a catalyst for further directed study. </p> <p>You'll
<p>Learn how to use a Raspberry Pi in conjunction with an Arduino to build a basic robot with advanced capabilities. Getting started in robotics does not have to be difficult. This book is an insightful and rewarding introduction to robotics and a catalyst for further directed study. </p> <p>You'll