Book Image

Practical Arduino Robotics

By : Lukas Kaul
Book Image

Practical Arduino Robotics

By: Lukas Kaul

Overview of this book

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.
Table of Contents (21 chapters)
1
Part 1: Selecting the Right Components for Your Robots
6
Part 2: Writing Effective and Reliable Robot Programs for Arduino
10
Part 3: Building the Hardware, Electronics, and UI of Your Robot
15
Part 4: Advanced Example Projects to Put Your Robotic Skills into Action

Introducing Robotics and the Arduino Ecosystem

Creating robots means building machines that autonomously interact with the physical world. Robotics lies right at the intersection of three exciting engineering fields: computer science, electrical engineering, and mechanical engineering. Building your own robots can seem daunting, even if you are an expert in any of these three fields already. There is a lot to know before you cwan really get started. But if you successfully master the fundamental skills that this book teaches you, you will soon be ready to create advanced robots yourself. And from there, the possible applications are endless! You can build robots just for fun and the joy of learning more and more with every project. Or you can use these skills to quickly create a physical prototype of a product idea, build smart tools that help you at home or on the job, and automate, entertain, teach, and educate. You might be able to create amazing student projects or even boost your career with these new skills.

Your robot needs a brain – a computer that can run your programs, process sensor signals, and control motors. There are several options for DIY robots. You can simply use your laptop, but that is a costly and pretty clunky option, and it makes interfacing with low-level hardware and implementing real-time control systems difficult. You can also use the popular Raspberry Pi single-board computer, which is a powerful and affordable platform for many DIY projects. However, for many DIY robot projects, Raspberry Pi is overkill and adds unnecessary layers of complexity. In contrast, using microcontrollers as the compute platform is extremely affordable, makes interfacing with almost any hardware easy, and is a great way to learn about low-level programming and real-time systems. For many DIY robotics projects, microcontrollers are the ideal platform, and this is where Arduino comes in!

Arduino is an ecosystem of microcontroller boards, tools, and software building blocks that makes creating your own advanced robots exceptionally easy. The two core elements of this ecosystem are Arduino boards and the Arduino Integrated Development Environment (IDE). Arduino boards are affordable, capable microcontroller boards that are incredibly easy to use, even if you have never worked with electronics before. These features, combined with their wide availability (thanks to their open source design) have truly made microcontrollers accessible to anyone. The Arduino board will be the brain of your robot, running the program you wrote for it. It will sense the world with sensors and make the motors of your robot move accordingly. The Arduino IDE is what we use to develop the programs for your robots and to transfer them from your computer to the Arduino. The Arduino IDE sits in the sweet spot of microcontroller IDEs between graphical programming languages (drag and drop programming) and highly hardware-specific IDEs provided by microcontroller manufacturers. While the former is easy to master but can be very limiting, the latter gives access to a microcontroller’s full potential at the cost of taking years to master. In contrast, the Arduino IDE embodies the 80/20 principle: it gives us access to roughly 80% of the microcontrollers’ capabilities with only 20% of the effort.

This chapter will kick-start your journey toward building and programming your own robots by answering the following questions:

  • What are the main components of a robot?
  • What is an Arduino microcontroller board?
  • What is the Arduino ecosystem?
  • How do you program your Arduino-based robot?

By the end of this chapter, you will know the answers to all of these questions; you will have successfully set up the Arduino IDE on your computer, and your first Arduino program will be running on your Arduino.