Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Practical Arduino Robotics

You're reading from  Practical Arduino Robotics

Product type Book
Published in Mar 2023
Publisher Packt
ISBN-13 9781804613177
Pages 334 pages
Edition 1st Edition
Languages
Concepts
Author (1):
Lukas Kaul Lukas Kaul
Profile icon Lukas Kaul

Table of Contents (21) Chapters

Preface Part 1: Selecting the Right Components for Your Robots
Chapter 1: Introducing Robotics and the Arduino Ecosystem Chapter 2: Making Robots Perceive the World with Sensors Chapter 3: Making Your Robot Move and Interact with the World with Actuators Chapter 4: Selecting the Right Arduino Board for Your Project Part 2: Writing Effective and Reliable Robot Programs for Arduino
Chapter 5: Getting Started with Robot Programming Chapter 6: Understanding Object-Oriented Programming and Creating Arduino Libraries Chapter 7: Testing and Debugging with the Arduino IDE Part 3: Building the Hardware, Electronics, and UI of Your Robot
Chapter 8: Exploring Mechanical Design and the 3D Printing Toolchain Chapter 9: Designing the Power System of Your Robot Chapter 10: Working with Displays, LEDs, and Sound Chapter 11: Adding Wireless Interfaces to Your Robot Part 4: Advanced Example Projects to Put Your Robotic Skills into Action
Chapter 12: Building an Advanced Line-Following Robot Using a Camera Chapter 13: Building a Self-Balancing, Radio-Controlled Telepresence Robot Chapter 14: Wrapping Up, Next Steps, and a Look Ahead Index Other Books You May Enjoy

Adding Wireless Interfaces to Your Robot

If you need to communicate with your robot without a USB cable from a distance, for controlling or viewing live telemetry, your robot needs a wireless interface. There are many wireless interfaces and standards in use. In this chapter, we will look at four that are particularly useful for Arduino robots, from the simple hobby RC interface to full-fledged Wi-Fi.

This chapter is organized into four main parts:

  • Controlling your robot with a hobby remote control
  • Using XBee to make your serial interface wireless
  • Bluetooth control via your phone or tablet
  • Connecting to your robot over Wi-Fi and controlling it from any browser

By the end of this chapter, you will know what wireless interface to choose for your project and how to successfully integrate it into your robot.

Technical requirements

Wireless interfaces require special hardware. Besides your Arduino Uno, a breadboard, jumper wires, and your PC, this is what you need for the examples in this chapter:

What is a wireless interface

We already got to know a lot of different communication interfaces that are commonly used to connect parts of your robot to the Arduino that controls it. These are interfaces such as SPI, I2C, and Serial. All of these have one thing in common, and that is that they transmit data over wires. Therefore, they all fall under the category of wired interfaces. In contrast, the interfaces that we will talk about in this chapter transmit data without the need for physical wires – they are wireless.

When to use wireless interfaces

Not requiring physical wires is an obvious advantage over wired interfaces, as it allows for a lot more flexibility and versatility when it comes to making ad hoc connections with new devices or transmitting data over longer distances. Naturally, you might wonder why we even bother with wired interfaces in the first place. To answer this question, let us look at some of the disadvantages that wireless interfaces have compared...

Controlling your robot with a hobby remote control

Hobby RCs have been in use for decades. Even though the underlying radio technology has changed a lot and modern hobby radio controls offer many advanced features compared to the early days of RC technology, the output signal produced by the receiver has remained remarkably simple. This makes them extremely easy to integrate into an Arduino robot.

A hobby RC system consists of a handheld transmitter with control inputs such as sticks, wheels, or buttons, and a receiver. Each manual input to the transmitter is transmitted wirelessly to the receiver and output by the receiver as a digital signal. Between 2 and 10 signals are common among standard systems. The different signals that can be transmitted are called channels. With a six-channel RC system, we can control six functions of our robot, for example, six joints of a robot arm.

Decoding the receiver output

While an RC transmitter can take on many forms, shapes, and sizes...

Replacing the USB cable with a Zigbee module

We have already used the serial interface of our Arduino extensively to communicate with the Arduino IDE’s built-in Serial Monitor and Plotter. These tools are incredibly useful to send commands to your robot or visualize live sensor data, controller outputs, or any other data that helps you understand what is happening inside your robot. So far, we always used a USB cable as the communication link between the Arduino and the PC. This is very convenient, particularly because it also works seamlessly for programming the Arduino and providing power from the USB port. But what if we wanted to use the same tools to communicate with a mobile robot that cannot be connected to your PC over a USB cable?

We can easily replace the USB cable with wireless modules that act as the link for the serial interface using a range of technologies. In this section, we will learn how to use Digi’s XBee modules for this purpose (https://www.digi...

Controlling a robot from your phone via Bluetooth

Another incredibly useful wireless interface that we can use to interact with Arduino robots is Bluetooth. Just like Zigbee, Bluetooth is a powerful and very versatile wireless standard that can be used for many applications. We will use it in the most straightforward way, to connect to an Arduino over its Serial interface from a phone or tablet.

Hardware

This time, one side of the wireless communication will be your smartphone or tablet, so there is no extra hardware required on this end. We only need a Bluetooth adapter for your Arduino. For the next examples, we will use the Adafruit Bluefruit LE UART Friend as a Bluetooth Low Energy (BLE) adapter. This is a versatile and breadboard-friendly adapter with excellent software support. We only need to solder on the pin headers, place it on a solderless breadboard, and connect it to our Arduino, as shown in Figure 11.5:

Figure 11.5 – Connecting the Adafruit Bluefruit LE UART Friend to the Arduino Uno

Figure 11.5 – Connecting...

Connecting to your robot over Wi-Fi

Lastly, we will briefly look at the possibility of connecting to your robot over Wi-Fi. Wi-Fi is an immensely powerful and versatile wireless interface with many potential applications. The way you would most commonly use it on your robot is by running a web server on your Arduino. This server serves up a web interface that you can connect to from any browser over Wi-Fi. It can display live sensor data (even camera data) or expose control interfaces. Wi-Fi is rarely the best choice of wireless interface for your robot due to its complexity. And while there are many great tools available to make using Wi-Fi easy, it is still a lot more complicated to use than any of the other interfaces we discussed so far in this chapter. However, connecting your robot to the internet is great when you need to access it from anywhere in the world – for example, if you build a home security robot that you want to control over the internet when you are away...

Summary

In this chapter, we took an in-depth look at several wireless interfaces that you can add to your robotics projects. We learned about their features and what you can use them for. We also went through examples of how to use each of them, and now you have a starting point if you want to add any of them to your robot. Wireless interfaces can be incredibly useful and can make your projects more versatile, but they also add additional complexity and have several downsides compared to wired interfaces.

In the next chapter, we will develop an example robot project that puts many of the lessons we have learned so far to use.

Further reading

Following are a few helpful resources where you can learn more about XBee modules and the XCTU configuration software, as well as an interesting dashboard project and the Arduino Wi-Fi library:

lock icon The rest of the chapter is locked
You have been reading a chapter from
Practical Arduino Robotics
Published in: Mar 2023 Publisher: Packt ISBN-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.
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}