Introduction: Arduino Robot Controlled by Android Phone App

About: Thinker and Tinker ;)

In this project, we are using the same iHackRobot Control Station App to wirelessly activate certain movements of a robot with an android smartphone. Instead of turning On and Off six appliances or your car ignition, we are now mobilizing a robot by simply swiping the sliders on either ends. The app which we used in our previous projects can put the robot into sleep or standby mode by shaking the phone.

The App can activate the Robot:

  1. To move forward (green slider)
  2. To move backward (red slider)
  3. To turn left (yellow slider)
  4. To play dead (blue slider)
  5. To sweep or swivel its head (pink slider)
  6. To sleep or stay in standby mode (black slider)

The following hardware or materials are needed for our Robot:

  • 1 stamp pad (body)
  • 4 fasteners (feet)
  • 1 ultrasonic (eyes)
  • 5 microservos (joints)
  • connecting wires (vessels)
  • arduino R3 Uno (brain)
  • bluetooth
  • android smartphone/tablet

The Sketch to test one of your servos using the sweep() procedure - the pink slider on the app:

#include <Servo.h>
#include <SoftwareSerial.h>
SoftwareSerial BTserial(2, 3); // RX | TX
char data = 0;

Servo mHead;
Servo rightFront;
Servo rightBack;
Servo leftFront; 
Servo leftBack;


void setup() {
     mHead.attach(10);      
     rightFront.attach(7);   
     rightBack.attach(6); 
     leftFront.attach(9); 
    leftBack.attach(8);  
}

void loop() {
  
if (BTserial.available() > 0) {
      data = BTserial.read(); 
  switch (data) { 
    case 'a':         
        stand();
          walk();
           stand();
           break;

       case 'b':           
           stand();
           back();
           stand();
            sweep();
            break;

       case 'c':
          dead();
          stand();
          sweep();
          break;
        
      case 'd':
          stand();
           sweep();
           turn();
           break;

      case 'e':
          mHead.write(90);
          sweep();
          mHead.write(90):
          break;

      case 'f':
           sleep();
           break;
        }
    }
  }


<p>/* This is a sample modular procedure for sweep(). The procedures for stand(),
walk(), back(), turn(), sleep() were not incorporated here due to your own 
personal taste or preference.*/</p>

<p>void sweep()<br>{ 
  for(pos = 0; pos <= 180; pos += 1) 
  {                                 
    mHead.write(pos);              
    delay(15);                       
  } 
  for(pos = 180; pos>=0; pos-=1)     
  {                                
    mHead.write(pos);             
    delay(15);                       
  } 
  mHead.write(90);
}</p>

The app is provided "As Is" ***

The second robot in the picture is a different version. He was programmed to be autonomous. He is a self contained homodruino that can navigate his surroundings all on his own. The sketch that I developed for this robot is almost identical to the sketch that we have on the critter in the video. Please stay tuned for this and more instructables!

NOTE: The "As Is" warranty may sound alarming. But it is usually a third party vendor that tries to access some of your hardware information and sometimes mess up your smartphone. Use your judgement on such predicaments.

"Without the outside physical world, Ideas would not exist." ~ iHackRobot Law

Step 1: Schematic/block Diagrams & Actual Project