Introduction: AI Binocular 3D Vision Recognition Sensor (Face/Palm Vein) – Storage Box Application Project

About: Empowering Creation for Future Innovators; Our mission is to form a community with easy access to whether hardware, software and ideas that allow makers and younger generation to achieve their goals and realiz…

Hey, you know what? Nowadays, the use of face and palmprint recognition is becoming more and more common in our life. Whether it's in the access control systems of companies, or in the entry and exit management of some high-end residential communities, and even in the unlocking functions of our commonly used mobile phones, we can see it everywhere.


What is AI Binocular 3D Vision Recognition Sensor?


DFRobot has newly released an AI binocular 3D vision recognition sensor. This sensor is a device that combines binocular 3D living body detection, deep neural network algorithms and infrared camera technology. It solves the key needs that users face in smart door locks, self-service retail payment terminals and vein palmprint recognition systems. That is, it can ensure safe, fast and reliable identity verification in dark environments or under complex lighting conditions.

I've made a simple storage box that can only be opened by face and palmprint recognition using this AI binocular vision recognition sensor. Come and check out the production process of my project!

Supplies

To follow along with this guide, you’ll need the following:

DFR0216 DFRduino Uno R3 * 1: Product Link

FIT0056 USB Cable A-B for Arduino Uno * 1:Product Link

DFR0265 IO Expansion Shield for Arduino * 1: Product Link

DFR0760 Text to Speech Voice Synthesizer Module * 1: Product Link

SEN0677 AI Binocular 3D Vision Recognition Sensor * 1: Product Link

DFR0997 IPS Color Serial Display * 1: Product Link

DFR0017 Digital 5A Relay Module for Arduino * 1: Product Link

Step 1: Hardware Connection

When connecting the hardware, besides making sure all the functions work properly, you also gotta think about how it looks and how easy it is to use! Feel free to get creative—make your storage box even more useful!

Step 2: Arduino Preparation

Step 1. Download and install the latest version of Arduino IDE according to your operating system

Step 2. Launch the Arduino application

Step 3. Add the AVR board package to your Arduino IDE

Navigate to Tools > Board > Boards Manager..., then type “AVR” in the search box. Download and install the latest version of the package.

Step 4. Select your board and port Board:Navigate to Tools > Board > Arduino AVR Boards,and select Arduino Uno

Before uploading code, configure your board settings:

  1. USB CDC On Boot: Enabled: Print serial data via the USB interface
  2. Port:

Navigate to Tools > Port and select the correct serial port for your board. Make sure the COM number is correct; it does not need to match the chip model.

Step 5. Navigate to Sketch > Include Library > Add .ZIP Library...

In Arduino IDE, install the library by importing the .zip package. You can follow the official Arduino tutorial here: Installing Libraries (.zip).

For the library files that go with each product, just check the product wiki to download.

Step 3: Key Steps Broken Down

For the separate user guide of each product, just check the product wiki!

Step 1. Before you start the whole project, you gotta register the face and palm print info into the dual-camera face & palm module first. Seriously—skip this step, and later you’ll find the module can’t recognize anything at all. For the details, just check the instructions that came with it: https://wiki.dfrobot.com/SKU_SEN0677_AI_Binocular_Vision_Recognition_Sensor_Face_Palm_Vein_QR_Code

Step 2. Import those library files.This step’s a must—otherwise, you’ll get an error saying files are missing!

// Include the binocular AI sensor library
#include "DFRobot_AI10.h"
// Include the speech synthesis library
#include "DFRobot_SpeechSynthesis_V2.h"
#include <Wire.h>
#include <LiquidCrystal_I2C.h>
// Include the LCD display library
#include "DFRobot_LcdDisplay.h"

Step 3. Fire up the baud rate, sensors, and actuators first.

void setup() {
// Start serial communication
Serial.begin(115200);

// Set up the electromagnetic lock
pinMode(6, INPUT_PULLUP); // Pin 6 as input with pull-up resistor
pinMode(Relay, OUTPUT); // Relay pin as output

// Initialize the LCD screen
lcd.begin();
lcd.cleanScreen(); // Clear the screen

Step 4. Figure out if it’s a face or a palm print, then tell apart the user IDs. Of course, you can just set it up for face recognition only, or palm print only—whatever you want, really! You’re in charge here~

// Show what was recognized (face or palm)
Serial.print("Recognized: ");
Serial.println(recDat.type == eFace ? "Face" : "Palm");
Serial.print("User ID: ");
Serial.println(recDat.userData.UID);

// Show corresponding image based on recognition type
if(recDat.type == eFace){
Serial.println("It's a face!");
ss.speak(F("Face recognized"));
digitalWrite(Relay, HIGH); // Unlock the box
lcd.updateIcon(pictureId, 0, 0, "face.png", 256); // Show face image
} else {
Serial.println("It's a palm!");
ss.speak(F("Palm recognized"));
digitalWrite(Relay, HIGH); // Unlock the box
lcd.updateIcon(pictureId, 0, 0, "palm.png", 256); // Show palm image
}

Step 5. It’ll only unlock if it recognizes the owner’s face or palm print~ If not, it’ll just keep waiting for a valid scan... That way, nothing in the storage cabinet gets stolen!

// Show unlock screen and message
ss.speak(F("Unlocked"));
lcd.updateIcon(pictureId, 0, 0, "unlock.png", 256); // Show unlocked image
delay(2000); // Keep unlocked for 2 seconds

// Lock again and update display
ss.speak(F("Locked"));
lcd.updateIcon(pictureId, 0, 0, "lock.png", 256); // Show locked image
digitalWrite(Relay, LOW); // Lock the box
delay(2000);

} else {
// If nothing was recognized, show scanning message
Serial.println("Scanning...");
lcd.updateIcon(pictureId, 0, 0, "reco.png", 256); // Show scanning image
delay(1000); // Check again after 1 second
}

Step 4: Complete Code Attachment

Heads up! Make sure to set the correct pins for the sensors and actuators.

The most basic stuff for a dual-camera face and palm print storage box? Well, it’s gotta recognize faces and palm prints, have an electric lock to pop open, and of course the box itself. But here’s the fun part – you can get creative with all of it! So c’mon, use your imagination, take what I’ve got here, and make this storage box totally your own!