The ESP32-S3 can look at a camera frame and tell you where the faces are, on the chip itself, with no cloud account and no video leaving the board.
This guide covers what the ESP32-S3 can and cannot do with faces, detection vs recognition, which boards work, the no-code and Arduino routes, and the mistakes that waste the most time. Nothing here needs a paid app or a cloud account for the on-device routes.
What is face detection on the ESP32-S3, and what can it actually do?
Face detection on the ESP32-S3 means a small neural network model runs on the chip, looks at each camera frame, and returns a box around every face it finds, plus a confidence score for each box. Your code gets the boxes: light an LED, count people, trigger a relay, send an MQTT message, or save a snapshot.
It works on the ESP32-S3 and not well on the classic ESP32 because of the hardware. The ESP32-S3 has vector instructions that speed up neural network math, and camera boards built on it carry 8 MB of PSRAM, which holds the frame and the model weights. Source: Espressif edge AI workshop and ESP-WHO docs.
Detection runs on small frames. The models are trained on small inputs, so the camera captures at a low resolution for inference even when the sensor can shoot much higher. Espressif’s workshop lists QVGA (320 by 240) as the typical frame size for face detection and HVGA (480 by 320) for face recognition. Source: Espressif edge AI workshop, Assignment 4.
What is the difference between face detection and face recognition?
Detection and recognition are two different jobs, and mixing them up is the most common source of disappointment with these boards.
Face detection answers “is there a face in this frame, and where”. It returns boxes and confidence scores and knows nothing about who the person is. A doorbell that lights up when someone approaches and a people counter at a doorway need detection only.
Face recognition answers “whose face is this”. It runs detection first, then turns each detected face into a numerical embedding and compares it against faces you enrolled earlier. You show the board each person’s face and give it a name, and the board stores the result. A door lock that opens for family members needs recognition.
Recognition is harder, slower, and more fragile than detection. It needs the face to be larger in the frame, better lit, and facing the camera more directly. It also stores face data on the board: tell everyone in the household what the camera stores, and do not use recognition to identify people who have not agreed to be enrolled. This guide gives no accuracy percentage for recognition, because no primary source we checked publishes one.
| Task | Question it answers | Needs enrollment | Typical use |
|---|---|---|---|
| Face detection | Is there a face, and where | No | Doorbell alert, people counting, intruder alert |
| Face recognition | Whose face is this | Yes, one enrollment per person | Door lock for family, attendance |
| Person detection | Is there a person in frame | No | Room occupancy, trail camera trigger |
Which ESP32-S3 boards work for face detection?
Any ESP32-S3 camera board with PSRAM can run a face detection model. The classic ESP32-CAM is the exception: on-device face detection models were removed from the Arduino ESP32 core version 3, so the classic board is a poor choice for new on-device face projects. It can still capture a picture and send it to a cloud API for detection. Source: Robojax tutorial.
| Board | Chip | Camera | PSRAM | Face detection |
|---|---|---|---|---|
| XIAO ESP32S3 Sense | ESP32-S3 | detachable camera | 8 MB | Yes, on device |
| ESP32-S3-N16R8 CAM | ESP32-S3 | OV5640, 5 MP | 8 MB | Yes, on device |
| Classic ESP32-CAM | ESP32 | OV2640 | 4 MB | Not recommended on device |
The XIAO ESP32S3 Sense is the smallest option: an ESP32-S3 dual-core 240 MHz board with 8 MB PSRAM and 8 MB flash, a detachable camera, a digital microphone, a microSD slot, WiFi and Bluetooth 5.0, in a 21 by 17.5 mm footprint. The detachable camera matters: mount the tiny camera where the faces are and keep the board tucked away.
The ESP32-S3-N16R8 CAM is the larger, cheaper bench board: a dual-core ESP32-S3 with 16 MB flash plus 8 MB PSRAM and an OV5640 5 MP camera, with two USB-C ports that split OTG and serial duties, so it programs over USB with no adapter. The higher resolution sensor does not make detection better, because detection runs on small frames.
Which approach should you pick?
There are four working routes. Pick one row and follow its section.
| Approach | Code needed | Toolchain | Best for |
|---|---|---|---|
| SenseCraft AI (Seeed) | None, deploy in a browser | Web platform, USB cable | Fastest first detection |
| Arduino IDE with esp-dl models | Arduino sketch | Arduino IDE, ESP32 core 2.0.17 | Full control, offline recognition |
| ESP-WHO with ESP-IDF | C, ESP-IDF project | ESP-IDF v5.5.x | Espressif reference examples |
| Cloud API detection | Arduino sketch plus an API key | Arduino IDE, internet | Classic ESP32-CAM |
How do I run face detection with SenseCraft AI, with no code?
SenseCraft AI is Seeed’s edge AI platform. It deploys a prebuilt model to a supported board from a browser, with no machine learning code and no toolchain install. This is the fastest route to a working face detector.
- Plug the XIAO ESP32S3 Sense into your computer with a USB-C data cable. A charge-only cable will power the board but the browser will never see it.
- Open the SenseCraft AI model page at https://sensecraft.seeed.cc/ai/model. Under Pretrained Models, set Task to Detection and Supported Devices to XIAO ESP32S3 Sense, then search “Face”.
- Pick the Swift-YOLO face detection model. As of July 2025 there were two face models listed, and the Makerguides tutorial reports only the Swift-YOLO one worked.
- Click Deploy Model, then Connect Device, pick the COM port the board is on, and confirm. The model downloads to the board in about 1 to 2 minutes. Source: Seeed SenseCraft AI wiki.
- The preview starts on its own, with bounding boxes drawn around detected faces in the live feed, each box carrying a confidence score.
Two settings control what counts as a detection. The confidence threshold filters detections by how sure the model is that something is a face: every detection scores 0 to 100 percent, and anything below the threshold is discarded. A lower threshold catches more faces but also flags more non-faces. The IoU (Intersection over Union) threshold decides which overlapping boxes to keep when the model draws several boxes around one face. Source: Makerguides tutorial.
SenseCraft models also offer outputs from the sidebar: a GPIO pin that goes high when a face is detected, serial output over UART, I2C or SPI with the face count and confidence, or MQTT over WiFi for a home automation system. GPIO is enough for a door opener or an alarm; MQTT is for Home Assistant. Source: Makerguides tutorial and Seeed wiki.
How do I run face detection with Arduino IDE?
Use the Arduino route when you want the detection inside your own sketch, for example a camera that also drives a relay or serves a web page. The Robojax XIAO face recognition tutorial is the clearest Arduino reference we found, and its settings are strict: get one wrong and the sketch will not compile or will not detect anything.
- Install Arduino IDE and add the ESP32 board package. In Boards Manager, install ESP32 core version 2.0.17. This version matters most: Espressif removed the on-device face detection models in core 3, so the project cannot compile there. Version 2.0.17 is the last 2.x release with both those models and the XIAO_ESP32S3 board definition. Source: Robojax tutorial.
- Select the board as XIAO_ESP32S3, not ESP32S3 Dev Module. The board definition carries the right camera pins and PSRAM settings.
- Set PSRAM to OPI PSRAM. It is off by default, and nothing works without it. Set Flash Size to 8 MB, Partition Scheme to Default with SPIFFS, USB CDC On Boot to Enabled, and Upload Speed to 921600, dropping to 460800 if uploads fail. Source: Robojax tutorial.
- Use the face detection models from the ESP32 core: HumanFaceDetectMSR01 as stage one to find candidate faces, and HumanFaceDetectMNP01 as stage two to refine the boxes and add five facial keypoints. The pipeline captures at 240 by 240 in RGB565, runs both stages, draws the boxes into the frame, then compresses to JPEG for streaming. Source: Robojax tutorial.
- Get the camera stream working before adding detection. Flash a plain camera sketch first and confirm the video shows in a browser. If the stream fails, the fault is in the camera setup, not the model. Our ESP32-S3-CAM setup guide covers the first-stream steps.
How do I add face recognition, so the board knows who it is?
Recognition adds two steps after detection: enroll faces, then match new faces against them.
Enrollment means showing the board each person’s face and storing the result. In the Robojax offline recognition project, enrollment happens from the board’s own web page: you type a name into a roster slot, point the camera at the person, and save. The board makes its own WiFi network for this, so no router and no internet are involved, and no face ever leaves the board. The stored data is a numerical embedding, not a photo, but it still identifies a person.
Matching means each new detected face is turned into an embedding and compared against every stored embedding. The EloquentEsp32cam docs describe the pipeline: align the face, generate a 512-dimensional embedding, compare it against stored embeddings, and return the best match if the similarity passes a threshold. Recognition typically takes 80 to 150 ms on ESP32-S3 hardware, for the recognition step alone. Source: EloquentEsp32cam DeepWiki docs.
The ESP-WHO framework is the Espressif reference route for recognition, with a state machine for ENROLL, RECOGNIZE, and DELETE operations. It targets ESP-IDF v5.5.x and the ESP32-S3 and ESP32-P4 chips. Source: Espressif ESP-WHO get started guide.
Do not use recognition as a security lock on its own. A small on-device model can be fooled by a printed photo, and no primary source we checked publishes a spoof resistance claim for these models. Keep a separate lock, code, or key for anything that must stay secure.
What are the accuracy and speed limits?
No source we checked publishes one tested accuracy number or one tested frame rate for ESP32-S3 face detection, so this guide gives neither as a universal claim. The limits below are what named sources state on their own setups.
- Resolution for inference is small. Face detection runs at QVGA (320 by 240) and face recognition at HVGA (480 by 320) in Espressif’s workshop, and the Arduino recognition pipeline captures at 240 by 240. A face that is small in the frame will not be detected, whatever the sensor’s maximum resolution is. Source: Espressif edge AI workshop, Robojax tutorial.
- Recognition is slower than detection. The EloquentEsp32cam docs state recognition typically takes 80 to 150 ms on ESP32-S3 hardware, for the recognition step alone, or roughly 7 to 12 recognitions per second before capture and streaming are counted. Source: EloquentEsp32cam DeepWiki docs.
- Frame rate depends on resolution and settings. The Tokay Lite vendor page, for an ESP32-S3 camera board with 8 MB PSRAM, states its face detection model runs at 1 to 10 frames per second depending on resolution and settings. That is a vendor claim for their board, not a measured number for the XIAO Sense or the S3-N16R8 CAM. Source: Maxlab Tokay Lite page.
- Lighting and angle matter more than the sensor. Faces that face the camera, are well lit, and fill a reasonable part of the frame detect reliably. Backlit faces, faces in profile, and faces at a steep angle do not. Test where the camera will live before mounting it permanently.
What are the common mistakes?
- Using Arduino ESP32 core 3 for an on-device face sketch. The face detection models were removed in core 3. Use 2.0.17. If a sketch fails to compile with a missing face detect header, check the core version first.
- Leaving PSRAM off. OPI PSRAM is off by default on the XIAO board definition, and the face pipeline will not run without it. Set it before the first upload.
- Picking the wrong board definition. XIAO_ESP32S3, not ESP32S3 Dev Module. The wrong definition gives the wrong camera pins.
- Running detection at full sensor resolution. The models are trained on small inputs. Capture small for detection.
- Trusting recognition as the only lock. No spoof resistance claim exists for these small models. Keep a separate lock or code.
How do I troubleshoot face detection that does not work?
Work through this list in order.
The camera never shows a picture. Flash a plain camera sketch first. If that fails, the fault is wiring, pins, or power, not the model. Check the USB cable is a data cable and reseat the camera ribbon cable. Our ESP32-CAM getting started guide covers first-stream failures.
The sketch will not compile, missing human face detect headers. Check the ESP32 core version in Boards Manager. It must be 2.0.17 for the on-device face models. Source: Robojax tutorial.
The board boots but detection never fires. Check PSRAM is set to OPI PSRAM in the Arduino IDE tools menu, and that the frame size is 240 by 240 or QVGA. Then lower the confidence threshold and test with a face close to the camera, well lit, facing the lens.
Faces are detected but with many false positives. Raise the confidence threshold until non-faces stop triggering, then check real faces still trigger.
Which board should you buy?
- Buy the XIAO ESP32S3 Sense if you want the smallest camera that runs face detection or the no-code SenseCraft AI route.
- Buy the ESP32-S3-N16R8 CAM if you want the cheapest bench board, you prefer dual USB-C with no adapter, or you want the extra flash headroom.
- Keep the classic ESP32-CAM if you only need to stream video or send a picture to a cloud API for detection.
- Buy neither yet if you need to identify strangers, read faces at long range, or run a security system. No small on-device model does those jobs well. Our Arducam camera guide covers the Pi side.
Parts used in this guide
Prices and stock were verified live on qualityrcparts.com on 2026-11-21. All three items are in stock and purchasable.
- Seeed Studio XIAO ESP32S3 Sense Development Board, 1-Pack (ID 17842) – $32.49. ESP32-S3 dual-core 240 MHz, 8 MB PSRAM and 8 MB flash, detachable camera, digital microphone, microSD slot. The pick for SenseCraft AI and small enclosures.
- ESP32-S3-N16R8 CAM Development Board with OV5640 Camera, Dual USB-C, WiFi + Bluetooth 5 (ID 19636) – $22.99. 16 MB flash plus 8 MB PSRAM, OV5640 5 MP camera, two USB-C ports, no adapter needed.
- ESP32-CAM Development Board with OV2640 Camera Module, 4MB PSRAM (ID 13473) – $25.99. The classic ESP32-CAM, for the cloud API route and plain streaming only; not recommended for new on-device face detection work.
Shipped fast and securely from our secure facility in Queensbury, NY. QRC ships within the USA only.
Related guides
- ESP32-CAM vs ESP32-S3-CAM: Which Camera Board to Pick – compare the two camera boards.
- How to Use the ESP32-S3-CAM Board for Camera Projects – the S3 board setup guide.
- Seeed XIAO ESP32S3 Guide: Standard Board vs Sense Board – XIAO board differences and camera setup.
- How to Start with ESP32-CAM for WiFi Camera Projects – first-time setup for the classic ESP32-CAM.
- ESP32-CAM RTSP Streaming: Setup Guide for VLC and NVR – feed a camera into VLC, Frigate, or an NVR.
FAQ
Can the ESP32-S3 do face detection? Yes. The ESP32-S3 runs small on-device face detection models with no cloud. Detection runs on small frames, typically QVGA (320 by 240) or 240 by 240. Source: Espressif ESP-WHO docs and edge AI workshop.
What is the difference between face detection and face recognition on ESP32-S3? Detection finds faces and returns boxes. Recognition identifies whose face it is by comparing it against faces you enrolled earlier. Detection needs no enrollment; recognition needs one per person, stores face embeddings on the board, and is slower and more sensitive to lighting and angle. Source: Espressif ESP-WHO docs, EloquentEsp32cam docs.
Which ESP32 board is best for face detection? The XIAO ESP32S3 Sense is the best small board, and the ESP32-S3-N16R8 CAM is the best cheap bench board. Both are ESP32-S3 with 8 MB PSRAM and run the same on-device models. The classic ESP32-CAM is not recommended for new on-device face work. Source: Robojax tutorial, QRC live listings.
Can I do face detection on ESP32-S3 with Arduino? Yes, with Arduino IDE and ESP32 core version 2.0.17. Core 3 removed the on-device face detection models, so 2.0.17 is required. Select XIAO_ESP32S3, set PSRAM to OPI PSRAM, and capture at 240 by 240. Source: Robojax tutorial.
Can the ESP32-S3 do face recognition offline? Yes. Recognition runs on the board with no internet: the Robojax offline project enrolls faces from the board’s own web page over its own WiFi network. No face data leaves the board. Source: Robojax tutorial, Espressif ESP-WHO docs.
How far away can the ESP32-S3 detect a face? No primary source we checked publishes a detection range in feet or meters. Detection depends on how large the face is in the small inference frame, plus lighting and angle. Test at the real mounting distance.
Sources
- Espressif ESP-WHO get started: https://developer.espressif.com/blog/2026/05/esp-who-get-started/
- Espressif edge AI with ESP32-S3 workshop, Assignment 4: https://developer.espressif.com/workshops/edge-ai-with-esp32-s3/assignment-4/
- Espressif ESP-WHO repository: https://github.com/espressif/esp-who
- Espressif esp-dl library: https://github.com/espressif/esp-dl
- Makerguides, Face Detection with XIAO ESP32-S3-Sense and SenseCraft AI: https://www.makerguides.com/face-detection-with-xiao-esp32-s3-sense-and-sensecraft-ai/
- Seeed Studio wiki, Using a model for XIAO ESP32S3 Sense: https://wiki.seeedstudio.com/sensecraft_ai_pretrained_models_for_xiao/
- SenseCraft AI model page: https://sensecraft.seeed.cc/ai/model
- Robojax, XIAO ESP32-S3 Sense offline face recognition: https://robojax.com/tutorial_view.php?lang=en&id=854
- EloquentEsp32cam face recognition docs: https://deepwiki.com/eloquentarduino/EloquentEsp32cam/5.2-face-recognition
- Hackster, Face Recognition Based Attendance System Using XIAO ESP32S3: https://www.hackster.io/roboattic_Lab/face-recognition-based-attendance-system-using-xiao-esp32s3-05b7d1
- Hackster, Lesson 9: Make ESP32 React to Face Detection: https://www.hackster.io/williamsokol0/lesson-9-make-esp32-react-to-face-detection-f596de
- CircuitDigest, ESP32-CAM Face Detection System using CircuitDigest Cloud: https://circuitdigest.com/microcontroller-projects/esp32-cam-face-detection-using-circuitdigest-cloud
- element14 community, Seeed Xiao ESP32S3 Sense: https://community.element14.com/technologies/sensor-technology/b/blog/posts/seeed-xiao-esp32s3-sense?pifragment-7298=2
- Maxlab Tokay Lite, ESP32-S3 edge AI camera board: https://maxlab.io/store/tokay-lite/
- Espressif esp32-camera repo: https://github.com/espressif/esp32-camera
Last updated: 2026-11-21
