Reader small image

You're reading from  Practical Arduino Robotics

Product typeBook
Published inMar 2023
PublisherPackt
ISBN-139781804613177
Edition1st Edition
Tools
Concepts
Right arrow
Author (1)
Lukas Kaul
Lukas Kaul
author image
Lukas Kaul

Lukas Kaul is a robotics Research Scientist, currently working at the Toyota Research Institute in Silicon Valley, where he develops mobile manipulation technologies to support people in their homes and in their workplace. Throughout his career he has worked on projects as diverse as humanoid robots, aerial robots and mobile manipulation systems. A maker at heart, Lukas has been using Arduino technology extensively for more than a decade in countless side-projects, ranging from mapping systems to self-balancing robots. Lukas is passionate about teaching robotics with Arduino to inspire and empower anyone who wants to enter the exciting field of robotics. He holds a PhD degree from the Karlsruhe Institute of Technology, Germany.
Read more about Lukas Kaul

Right arrow

Preface

Robots capture our imagination in stories and in the real world. Many of us are fascinated by these machines that can act autonomously with superhuman strength, speed, or other impressive qualities. Robots are also incredibly useful in many applications, from manufacturing to entertainment and education. Creating complete robot systems is a feat of engineering, and this book strives to enable you to do just that. With the most recent advances in electronics and the availability of more and more open source software tools for robotics, building robots has become more accessible than ever before. Using the popular, open source Arduino platform and easily accessible hardware components, this book will teach you all that is needed to bring your robot ideas to life.

DIY robotics with Arduino is a popular hobby for makers and electronics hobbyists, and without a solid foundation, all of the content you can find on the internet can be overwhelming. This book is based on more than a decade of experience of using Arduino for robotics projects and teaching the underlying technologies. It condenses many hard-earned lessons, tips, and best practices to accelerate your journey to becoming a well-rounded robot creator. With many example projects, from blinking an LED to a radio-controlled, self-balancing telepresence robot, it gives you invaluable hands-on experience that you need for planning your future projects.

Robotics and automation is a booming industry, even beyond its traditional applications. As societies around the world are aging, robotics technology will play a critical role in maintaining prosperity and happiness. With this book, you can lay the foundation for your involvement in robotics and set yourself on the path towards helping to shape our future.

Who this book is for

Whether you want to build your own robots to solve a specific problem; use robotics projects as a way to learn more about electrical, mechanical, or computer engineering to advance your career; or teach robotics with hands-on examples, you will find this book highly useful.

If you fit into one of the following groups, this book is definitely for you:

  • Motivated high school students (and their teachers) that are fascinated by robots and want to learn about robotics hands-on
  • Engineering students who want to look beyond their immediate field and see how different engineering disciplines come together to create fascinating systems
  • Hobbyists, enthusiasts, and makers that want to learn how to harness the power of Arduino in their own robotics projects, from automating the landing gear of radio-controlled airplanes to DIY home automation
  • Professionals who can use Arduino robotic technologies to improve their workflows, enhance productivity, and spark their creativity by learning new skills

What this book covers

Chapter 1, Introducing Robotics and the Arduino Ecosystem, gets us on the same page about what we mean by robotics, explains in detail what an Arduino board is, and walks you through setting up the Arduino IDE. By the end of this chapter, your first Arduino program will be running on your Arduino Uno.

Chapter 2, Making Robots Perceive the World with Sensors, introduces various sensors that are commonly used in DIY robotics and the electrical interfaces they use to provide their data to the Arduino board. The chapter includes detailed code examples that demonstrate their use.

Chapter 3, Making Your Robot Move and Interact with the World with Actuators, gives you a broad overview of the different electrical actuators that you can choose from for your robotics projects. Example setups and code show you how to use them with Arduino.

Chapter 4, Selecting the Right Arduino Board for Your Project, packs in a lot of information about the distinct characteristics of Arduino boards and teaches you all you need to know to choose the right board for your project.

Chapter 5, Getting Started with Robot Programming, introduces important concepts and best practices specific to robot programming that make your code performant, useful, and reusable. Using these concepts from the beginning will save you a lot of time in debugging and troubleshooting, and you will instead develop high-quality robot programs.

Chapter 6, Understanding Object-Oriented Programming and Creating Arduino Libraries, teaches you how to use one of the most powerful features of the C++ language: object orientation. Using this new skill, the chapter walks you through the process of turning your Arduino program into a cleanly packaged library so that you can effortlessly reuse its functionalities in future projects without having to duplicate any code.

Chapter 7, Testing and Debugging with the Arduino IDE, is a detailed user guide to the Arduino IDE’s most powerful tools for debugging and creating interactive programs, the Serial Monitor, and the Serial Plotter. It also sums up important lessons and best practices that help you avoid common pitfalls and streamline your development process.

Chapter 8, Exploring Mechanical Design and the 3D Printing Toolchain, switches gears from software to hardware. This chapter introduces you to various techniques that you can use to build your physical robots, with a special emphasis on 3D printing.

Chapter 9, Designing the Power System of Your Robot, is our excursion into the world of power electronics. It will introduce you to the key considerations when it comes to designing a power system that is the backbone of your robot’s safe and reliable operation.

Chapter 10, Working with Displays, LEDs, and Sound, helps you make your robots truly interactive. Learning how to change the brightness and color of lights, make a variety of sounds, and display text on an LCD screen allows you to add a lot of personality to your robots.

Chapter 11, Adding Wireless Interfaces to Your Robot, introduces you to different types of wireless interfaces that are suitable for and easy to use in DIY robotics projects, including Bluetooth and Wi-Fi. It teaches you about their specific pros and cons so you can decide which interface is best for your own projects.

Chapter 12, Building an Advanced Line Following Robot Using a Camera, is a complete case study that puts a lot of what we have learned in the previous chapters to use. At the end of this chapter, you will have a fully functioning, sturdy, and capable mobile robot with a camera and a Bluetooth interface that you can use for many more experiments beyond line following.

Chapter 13, Building a Self-Balancing, Radio-Controlled Telepresence Robot, is another case study that takes the line follower and turns it into a self-balancing robot. It highlights additional aspects of robot programming, with an emphasis on feedback control and systematic parameter tuning.

Chapter 14, Wrapping Up, Next Steps, and a Look Ahead, recaps what we learned in the previous chapters and puts it in the larger context of the vast field of robotics. It illustrates different options to keep learning about robotics, helps you choose your focus, and offers advice for those who wish to make robotics their career.

To get the most out of this book

You will need basic familiarity with electrical circuits and Ohm’s law, and you should have some experience with basic concepts of computer programming (variables, functions, and loops). Even if you do not have this knowledge, you can still read this book and learn the required skills on the fly. Each chapter has pointers to further reading that you can use to deepen your understanding or as starting point to fill in any gaps in your knowledge. If you have some experience of tinkering with hardware, building mechanisms, or soldering wires and electronic components, you are perfectly equipped for this book. The book assumes that you have used a solderless breadboard before to connect electronic components.

Software/hardware covered in the book

Operating system requirements

Arduino IDE 2.0.3 (or higher)

Windows, macOS, or Linux

Arduino Uno or Mega2560

All you need to start working with this book in addition to the free Arduino IDE software is an Arduino Uno or Arduino Mega2560 board, a solderless breadboard, and a few jumper wires. We will explore many additional, inexpensive hardware components in the individual chapters, but you neither need all of them, nor the exact models that are used in the book (with a few exceptions). If you want to recreate the experiments in a certain chapter, the chapter will point you to the hardware you need.

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.

This book will enable you to use a wide variety of hardware components for Arduino DIY robots, far beyond the exact parts used in the examples throughout the chapters.

Download the example code files

You can download the example code files for this book from GitHub at https://github.com/PacktPublishing/Practical-Arduino-Robotics. If there’s an update to the code, it will be updated in the GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

We also provide a PDF file that has color images of the screenshots and diagrams used in this book. You can download it here: https://packt.link/THXao.

Conventions used

There are a number of text conventions used throughout this book.

Code in text: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: “To control the three colors of LEDs with variable brightness via software, we can use the Dimmer class that we developed earlier and simply instantiate one instance per color: redDimmer, greenDimmer, and blueDimmer on three different pins.”

A block of code is set as follows:

enum Mode {
  MANUAL_CONTROL,
  FOLLOW_LINE
};
Mode mode = MANUAL_CONTROL;

When we wish to draw your attention to a particular part of a code block, the relevant lines or items are set in bold:

if (millis() - last_blink_time >= blink_interval) {
  // Update the last blink time.
  last_blink_time += blink_interval;
  // Execute the blink task.
  blink_task();
}

Bold: Indicates a new term, an important word, or words that you see onscreen. For instance, words in menus or dialog boxes appear in bold. Here is an example: “If you are looking for a specific library, open the library manager by clicking Tools | Manage Libraries... and use the search bar to find the library you are looking for. If it is available, simply hover your mouse over it and click the Install button.”

Tips or important notes

Appear like this.

Get in touch

Feedback from our readers is always welcome.

General feedback: If you have questions about any aspect of this book, email us at customercare@packtpub.com and mention the book title in the subject of your message.

Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packtpub.com/support/errata and fill in the form.

Piracy: If you come across any illegal copies of our works in any form on the internet, we would be grateful if you would provide us with the location address or website name. Please contact us at copyright@packt.com with a link to the material.

If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.

Share Your Thoughts

Once you’ve read Unlocking the Power of Arduino for DIY Robots, we’d love to hear your thoughts! Please click here to go straight to the Amazon review page for this book and share your feedback.

Your review is important to us and the tech community and will help us make sure we’re delivering excellent quality content.

Download a free PDF copy of this book

Thanks for purchasing this book!

Do you like to read on the go but are unable to carry your print books everywhere?
Is your eBook purchase not compatible with the device of your choice?

Don’t worry, now with every Packt book you get a DRM-free PDF version of that book at no cost.

Read anywhere, any place, on any device. Search, copy, and paste code from your favorite technical books directly into your application.

The perks don’t stop there, you can get exclusive access to discounts, newsletters, and great free content in your inbox daily

Follow these simple steps to get the benefits:

  1. Scan the QR code or visit the link below

https://packt.link/free-ebook/9781804613177

  1. Submit your proof of purchase
  2. That’s it! We’ll send your free PDF and other benefits to your email directly
lock icon
The rest of the chapter is locked
You have been reading a chapter from
Practical Arduino Robotics
Published in: Mar 2023Publisher: PacktISBN-13: 9781804613177
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Lukas Kaul

Lukas Kaul is a robotics Research Scientist, currently working at the Toyota Research Institute in Silicon Valley, where he develops mobile manipulation technologies to support people in their homes and in their workplace. Throughout his career he has worked on projects as diverse as humanoid robots, aerial robots and mobile manipulation systems. A maker at heart, Lukas has been using Arduino technology extensively for more than a decade in countless side-projects, ranging from mapping systems to self-balancing robots. Lukas is passionate about teaching robotics with Arduino to inspire and empower anyone who wants to enter the exciting field of robotics. He holds a PhD degree from the Karlsruhe Institute of Technology, Germany.
Read more about Lukas Kaul