1.1 Project Introduction
Have you ever experienced situations like these? During rush hour after work, long queues build up at the entrance of your residential community, where security guards have to check license plates one by one and manually lift the barrier. When friends or relatives come to visit, if their license plates haven’t been registered in advance, they have to call and wait at the gate for confirmation—causing delays and traffic congestion.
These “minor hassles” in community vehicle management can actually be easily solved with the HuskyLens2 AI camera. The community vehicle recognition system we developed works like a “A 24-hour intelligent gatekeeper that never slacks off” automatically recognizing license plates and verifying access permissions, making entry and exit much smoother.
This small project, inspired by community management, can also be flexibly adapted to other real-life scenarios. For example, in a company parking lot, employee license plates can be registered in the system to replace traditional access cards, solving the problem of “being unable to enter the parking lot after forgetting the card.” In small paid parking lots, the system records vehicle entry and exit times, automatically calculates parking fees, and controls vehicle release, helping enable unattended (automated) management.
1.2 Demo Video
2. Project Implementation Principle
Its core logic works as follows: first, the HuskyLens2 camera is used to “register” authorized resident license plates. By preloading resident license plate information into the device, the HuskyLens2 effectively maintains a “whitelist” for vehicle access.
When a vehicle approaches the entrance of the community, the HuskyLens2 camera captures the license plate in real time. The Arduino then processes and analyzes the recognition results returned by the HuskyLens2. If the detected plate belongs to a registered resident vehicle, the connected servo motor drives the barrier gate to open automatically. If the plate is unregistered or belongs to an unknown vehicle, the servo motor remains inactive and the gate stays closed.
3. Hardware and Software Preparation
3.1 Equipment List

Note: The Mind+ programming software version should be v2.0, and the HuskyLens version should be HuskyLens2.
3.2 Hardware Connection
Please follow the wiring diagram below to connect the computer, Arduino UNO, HuskyLens2, and the servo motor.

3.3 Software Preparation
Download the installation package for Mind+ v2.0 or later from the official website. After the installation is complete, double-click to launch the software.

4. Project Making
4.1 HuskyLens2 Operation
First, since the default factory language is English, you can swipe left or right on the touchscreen to find the “System Settings” icon and set the system language to your preferred option (supported languages include English, Simplified Chinese, and Traditional Chinese).

Tap “System Settings”, then scroll down to the bottom and find the “Language” option. Tap “Language” to enter the language settings interface.

Tap your preferred language option. The system will then switch languages and automatically return to the main menu page. The figure below shows an example of switching the system language to Simplified Chinese.

Next, select the communication mode of the HuskyLens2.
The HuskyLens2 supports two communication methods: UART (Serial) and I2C. In this tutorial, the I2C communication mode is used.
Tap System Settings → Protocol Type → I2C Communication Mode, then return to the main menu interface.

Finally, swipe the screen to find the “License Plate Recognition” function.

Point the HuskyLens2 toward a scene containing license plates. When a license plate is detected, the screen will display white bounding boxes around all detected plates and show the corresponding license plate information.

After completing the parameter configuration and mode selection on the HuskyLens2, follow the steps below to perform target entity data collection and incremental model training:
Aim the HuskyLens2 at the license plate to be learned, and adjust the angle so that the “+” symbol in the center of the screen is positioned inside the white bounding box. Then press the A button in the upper-right corner of the HuskyLens2 to learn the license plate.

After the learning process is completed, when a previously learned license plate is recognized, the screen will highlight the plate with a colored bounding box and display “name: ID number”, for example, “8ABC123: ID1”.
By default, the name corresponds to the license plate content, while “ID1” indicates that it is the first learned license plate.

Repeat the above steps to learn the license plates of all community residents. Once completed, the model preparation for the community vehicle management system is finished.
For more detailed instructions on using the HuskyLens2, please refer to the following website: https://wiki.dfrobot.com.cn/_SKU_SEN0638_Gravity_HUSKYLENS_2_AI_Camera_Vision_Sensor
After the model preparation is completed, you can begin writing the code to implement an automatic vehicle recognition system for a smart community management application.
4.2 Code Implementation
Open the Mind+ programming software and select “Upload Mode” under “Coding.”

First, we need to add the required extensions in Mind+, including Arduino UNO and HuskyLens2.
Open the “Extensions” page and search for “Arduino UNO.”

Click the “Download” button on the extension package and wait for the download to complete.

Click the extension package to complete the loading process.

Follow the same steps used for loading “Arduino UNO” to load the user library “HuskyLens 2 AI Camera.”

After the “Arduino UNO” and “HuskyLens2 AI Camera” libraries have been loaded, click the “Back” button to return to the programming interface.

Click “Connect” in the device connection panel.

The interface shown below indicates a successful connection. Click “×” to return.

After the extension libraries have been loaded, write the program as follows:

The core code is explained as follows:

The complete program file for this project is included in the appendix. Return to the home page and click “Open Project→ Open Local File”

Select the project file from the appendix and click “Open.”

Click “Upload to Device” to run the program.

Set the HuskyLens2 to “License Plate Recognition” mode.

The implementation result is shown below:

5.List of Attachment










