Face Recognition Smart Door With Voice Greeting (No-Code)
by KimY21 in Circuits > Cameras
69 Views, 1 Favorites, 0 Comments
Face Recognition Smart Door With Voice Greeting (No-Code)
This tutorial shows how to build a Face Recognition Smart Door using visual programming blocks. Register faces, recognize them in real-time, open doors with a servo motor, and greet visitors by name with text-to-speech—no coding required!
What You'll Build
A face recognition smart door with:
- Real-time face registration and recognition
- Servo motor door control (open/close)
- Personalized voice greetings via text-to-speech
- False-trigger prevention with hold-time logic
- No coding required
Supplies
Required Components
- Raspberry Pi or supported hardware
- Camera (Raspberry Pi Camera Module or USB Camera)
- SG90 Servo Motor (or any PWM servo)
- Speaker (3.5mm audio jack, USB audio adapter, or Bluetooth)
- Jumper Wires
Servo Motor Wiring
- Signal (Orange/Yellow) → GPIO Pin (as selected in pin map)
- VCC (Red) → 5V Power
- GND (Brown/Black) → Ground
⚠️ For multiple servos or heavy loads, use an external power supply instead of powering directly from the Raspberry Pi.
Camera Options:
- Raspberry Pi Camera Module (CSI)
- USB Camera
Speaker Options:
- 3.5mm audio jack
- USB audio adapter
- Bluetooth speaker
Quick Start
- Download and install Grablo software on your Raspberry Pi
- Connect camera, speaker, and servo motor
- Get this project
- Open Grablo app in your browser
- Connect to your Raspberry Pi and hit RUN!
- Type a name and click Enroll to register faces
- Walk up to the camera and hear your personalized greeting
To build it yourself, continue to Step 2.
Create Dashboard
Create Project & Dashboard
- Go to https://app.grablo.co
- Click "Create Project"
- Name your project
- Select your device (Raspberry Pi 4 for this tutorial)
- Create a new dashboard
Add Widgets
- Camera Widget: Select your camera to display the live video feed
- Push Button Widget: Create an "Enroll" variable to trigger face registration
- Input Widget: Create a "Name to Enroll" variable for typing the person's name
- Label Widget: Display the total number of enrolled faces
- LED Widget: Indicate whether the detected face is a registered one
- Label Widget: Display the recognized person's name
- LED Widget: Show whether the door is currently open or closed
Logic - Start Camera & Face Recognition
Control 1: Start Camera with Face Recognition
Start the camera and enable face recognition when the project begins.
- Condition (Once): Runs once at project start
- Action (AI Analysis): Create a new AI Analyzer, select camera, set AI Model to Face Recognition, Type to Recognize Face, assign output variables (Registered and Recognized Name)
- Action (Camera): Select camera, Command to Start
Control 2: Enroll Face
Register a new face whenever the Enroll button is pressed on the dashboard.
- Condition (Compare): Enroll = True, Option = Rising Edge
- Action (AI Analysis): Select AI Analyzer, Command = Add Analysis, Type = Enroll Face, Face Name = From Variable (Name to Enroll)
Control 3: Enrolled Face Count
Continuously track the total number of registered faces.
- Condition (Always): Runs on every cycle
- Action (AI Analysis): Select AI Analyzer, Command = Add Analysis, Type = Get Enrolled Count, assign to Face Count variable
Logic - Door Opening/Closing
Control 4: Open Door
Open the door when a registered face is detected continuously for 3 seconds. This prevents false triggers.
- Condition (Compare): Registered = True, Option = Hold Time: 3 seconds
- Condition (Compare): Door Open = False (only open if currently closed)
- Action (TTS): Create new TTS, Command = Play, Output Text = use block editor to join "Welcome home, " + Recognized Name + ". Door opening."
- Action (IO Device): Create Servo Motor, select GPIO pin, Command = Set Position, 90 degrees
- Action (Set Variable): Door Open = True
💡 Tip: Use the block editor to compose the TTS greeting. Connect a text join block to the return block, expand to 3 slots, and include the Recognized Name variable in the middle.
Control 5: Close Door
Close the door when no registered face is detected for 3 seconds.
- Condition (Compare): Registered = False, Option = Hold Time: 3 seconds
- Condition (Compare): Door Open = True (only close if currently open)
- Action (TTS): Command = Play, Output Text = "Door closing."
- Action (IO Device): Select Servo Motor, Command = Set Position, 0 degrees
- Action (Set Variable): Door Open = False
💡 Tip: Duplicate Control 4 and modify the conditions and actions to quickly create this control.
Launch Your Project
That's it—you're done!
Launch Your Project
- Open Grablo app in your desktop or mobile browser
- Select your project
- Connect to your Raspberry Pi
- Hit RUN and enjoy!
Expected Results
When you run your project:
- Camera view appears with face detection overlay
- Unregistered face: Red border labeled "Unknown"—door stays closed
- Enroll a face: Type name, click Enroll → face count increases, recognized immediately
- Registered face for 3 seconds: TTS greets by name, servo rotates to 90°, door opens
- No registered face for 3 seconds: TTS says "Door closing", servo returns to 0°, door closes
- Register hundreds or even thousands of faces!
Video Tutorial
Watch the complete build process in action!
Expand Your Project
Add more functionality:
- Add a buzzer alert for unregistered faces
- Log entry/exit times to the dashboard
- Integrate with a relay to control an electric door lock
- Add a "Delete Face" button for managing enrolled faces
Troubleshooting
Face not detecting:
- Ensure adequate lighting on the face
- Check camera connection and orientation
- Make sure the face is within the camera's field of view
Door opens for unknown faces:
- Verify the Compare condition checks Registered = True
- Ensure Hold Time is set (3 seconds recommended)
- Check that the correct variable is assigned
TTS not speaking:
- Check speaker connection
- Verify TTS action is configured with Command = Play
- Test with simple text first before using variables
Servo not moving:
- Verify GPIO pin matches your wiring
- Check power supply to the servo
- Test with different angle values (0° and 90°)
Door keeps opening and closing rapidly:
- Verify Hold Time is set in both open and close conditions
- Ensure Door Open variable is properly toggled in both controls
- Check that conditions include the door state check
Resources
- Website: https://grablo.co
- Download: https://grablo.co/download
- Web App: https://app.grablo.co
- Docs: https://doc.grablo.co
- Support: support@grablo.co