Android Basic Gestures of Swipe to Control a Robot

Introduction

Basic gesture of swipe to control movements of a robot can be quite interesting, and may add intuitive interactive dimension to electronic projects.

I have published in this blog several tutorials on 8051-based robot controlled with bluetooth-enabled cell phone. Also most recently I have published a tutorial for Android phone using button images on device’s touchscreen.

Android being open-source, attracts a large following, and hence there are many different ready-made solutions. With a little bit of coding, and imagination, one can design different projects using solutions that are already available, or modifying or improvising on them.

Required equipment

A 8051 robot “Robo-51” (could be a robot with any other micrcontroller) with serial bluetooth ZX-Bluetooth module, running a firmware for bluetooth control, and an account with App Inventor.

Robo-51

Inex´s Robo-51

Inex´s bluetooth module “ZX-Bluetooth”

App Inventor Code

Our code is based on two codes BennyBlue and Swype routine both made with App Inventor .

To be able to control the robot you will need to download the source code file Bluemote2_0.zip kept at Bitbucket, an unlimited free private repositories’ site. If you already have an App Inventor folder, you can download the source code by scanning the following QR barcode:

All you need is your Android’s camera and a barcode scanning application. You may use Barcode Scanner app from ZXing Team. It’s available as a free download from the Android Market and works with all versions of Android.

If you are absolute beginner with App Inventor, the excellent resources and tutorials found at MIT’s App Inventor site are very good and easy to follow.

The control program

The Android application controls Robo-51 from Inex, with the following bluetooth send commands:

Key letter “d” results in forward movement of the robot, “a” in backward, “c” in turning leftward, “b” in turning rightward and “s” in stopping.  The following icon (inside the red circle) shows when the apk has been installed (after compiling in App Inventor, and downloading into your Android phone):

Android screen of Bluemote 2.0 app´s icon

Before running the application, you will need to pair the serial device on Robo-51 with your Android’s bluetooth. Next, when you run the app you will need to tell it which paired device will it talk to:

Select the  bluetooth device

Press the Select Device button to select the paired bluetooth device you have already paired with your Android phone:

The paired device is shown

On clicking the device our first screen will come up with MAC address of the bluetooth device:

On clicking Connect, you will hear if everything is OK “I’m robo-51… I’m at your command!”.  Connect button will change to Disconnect

You can control the robot with gestures of swipe with the finger to the left, or to the right, or forward (up finer swipe gesture) and backward (with down finger swipe gesture) , and you will hear in your Android phone voice of corresponding “forward”, “backward”, “turning left” etc. and the robot will move accordingly leftward, rightward, forward and backward. The Reset/Stop button will stop the robot.

After you have played with the control of the robot, you can disconnect by pressing Disconnect button on top right of Android screen. Clicking the menu button of your phone you can close the app.

VIDEO Demo

Conclusion

This project adds a new feature into existing Robo-51 projects. The main objective of this actual project was to achieve, with little work, similar results to those obtained with Java-based Nokia N97 and Blackberry Bold 9700. I can now tick as successful this project on basic gestures of swipe for Android.

Advertisements

About Tayeb

Electronics engineer, part-time webmaster and owner of "Aliatron", a tech-oriented company registered in Portugal and Mozambique.
This entry was posted in Mobile Apps, Robotic Projects and tagged , , , , , , , , , , . Bookmark the permalink.

5 Responses to Android Basic Gestures of Swipe to Control a Robot

  1. Pingback: Android Basic Gestures of Swipe to Control a Robot - Android Forums

  2. jsanders31 says:

    It’s good to see someone else using appInventor to build Bluemotes! I’m playing around with the app inventor speechRecognizer component to control a boeBot via bluetooth. (http://www.parallax.com/Store/Microcontrollers/BASICStampProgrammingKits/tabid/136/ProductID/296/List/0/Default.aspx?SortField=ProductName,ProductName)

  3. Elaine says:

    Thanks for the marvelous posting! I truly enjoyed reading it, you might be a great author.
    I will be sure to bookmark your blog and will eventually
    come back sometime soon. I want to encourage you to
    definitely continue your great job, have a nice
    afternoon!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s