Lesson 22

Face Recognition (Hiwonder 7.7)

🎯 Learning Objectives

🙂 What Face Recognition Does

Goal

In Hiwonder 7.7, the ESP32-S3 vision module detects faces. When a face is detected, the robot performs a small “greeting” action.

This is a great example of a sensor-driven event: face detected triggers lights + motion.

  • Default: RGB light is white
  • On face detected: RGB changes to green and the robot shakes (greeting gesture)

⬇️ Program Download Notes

ESP32-S3 + UNO

This lesson uses two programs:

  • ESP32-S3 program: runs face detection on the camera
  • UNO program: reads results and triggers the robot’s greeting behavior

Safety Note

Before downloading code to the Arduino UNO, remove the Bluetooth module to prevent serial port conflicts.

🔬 Hands-On Activity: Face Detection Greeting

Project Goal

Demonstrate that the robot can detect a face and respond with a greeting: LED turns green and the robot shakes.

Step-by-Step

  1. Flash firmware: Upload the ESP32-S3 face recognition program and the UNO program
  2. Power on: Confirm RGB is white by default
  3. Present a face: Stand in front of the camera in good lighting
  4. Observe response: RGB turns green and the robot performs a small shake

Troubleshooting

  • No detection: Improve lighting and reduce background clutter
  • False detections: Avoid posters/photos in the background
  • Unstable response: Hold still for a moment and keep face centered

📋 Assessment & Homework

Practice Exercises

  1. Test detection at 3 distances and record when it becomes unreliable
  2. Test in bright vs dim lighting and compare results
  3. Add a cooldown so the robot doesn’t shake repeatedly too fast

Challenge Projects

  • Wave: Replace “shake” with a different movement pattern
  • Friendly Mode: Add a sound pattern when a face is detected
  • Robust Detection: Require detection across N frames before reacting

Reflection Questions

  1. Why does lighting matter so much for computer vision?
  2. What are some ethical considerations of face recognition in the real world?
  3. How could you reduce false positives without making detection too slow?
← Lesson 21: Vision Line Following 📚 Semester Overview Next: Lesson 23 →