Baby Monitor Car 尋人監控車

Overview

The baby monitor car is a concept born out of necessity. Currently, the baby monitors available on the market can only be quietly placed in a specific corner, watching over the baby. This suffices when the baby is not yet crawling around, but once the baby starts to crawl, traditional baby monitors become ineffective. Hence, the idea of an autonomous, baby-following monitor was conceived.

It's a miraculous device that can monitor a crawling or moving baby, allowing moms to focus on watching dramas and dads to concentrate on gaming and treasure hunting.

The features

  • Able to recognize the baby and move along with it.
  • The camera lens should be directed at the baby.
  • When the baby notices the monitor, it should be able to avoid the baby and maintain a certain distance to prevent being grabbed.
  • The monitor can be connected to a smartphone, allowing direct viewing of the baby being monitored.
  • The movement of the vehicle and the direction of the camera can be controlled directly from the smartphone.

Required Components

Software

  • OS: Raspbian bullseye 64
  • Python 3.9.2
  • OpenCV 4.8.0-dev

Hardware

  • L298N X 1
  • SG 90 X 1
  • Gearmotor X 2
  • HC-SR04 X 1
  • Respberry Pi 4B X 1
  • Pi Camera X 1
  • Resistence X 1
  • Car wheel X 2
  • Car chassis X 1
  • Hexagonal copper pillar X 8
  • Battery case X 1
  • Small breadboard X 1
  • Tile board X 1

Crafting

  • Install SG90 and gearmotor on the car chassis. chassis.png
  • Install hexagonal copper pillar on the car chassis. chassis1.png
  • Install L298N on the car chassis. L298N-chassis.png
  • Install HC-SR01 on the car chassis HC-SR01-chassis.png
  • Install Raspberry Pi on the hexagonal copper pillar and set up the battery case under Pi 22b224e9829f9cb63c988503917b1b17.png
  • Set up the small breadboard above the Raspberry pi df12bb87f897d7ea831faf6201cc8b3a.png
  • Set up the Pi Camera in front of the car chassis 9791fdab8199be1e401db08f124cd86f.png
  • Instal 4 hexagonal copper pillar under the PI and fixed tile board, then fixed the mobile power bank under the tile board. Completed_photo

The photos of the completed assembly are as bellow: Completed_01 Completed_02

The circuit diagram as bellow: wire-chart.jpg

Cautions

  • HC-SR04:
    • This sensor sometimes gets extreme values, ex: more than 2 meters. You must filter out the extreme values, or your car will get disaster.
  • L298N & motor: This project controls the wheel speed by calculating how many cm per second of the car. Then calculate the time of motor running we need.
  • Since we need to slow the motor, we need to take off the jumpper from the L298N ENA and ENB. And connect the PWM pinout to ENA and ENB.

Environment prepare

Enable Camera

  • Config the raspberry Run bellow command to enable camera sudo raspi-config

Choice 3 Interface Options raspi-config menu

Choice I1 Legacy Camera Enalbe/disable legacy camera support Camera-option

Choice Yes to enable Camera Camera-enable

Press Esc to exit the config menu

Install opencv

  1. Update the package sudo apt update && sudo apt upgrade -y
  2. Install CMack 3.14.4
cd ~/
wget https://github.com/Kitware/CMake/releases/download/v3.14.4/cmake-3.14.4.tar.gz
tar xvzf cmake-3.14.4.tar.gz
cd ~/cmake-3.14.4
./bootstrap
make -j4
  1. Install OpenCV
cd ~/
sudo apt install git libgtk2.0-dev pkg-config libavcodec-dev libavformat-dev libswscale-dev libatlas-base-dev python3-scipy
git clone --depth 1 --branch 4.5.2-openvino https://github.com/opencv/opencv.git
cd opencv && mkdir build && cd build
cmake –DCMAKE_BUILD_TYPE=Release –DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j4

Run Service

  • Clone the source code from raspberry pi git clone https://github.com/gitmich/monitor-cart
  • Install python package pip install -r requirments.txt
  • Execute the server program
cd monitor-cart/web-control
python web-control.py

UI Description

UI

The upper part is the Pi Camera Live Stream. Users can watch the camera's view in this window. The lower part consists of functional buttons. The Up, Down, Left, and Right buttons control the direction of the cart's movement. The central button enables the Tracking Mode. When Tracking Mode is enabled, the monitoring car will track people.

Demo Video

TT2.mp4

Reference data