Chapter 8. Going Truly Mobile – Remote Control of Your Robot

Based on the previous projects, you now have mobile robots that can move around, accept commands, see, and even avoid obstacles. This project will teach you how to electronically communicate with your robot without any wires.

Mission briefing

You're mobile, but you still need to use your LAN cable if you want to communicate electronically with your project. In this project, you'll learn how to communicate without wires, yet still remain in control of your robot.

Why is it awesome?

As you send your device out into the world, you may still want to communicate with it electronically without connecting a cable. If you add this capability, you can change what your mobile robot is doing without any physical contact, and still remain in complete control of your project.

Tip

Downloading the example code and colored images

You can download the example code files and colored images for this Packt book you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

Your objectives

In this project you will be:

  • Connecting the BeagleBone Black to a wireless USB keyboard
  • Using the keyboard to control your project

Mission checklist

In this project, you'll learn how to connect to your device wirelessly. There are several ways to accomplish this. I'm going to show you how to do this with a standard USB wireless input device. This will let you control your robot without running cables.

However, first you will probably want to purchase a small LCD display for your BeagleBone Black. This will allow you to monitor what is going on with your project. In the initial projects you used a separate computer monitor for this. But an HDMI or DVI monitor is just too big and not really designed for mobile use. Fortunately, there are several inexpensive choices for small LCDs that connect right to the BeagleBone Black. The following image shows a device I have used for some of my projects:

Mission checklist

The LCD shown in the preceding image is from a company called CircuitCo. It's also available on Amazon and other online electronics stores, so you should be able to get it almost anywhere. There are several versions of LCD that are made for the BeagleBone Black. This one is 3.5 inches and has a display resolution of 320 x 240. There is another version that is 4.5 inches and has a display resolution of 480 x 270. The following image shows a larger LCD, made by 4D Systems:

Mission checklist

The largest version is of 7 inches and has a display resolution of 800 x 480. I personally like the smaller versions for placement on my robots.

The board fits right on top of the BeagleBone Black. The following image shows an underside view of the LCD:

Mission checklist

These pins are pushed right into the header connectors of the BeagleBone Black with the LCD on the top. The following image shows a side view of the BeagleBone Black and LCD:

Mission checklist

Now when you program your board, you can see the results right on the robotic platform. No extra programming is needed; the BeagleBone Ubuntu release will sense that the LCD screen is there and boot with the screen acting as a display. After the system boots, it will look similar to what is shown in the following image:

Mission checklist

If you connect a USB keyboard to the BeagleBone Black and log in and then type startx at the prompt, you'll get your Xfce4 windowing system. It should look similar to what is shown in the following image:

Mission checklist

Now that you can display what is going on inside the BeagleBone Black, you need to choose which wireless input device to use.

A standard 2.4 GHz wireless keyboard is shown in the following image:

Mission checklist

The preceding image displays a Logitech keyboard. Logitech generally makes a very reliable keyboard, and this connects well to the BeagleBone Black. This keyboard is available online through Amazon, and at most electronics or computer stores. You'll notice that this version has a built-in mouse.

Another choice is a small keyboard that looks more like a game controller. It will make your projects look amazing and will make it easier to control:

Mission checklist

The preceding image shows a 2.4 GHz wireless keyboard by HausBell which is small, about the size of a game controller. It is relatively inexpensive, and is again sold online by Amazon.

There are several choices we could make for wireless technology in communicating with the BeagleBone Black. Bluetooth is quite popular, and works well, but comes with the added complexity of having to pair the device with the Bluetooth USB dongle and the system. The 2.4 GHz wireless technology comes with a keyboard and wireless USB receiver already paired so the device only works with the USB dongle that ships with the device. And the system automatically recognizes the device as long as the USB receiver is plugged into the USB port.

The frequency range utilized by 2.4 GHz wireless devices is the same as that of many 2.4 GHz wireless LAN devices, although they do not use the same modulation or protocol that is used by standard 2.4 GHz wireless LAN. Rather they use a proprietary modulation and protocol that is specific to the device and the company that manufactures the device.

While each device is different, most use the same overall approach, where they define a number of different channels, or small frequency ranges, inside the overall 2.4 GHz range. The keyboard communicates with the USB receiver on one of these frequencies. However, if either the keyboard or USB receiver sense that some other device is transmitting on that frequency, the devices will move to a different channel to try to avoid the interference.

The transmissions between the wireless keyboard and USB receiver are encrypted, so no device except the paired keyboard and USB receiver can understand the messages that are being sent between the two devices. The range of the keyboard/receiver pair is dependent upon the amount of power that both use for transmission, the higher the power the longer the range. Unfortunately, the higher the power the less time the batteries in the wireless device last. Most wireless keyboards are designed to work for up to 10 meters, or around 30 feet.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.189.189.67