Build an autonomous robot that detects and follows people in real-time. This AI-powered system combines computer vision with PI control for smooth tracking through differential drive steering—built using Grablo, a visual programming platform.
Why did we decide to make it?Creating person-following robots traditionally requires complex programming: implementing computer vision pipelines, calculating tracking errors, implementing PID control algorithms, integrating motor drivers, and coordinating all systems together. Using Grablo's visual blocks, no traditional coding is needed.
What You'll BuildA complete autonomous person-following robot featuring:
- Real-time person detection using on-device AI
- PI control for smooth, stable tracking
- Differential drive steering
- Collision prevention with distance sensor
- Dashboard with live camera feed and telemetry
- Tracks the largest person when multiple people are present
Quick Start
- Install software: Download and install Grablo on your Raspberry Pi
- Set up hardware: Wire components according to wiring diagram
- Get this project: Project Link
- Connect controller: Enter Raspberry Pi IP address
- Hit RUN: Watch your robot track and follow you!
💡 Want to build it yourself? Continue to Build Process
Build ProcessLogicControl 1: Camera and Person Detection
Set up the camera to continuously detect people.
- Condition (Once): Run once at startup
- Action (AI Camera): Start camera
- AI Analysis 1: Detect if person is present
- AI Analysis 2: Get person's center X-coordinate
This runs continuously, updating detection status and position in real-time.
Control 2: Distance Measurement
Measure distance continuously for collision prevention.
- Condition (Always): Run continuously
- Action (I/O Device Control): Read distance sensor
Control 3: Motor PI Control
Calculate wheel speeds and move the robot.
- Condition 1 (Compare): Check if person detected
- Condition 2 (Compare): Check if distance > 30cm
- Action 1 (Set Variable): Calculate PI control using Block Editor
- Action 2 (I/O Device Control): Set left motor speed
- Action 3 (I/O Device Control): Set right motor speed
Control 4: Stop Motors
Stop motors when conditions aren't met.
- Condition (Watch Condition): Watch Control 3, set to "Invert"
- Action 1 (I/O Device Control): Stop left motor (Coast Stop)
- Action 2 (I/O Device Control): Stop right motor (Coast Stop)
- Action 3 (Set Variable): Reset accumulated error to 0
Add widgets for monitoring:
- Camera Widget: Live feed with detection overlay
- LED Widget: Person Detection Status
- Label Widget: Distance
- Label Widget: Error
- Label Widget: Speed Correction
Congratulations! You've built a complete AI-powered person-following robot using only 4 simple controls and zero lines of code.
Expected Results
When you run your project:
- Person detected: Robot moves forward to follow
- Move left/right: Robot turns by adjusting wheel speeds
- Multiple people: System tracks the largest person
- Distance < 30cm: Robot stops automatically
- No person: Robot stops and resets
- Dashboard updates: Real-time display of camera and distance sensor
⚠️ Critical Notes:
- HC-SR04P must use 3.3V (NOT 5V) to protect GPIO pins
- Keep Raspberry Pi and motor power supplies separate
- Connect common ground between Raspberry Pi and L298N
Watch the complete build process in action:
What's Next?Expand your project:
- Voice control with STT (Speech-to-Text)
- Voice output with TTS (Text-to-Speech)
- Music playback and sound effects
- LED effects and status indicators
- Adjustable base speed
No person detection:
- Check camera connection and lighting
- Adjust camera angle (aim at person's height)
- Optimal distance: 0.5-5 meters
Robot not moving:
- Verify GPIO connections and battery charge
- Test motor directions
Aggressive turning or oscillation:
- Reduce gains from 0.06 to 0.04
- For oscillation, reduce I gain to 0.03
Distance sensor issues:
- Must use 3.3V (NOT 5V)
- Verify common ground connection
- Official Website: https://grablo.co
- Web Application: https://app.grablo.co
- Documentation: https://doc.grablo.co
- Support Email: support@grablo.co












_3u05Tpwasz.png?auto=compress%2Cformat&w=40&h=40&fit=fillmax&bg=fff&dpr=2)
Comments