1. Background
The BW21-CBV-Kit launched by Ai-Thinker is an open-source hardware development platform for intelligent sensing applications. Its core features include:
- AI Vision Capabilities:
Supports on-device AI image recognition algorithms, enabling scenarios such as face recognition, gesture detection, and object identification, with HD image capture via a 2MP camera.
- Processing Performance:
Equipped with dual-band Wi-Fi (2.4GHz + 5GHz) and a high-performance RTL8735B processor (500MHz), meeting real-time image processing and wireless transmission requirements.
- Open-source Ecosystem:
Built on the Arduino development environment, providing rich interfaces such as PWM control and sensor drivers, enabling users to develop custom network camera systems.
Compared with traditional closed-source smart cameras, the BW21-CBV-Kit provides unique advantages:
- Freedom from System Restrictions:
Developers can bypass vendor constraints to create local storage or private cloud solutions, avoiding cloud data leakage risks.
- Extended Scenario Integration:
Supports peripherals such as DHT temperature/humidity sensors and ultrasonic ranging modules, allowing smart home security, environmental monitoring, and other multi-functional applications.
- Development Efficiency:
Provides HomeAssistant integration and pre-built AI model calls, significantly lowering the development barrier for home-grade smart cameras.
This device has strong potential applications in smart homes, industrial visual inspection, and new retail behavior analysis. Its open-source nature is particularly suitable for maker communities and SMEs seeking customized visual solutions.
Many manufacturers currently offer smart cameras, but they are closed-source and tied to specific software and cloud services. The XiaoAnPai camera can be used to build a network camera with a custom software system for home use.
2. Objectives
The web interface should be as user-friendly as possible, with the ability to select video files by date.
The core goal of this project is to develop an intelligent home security monitoring system based on the Xiao An Pai hardware platform, focusing on three key functional modules:
1. 24/7 audio and video acquisition system
- Enables 24/7 uninterrupted video recording, using H.264 encoding technology to ensure 1080P HD quality;
- Integrates facial recognition algorithms for intelligent monitoring of suspicious targets;
2. Tiered storage architecture
- Builds a centralized storage mechanism: NAS subscribes to RTSP audio and video streams and writes them to disk.
3. Cloud-based interactive system
- Builds a streaming media service platform based on a B/S architecture, supporting m3u8 video playback.
Develops a video retrieval module for daily surveillance video retrieval.
The overall system design adheres to a collaborative "end-edge-cloud" architecture, ultimately creating a complete home security solution while ensuring data security.
3. Design Approach
3.1 Hardware Design
Development Board: BW21-CBV-Kit connected to a GC2053 camera.
Camera Enclosure: DIY casing made using the packaging box and manual assembly.
3.2 Software Design
3.2.1 Microcontroller
On the microcontroller side, RTSP video streams are output while marking faces in the video.
#include "WiFi.h"
#include "StreamIO.h"
#include "VideoStream.h"
#include "RTSP.h"
#include "NNFaceDetection.h"
#include "VideoStreamOverlay.h"
#define CHANNEL 0
#define CHANNELNN 3
// Lower resolution for NN processing
#define NNWIDTH 576
#define NNHEIGHT 320
VideoSetting config(VIDEO_FHD, 30, VIDEO_H264, 0);
VideoSetting configNN(NNWIDTH, NNHEIGHT, 10, VIDEO_RGB, 0);
NNFaceDetection facedet;
RTSP rtsp;
StreamIO videoStreamer(1, 1);
StreamIO videoStreamerNN(1, 1);
char ssid[] = "Network_SSID"; // your network SSID (name)
char pass[] = "Password"; // your...
Read more »
Ai-Thinker
likeablob
Nick Bild