Practical Arduino Robotics

Book description

Build your hardware, electronics, and programming skills, and use them to realize your advanced robotics projects with this powerful platform

Purchase of the print or Kindle book includes a free PDF eBook

Key Features

  • Become an expert in selecting sensors, motors, and Arduino boards for any robotics project
  • Discover how to write effective and reusable code for your Arduino robotics projects
  • Learn to build a camera-based line follower and a self-balancing telepresence robot on your own

Book Description

Every robot needs a “brain,” and the Arduino platform provides an incredibly accessible way to bring your Arduino robot to life. Anyone can easily learn to build and program their own robots with Arduino for hobby and commercial uses, making Arduino-based robots the popular choice for school projects, college courses, and the rapid prototyping of industrial applications!

Practical Arduino Robotics is a comprehensive guide that equips you with the necessary skills and techniques that can be applied to various projects and applications, from automating repetitive tasks in a laboratory to building engaging mobile robots.

Building on basic knowledge of programming and electronics, this book teaches you how to choose the right components, such as Arduino boards, sensors, and motors, and write effective code for your robotics project, including the use of advanced third-party Arduino libraries and interfaces, such as Analog, SPI, I2C, PWM, and UART. You'll also learn different ways to command your robots wirelessly, such as over Wi-Fi. Finally, with basic to advanced project examples, this book illustrates how to build exciting autonomous robots like a self-balancing telepresence robot.

By the end of this book, you'll be able to design and create your own custom robots for a wide variety of applications.

What you will learn

  • Understand and use the various interfaces of an Arduino board
  • Write the code to communicate with your sensors and motors
  • Implement and tune methods for sensor signal processing
  • Understand and implement state machines that control your robot
  • Implement feedback control to create impressive robot capabilities
  • Integrate hardware and software components into a reliable robotic system
  • Tune, debug, and improve Arduino-based robots systematically

Who this book is for

If you're excited about robotics and want to start creating your own robotics projects from the hardware up, this book is for you. Whether you are an experienced software developer who wants to learn how to build physical robots, a hobbyist looking to elevate your Arduino skills to the next level, or a student with the desire to kick-start your DIY robotics journey, you'll find this book very useful. In order to successfully work with this book, you'll need basic familiarity with electronics, Arduino boards and the core concepts of computer programming.

Table of contents

  1. Practical Arduino Robotics
  2. Contributors
  3. About the author
  4. About the reviewers
  5. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
    4. Download the example code files
    5. Download the color images
    6. Conventions used
    7. Get in touch
    8. Share Your Thoughts
    9. Download a free PDF copy of this book
  6. Part 1: Selecting the Right Components for Your Robots
  7. Chapter 1: Introducing Robotics and the Arduino Ecosystem
    1. Technical requirements
    2. The main components of a robot
      1. What different types of robots are there?
    3. What is an Arduino microcontroller board?
      1. What is a microcontroller?
      2. What exactly is Arduino?
    4. The Arduino ecosystem
      1. The Arduino IDE
      2. The Arduino Uno
    5. How to program your Arduino board
      1. Installing the Arduino IDE
      2. Writing your first Arduino program
      3. Compiling the code for your Arduino board
      4. Transmitting the code to your Arduino board and running it
    6. Examples of Arduino robot technology
    7. Summary
    8. Further reading
  8. Chapter 2: Making Robots Perceive the World with Sensors
    1. Technical requirements
    2. Understanding common sensor characteristics
    3. Commonly used sensor types for Arduino robots
      1. Switches and buttons
      2. Distance sensors
      3. Encoders (rotary and linear)
      4. Temperature sensors
      5. Pressure sensors
      6. Light sensors
      7. Sound sensors
      8. GPS
      9. IMU
    4. Common sensor interfaces and code examples
      1. GPIO – great for simple sensors
      2. Analog is simple
      3. Serial interfaces
      4. Additional peripherals for working with sensors
    5. Summary
    6. Further reading
  9. Chapter 3: Making Your Robot Move and Interact with the World with Actuators
    1. Technical requirements
    2. Understanding electric motors and motor drivers
      1. Brushed DC motors
      2. Brushless DC motors
    3. Different motor types and how to use them
      1. Using RC servo motors
      2. Using brushed DC motors
      3. Using BLDC motors
      4. ESCs for BLDC motors
      5. Driving a BLDC motor with a sensorless ESC
      6. Using stepper motors
    4. Dedicated robot actuators and servo controllers
    5. Summary
    6. Further reading
  10. Chapter 4: Selecting the Right Arduino Board for Your Project
    1. Technical requirements
    2. Important characteristics of Arduino boards
      1. Input voltage and operating voltage
      2. Interfaces
      3. CPU
      4. Memory
      5. Additional hardware
      6. Size
      7. Cost
    3. An introduction to selected official Arduino boards
      1. Arduino Nano and Nano Every
      2. Arduino Mega
    4. A brief overview of third-party Arduino-compatible boards
      1. Adafruit Feather and Trinket M0
      2. SparkFun RedBoard
      3. Teensy
    5. Summary
    6. Further reading
  11. Part 2: Writing Effective and Reliable Robot Programs for Arduino
  12. Chapter 5: Getting Started with Robot Programming
    1. Technical requirements
    2. The general structure of an Arduino robot program
    3. Cooperative multitasking
      1. Running two tasks asynchronously
      2. Task execution with variable frequency
    4. State machines
    5. Blocking and non-blocking function calls
    6. Feedback control
      1. What is feedback control?
      2. Examples of feedback control systems
      3. The PID control algorithm
      4. Building a DC servo motor
    7. Summary
  13. Chapter 6: Understanding Object-Oriented Programming and Creating Arduino Libraries
    1. Technical requirements
    2. The OOP paradigm
    3. Writing and using the Blinker class
      1. Public and private class members
      2. Using our class definition
      3. The power of OOP
    4. Turning your class into an Arduino library
      1. The header file
      2. The source file
      3. Using the library in the Arduino IDE
      4. Adding examples
    5. Working with third-party Arduino libraries
      1. Adding library files manually
      2. Using the IDE’s Library Manager
    6. Summary
    7. Further reading
  14. Chapter 7: Testing and Debugging with the Arduino IDE
    1. Technical requirements
    2. Building modular robot hardware
      1. Mechanical components
      2. Electrical components
    3. Writing testable robot programs
    4. Using the Arduino IDE for testing and debugging
      1. Using the Serial Monitor as input
      2. Using the Serial Plotter for live visualization
    5. Summary
    6. Further reading
  15. Part 3: Building the Hardware, Electronics, and UI of Your Robot
  16. Chapter 8: Exploring Mechanical Design and the 3D Printing Toolchain
    1. Technical requirements
    2. Principles of mechanical design for DIY robots
      1. Keep it simple
      2. Make it modular
      3. Make a plan
    3. Exploring materials and manufacturing techniques
      1. Permanent connections
      2. Temporary connections
      3. Wood
      4. Acrylic
      5. Aluminum
      6. Other materials
    4. CAD
    5. 3D printing
      1. What is a 3D printer?
      2. 3D printers for DIY robotics
      3. Slicing
      4. Printing
      5. Additional tips for 3D printing
    6. Summary
    7. Further reading
  17. Chapter 9: Designing the Power System of Your Robot
    1. Technical requirements
    2. Fundamentals of electrical power systems
      1. Voltage, current, and power
    3. Understanding the power demands of your robot
    4. Safety considerations and hazards when working with high-power batteries
      1. Electric shock
      2. Arcing
      3. Excessive temperature
      4. Overvoltage
    5. Components and design of a robot power system
      1. Power distribution
      2. Monitoring
      3. Control and safety
      4. Putting it all together
    6. Summary
    7. Further readings
  18. Chapter 10: Working with Displays, LEDs, and Sound
    1. Technical requirements
    2. Advanced use of LEDs
      1. Dimming LEDs
      2. LED circuits
      3. Multicolor LEDs
      4. Other LEDs
    3. Using different types of displays
      1. Character displays
      2. Graphical displays
    4. Adding sound output to your robot
      1. Digital sound
      2. Analog sound
    5. Summary
    6. Further reading
  19. Chapter 11: Adding Wireless Interfaces to Your Robot
    1. Technical requirements
    2. What is a wireless interface
      1. When to use wireless interfaces
      2. The structure of a wireless interface
    3. Controlling your robot with a hobby remote control
      1. Decoding the receiver output
    4. Replacing the USB cable with a Zigbee module
      1. Hardware
      2. Software
      3. Using your XBee modules
      4. Other uses
    5. Controlling a robot from your phone via Bluetooth
      1. Hardware
      2. Bluetooth chat
      3. Bluetooth Plotter
      4. Bluetooth controller
    6. Connecting to your robot over Wi-Fi
      1. Hardware
      2. Setup
      3. Wi-Fi
      4. Next steps with Wi-Fi
    7. Summary
    8. Further reading
  20. Part 4: Advanced Example Projects to Put Your Robotic Skills into Action
  21. Chapter 12: Building an Advanced Line-Following Robot Using a Camera
    1. Technical requirements
    2. Line following – the “Hello, World!” of robotics
    3. Building a reliable mobile base
      1. Building the frame
      2. Adding motors and wheels
      3. Electronic components
    4. Wiring up the robot
      1. Battery and motor connections
      2. On-breadboard connections
      3. Inter-board connections
    5. Integrating the camera
      1. Electrical integration
      2. Mechanical integration
    6. Software
      1. Overview
      2. Motor control
      3. Bluetooth interface
      4. Line following
      5. Battery monitoring
      6. Hardware compatibility
    7. Tuning and testing
    8. Summary
    9. Further reading
  22. Chapter 13: Building a Self-Balancing, Radio-Controlled Telepresence Robot
    1. Technical requirements
    2. Building the robot
      1. Integrating motors and encoders
      2. Integrating the RC receiver
      3. Integrating the IMU
      4. Phone holder
    3. Writing the control software
      1. Driving the motors
      2. Encoder library
      3. Wheel velocity estimation
      4. Namespaces
      5. Pitch estimation with the IMU
    4. Controlling the robot
      1. Balance control
      2. Remote control
      3. Motor deadband compensation
      4. Auto on/off
      5. Parameter tuning
      6. Testing and practice
    5. Telepresence
    6. Summary
    7. Further reading
  23. Chapter 14: Wrapping Up, Next Steps, and a Look Ahead
    1. Technical requirements
    2. A quick recap
    3. The bigger picture
    4. Your next steps
      1. Becoming a DIY robotics master
      2. Focusing on mechanical engineering
      3. Focusing on electrical engineering
      4. Focusing on computer engineering and computer science
      5. Focusing on data-driven methods ML
    5. Trends in robotics
      1. ML/AI
      2. Cloud robotics
      3. Human/robot collaboration
      4. Soft robotics
      5. Robots as consumer products
      6. Robots for autonomous data acquisition
      7. Robots in logistics
      8. Humanoids as multi-purpose robots
    6. How to start your career in robotics
    7. Summary
  24. Index
    1. Why subscribe?
  25. Other Books You May Enjoy
    1. Packt is searching for authors like you
    2. Share Your Thoughts
    3. Download a free PDF copy of this book

Product information

  • Title: Practical Arduino Robotics
  • Author(s): Lukas Kaul
  • Release date: March 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781804613177