Face Tracking Eyes in 10 Min (No Coding Required)

by KimY21 in Circuits > Cameras

110 Views, 2 Favorites, 0 Comments

Face Tracking Eyes in 10 Min (No Coding Required)

Face Tracking Eyes - Demo

Introduction

Building face-tracking systems traditionally requires complex programming: implementing computer vision libraries, handling real-time video processing, calculating coordinate transformations, managing servo motor control, implementing smoothing algorithms, and coordinating all these components. With Grablo, you simply arrange visual blocks to make it happen.

This tutorial shows how to build a face-tracking servo motor system in 10 minutes using drag-and-drop blocks. Using on-device AI vision processing with real-time face detection, the system automatically tracks your face position and rotates servo motors to follow you like a pair of robotic eyes.


What You'll Build

A complete AI-powered face-tracking system featuring:

  1. Real-time face detection using on-device AI camera vision
  2. Servo motor control responding to face position
  3. Smooth motion filtering eliminating jitter and shaking (optional)
  4. Live video dashboard showing camera feed and tracking status
  5. Supports multiple cameras (Raspberry Pi Camera or USB cameras)
  6. Zero lines of code required!


Supplies

결선도.png

Required Components

  1. Raspberry Pi (or Jetson Nano, PC with USB-GPIO)
  2. 2x SG90 Servo Motors (0-180 degrees)
  3. Camera (Raspberry Pi Camera Module or USB webcam)
  4. External 5V DC power supply (recommended for actual use)
  5. Jumper wires


Wiring

Servo Motor 1:

  1. Red wire → 5V power (external DC power supply recommended)
  2. Brown/Black wire → GND
  3. Orange/Yellow wire → GPIO 23

Servo Motor 2:

  1. Red wire → 5V power (external DC power supply recommended)
  2. Brown/Black wire → GND
  3. Orange/Yellow wire → GPIO 24

Camera:

  1. Raspberry Pi Camera: Connect to camera CSI port
  2. USB Camera: Connect to any USB port


⚠️Important Notes:

  1. This tutorial powers servos directly from Raspberry Pi's 5V supply for testing purposes. Use external 5V DC power supply for actual use.

Quick Start

  1. Install software: Download and install Grablo software on your Raspberry Pi
  2. Set up hardware: Wire servo motors and connect camera according to circuit diagram above
  3. Get this project: Project Link
  4. Connect controller: In your project, go to "Connect Controller" and enter IP address
  5. Hit RUN: Watch the servos track your face like robotic eyes!

💡 Want to build it yourself? Skip to Step 2 and follow the detailed tutorial

Create Project

  1. Go to https://app.grablo.co
  2. Click "Create Project"
  3. Give your project a name

Start Camera and Face Detection

2025-10-23_13-57-24.png

Control 1 - Start Camera and Face Detection

Create a new logic and control that starts the camera and continuously detects faces

  1. Condition (Once): Run only once when project starts
  2. Action (AI Camera): Initialize camera with face detection
  3. AI Analysis 1: Detect if face is present
  4. AI Analysis 2: Get face center X-coordinate

This control runs continuously while the camera is active, storing face detection status and X-coordinate position in real-time.

Control 2 - Servo Motor Tracking

2025-10-23_14-05-34.png

Control 2 - Servo Motor Tracking

Create a control that rotates servo motors to follow the detected face

  1. Condition (Compare): Only move servos when face is detected
  2. Action 1 (Set Variable): Calculate servo angle from face position
  3. Action 2 (Custom Action - OPTIONAL): Add motion smoothing to eliminate jitter
  4. Action 3 (I/O Device Control): Control first servo motor
  5. Action 4 (I/O Device Control): Control second servo motor


Create Dashboard

2025-10-23_14-09-58.png

Create a new dashboard with these widgets:

  1. Camera Widget: Shows live camera feed with face detection overlay
  2. LED Widget: Face Detection Status
  3. Label Widget: Face X-Coordinate
  4. Label Widget: Calculated Servo Angle

This provides real-time visual feedback of the tracking system.

Launch Your Project

That's It - You're Done!

Congratulations! You've just built a complete AI-powered face-tracking servo motor system using only 2 simple controls and zero lines of code. This is the power of visual programming with Grablo - what traditionally requires complex computer vision and motor control programming is now accomplished with intuitive drag-and-drop blocks.


Expected Results

When you run your project:

  1. Camera starts: AI face detection activates
  2. Face detected: Servo motors begin tracking
  3. Move left/right: Servos follow your face position smoothly
  4. Multiple faces: System tracks the largest face
  5. No face: Servos hold last position
  6. Dashboard updates: Real-time display of face position and servo angles


Run Your Project:

  1. Install software: Download and install Grablo software on your Raspberry Pi
  2. Set up hardware: Wire servo motors and connect camera according to circuit diagram
  3. Connect controller: In your project, go to "Connect Controller" and enter IP address
  4. Hit RUN: Watch the servos track your face like robotic eyes!

Video Tutorial

Face Tracking Eyes with AI Detection

Watch the complete build process in action! This 8-minute video demonstrates every step from hardware setup to AI camera configuration and launching your face-tracking servo system.

Expand Your Project

Add more functionality with additional blocks:

  1. Full pan-tilt control: Add face Y-coordinate detection to control the second servo for vertical tracking (true 2D face following)
  2. Object tracking: Change AI Analysis Type from "Face Detection" to "Object Detection" to track balls, hands, or specific colored objects
  3. LED indicators: Add LED that lights up when face is detected or changes color based on tracking status
  4. Motion-triggered snapshots: Automatically save camera snapshots when face is detected - useful for home security or visitor logging


Troubleshooting

No face detection:

  1. Verify camera is working (check camera preview in dashboard)
  2. Ensure adequate lighting (face detection works best in good light)
  3. Adjust distance from camera (optimal range: 0.5-3 meters)

Servos not moving:

  1. Verify GPIO pin numbers match your wiring
  2. Check servo power supply (use external 5V DC recommended)
  3. Confirm Face_Detected variable is True in dashboard

Servos shaking/jittering:

  1. Add or adjust smoothing filter (Step 4, Action 2 - Optional)
  2. Increase filter strength (try 0.3/0.7 instead of 0.5/0.5)

Choppy video:

  1. Reduce camera resolution
  2. Close other applications on Raspberry Pi
  3. Use Raspberry Pi 4 or higher for better performance


Resources

Official Website: https://grablo.co

Get started: https://app.grablo.co

Documentation: https://doc.grablo.co

Support: support@grablo.co