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)
 
      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:
- Real-time face detection using on-device AI camera vision
- Servo motor control responding to face position
- Smooth motion filtering eliminating jitter and shaking (optional)
- Live video dashboard showing camera feed and tracking status
- Supports multiple cameras (Raspberry Pi Camera or USB cameras)
- Zero lines of code required!
Supplies
 
      Required Components
- Raspberry Pi (or Jetson Nano, PC with USB-GPIO)
- 2x SG90 Servo Motors (0-180 degrees)
- Camera (Raspberry Pi Camera Module or USB webcam)
- External 5V DC power supply (recommended for actual use)
- Jumper wires
Wiring
Servo Motor 1:
- Red wire → 5V power (external DC power supply recommended)
- Brown/Black wire → GND
- Orange/Yellow wire → GPIO 23
Servo Motor 2:
- Red wire → 5V power (external DC power supply recommended)
- Brown/Black wire → GND
- Orange/Yellow wire → GPIO 24
Camera:
- Raspberry Pi Camera: Connect to camera CSI port
- USB Camera: Connect to any USB port
⚠️Important Notes:
- 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
- Install software: Download and install Grablo software on your Raspberry Pi
- Set up hardware: Wire servo motors and connect camera according to circuit diagram above
- Get this project: Project Link
- Connect controller: In your project, go to "Connect Controller" and enter IP address
- 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
- Go to https://app.grablo.co
- Click "Create Project"
- Give your project a name
Start Camera and Face Detection
 
      Control 1 - Start Camera and Face Detection
Create a new logic and control that starts the camera and continuously detects faces
- Condition (Once): Run only once when project starts
- Action (AI Camera): Initialize camera with face detection
- AI Analysis 1: Detect if face is present
- 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
 
      Control 2 - Servo Motor Tracking
Create a control that rotates servo motors to follow the detected face
- Condition (Compare): Only move servos when face is detected
- Action 1 (Set Variable): Calculate servo angle from face position
- Action 2 (Custom Action - OPTIONAL): Add motion smoothing to eliminate jitter
- Action 3 (I/O Device Control): Control first servo motor
- Action 4 (I/O Device Control): Control second servo motor
Create Dashboard
 
      Create a new dashboard with these widgets:
- Camera Widget: Shows live camera feed with face detection overlay
- LED Widget: Face Detection Status
- Label Widget: Face X-Coordinate
- 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:
- Camera starts: AI face detection activates
- Face detected: Servo motors begin tracking
- Move left/right: Servos follow your face position smoothly
- Multiple faces: System tracks the largest face
- No face: Servos hold last position
- Dashboard updates: Real-time display of face position and servo angles
Run Your Project:
- Install software: Download and install Grablo software on your Raspberry Pi
- Set up hardware: Wire servo motors and connect camera according to circuit diagram
- Connect controller: In your project, go to "Connect Controller" and enter IP address
- Hit RUN: Watch the servos track your face like robotic eyes!
Video Tutorial
 
      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:
- Full pan-tilt control: Add face Y-coordinate detection to control the second servo for vertical tracking (true 2D face following)
- Object tracking: Change AI Analysis Type from "Face Detection" to "Object Detection" to track balls, hands, or specific colored objects
- LED indicators: Add LED that lights up when face is detected or changes color based on tracking status
- Motion-triggered snapshots: Automatically save camera snapshots when face is detected - useful for home security or visitor logging
Troubleshooting
No face detection:
- Verify camera is working (check camera preview in dashboard)
- Ensure adequate lighting (face detection works best in good light)
- Adjust distance from camera (optimal range: 0.5-3 meters)
Servos not moving:
- Verify GPIO pin numbers match your wiring
- Check servo power supply (use external 5V DC recommended)
- Confirm Face_Detected variable is True in dashboard
Servos shaking/jittering:
- Add or adjust smoothing filter (Step 4, Action 2 - Optional)
- Increase filter strength (try 0.3/0.7 instead of 0.5/0.5)
Choppy video:
- Reduce camera resolution
- Close other applications on Raspberry Pi
- 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