Face Drive Bot (App Guide)
Face Drive Bot
AI-Powered Eye Control Robot Documentation
Welcome to the official guide for the Eye Control Robot App. This innovative app uses your phone's camera and AI to control a hardware robot using only your eye movements.
📱 Complete User Guide
The Main Control Interface
1. Bluetooth Setup
- Step A: Turn on Phone Bluetooth.
- Step B: Pair with HC-05 (Pin: 1234).
- Step C: Open App > Tap Bluetooth Icon.
2. Eye Controls
- Look LEFT/RIGHT: Turns Robot.
- Look CENTER: Stops Robot.
- Look DOWN: Move Forward.
- Look UP: Move Backward.
⏸️ Pause & Lock Mode
Need a break? Blink twice quickly to PAUSE the controls. Blink twice again to RESUME.
🔧 Troubleshooting
Double-tap the "Switch Camera" button to reset the camera preview instantly.
Go to your phone's Settings > Bluetooth and pair the HC-05 manually before opening the app.
🤖 Robot Hardware Code
[Image of Arduino Bluetooth car wiring diagram]Choose your microcontroller below, copy the code, and upload it to your robot.
Option 1: Arduino + HC-05
Wiring: HC-05 (TX→Pin 2, RX→Pin 3) | L298N (IN1-IN4 → Pins 8-11)
#include <SoftwareSerial.h>
SoftwareSerial myBT(2, 3); // RX, TX
const int IN1 = 8;
const int IN2 = 9;
const int IN3 = 10;
const int IN4 = 11;
String command = "";
void setup() {
Serial.begin(9600);
myBT.begin(9600);
pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT);
stopRobot();
Serial.println("Robot Ready!");
}
void loop() {
if (myBT.available()) {
char c = myBT.read();
command += c;
if (command.indexOf("UP") >= 0) { moveForward(); command = ""; }
else if (command.indexOf("DOWN") >= 0) { moveBackward(); command = ""; }
else if (command.indexOf("LEFT") >= 0) { turnLeft(); command = ""; }
else if (command.indexOf("RIGHT") >= 0) { turnRight(); command = ""; }
else if (command.indexOf("STOP") >= 0) { stopRobot(); command = ""; }
}
}
void moveForward() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void moveBackward() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}
void turnLeft() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void turnRight() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}
void stopRobot() {
digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
}
Option 2: ESP32 (Internal Bluetooth)
Wiring: L298N (IN1-IN4 → GPIO 26, 27, 14, 12)
#include "BluetoothSerial.h"
BluetoothSerial SerialBT;
const int IN1 = 26;
const int IN2 = 27;
const int IN3 = 14;
const int IN4 = 12;
String command = "";
void setup() {
Serial.begin(115200);
SerialBT.begin("ESP32_Eye_Robot");
pinMode(IN1, OUTPUT); pinMode(IN2, OUTPUT);
pinMode(IN3, OUTPUT); pinMode(IN4, OUTPUT);
stopRobot();
}
void loop() {
if (SerialBT.available()) {
char c = SerialBT.read();
command += c;
if (command.indexOf("UP") >= 0) { moveForward(); command = ""; }
else if (command.indexOf("DOWN") >= 0) { moveBackward(); command = ""; }
else if (command.indexOf("LEFT") >= 0) { turnLeft(); command = ""; }
else if (command.indexOf("RIGHT") >= 0) { turnRight(); command = ""; }
else if (command.indexOf("STOP") >= 0) { stopRobot(); command = ""; }
}
}
void moveForward() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void moveBackward() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}
void turnLeft() {
digitalWrite(IN1, LOW); digitalWrite(IN2, HIGH);
digitalWrite(IN3, HIGH); digitalWrite(IN4, LOW);
}
void turnRight() {
digitalWrite(IN1, HIGH); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, HIGH);
}
void stopRobot() {
digitalWrite(IN1, LOW); digitalWrite(IN2, LOW);
digitalWrite(IN3, LOW); digitalWrite(IN4, LOW);
}
👨💻 Developer Notes
Built with ❤️ by Jeyaram B using Android (Java) & ML Kit.
Version 2025.1.0
Comments
Post a Comment