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.
- 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.
- OS: Raspbian bullseye 64
- Python 3.9.2
- OpenCV 4.8.0-dev
- 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
- Install SG90 and gearmotor on the car chassis.
- Install hexagonal copper pillar on the car chassis.
- Install L298N on the car chassis.
- Install HC-SR01 on the car chassis
- Install Raspberry Pi on the hexagonal copper pillar and set up the battery case under Pi
- Set up the small breadboard above the Raspberry pi
- Set up the Pi Camera in front of the car chassis
- Instal 4 hexagonal copper pillar under the PI and fixed tile board, then fixed the mobile power bank under the tile board.
The photos of the completed assembly are as bellow:
The circuit diagram as bellow:
- 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.
- Config the raspberry
Run bellow command to enable camera
sudo raspi-config
Choice I1 Legacy Camera Enalbe/disable legacy camera support
Press Esc to exit the config menu
- Update the package
sudo apt update && sudo apt upgrade -y
- 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
- 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
- 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
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.
TT2.mp4
- Install OpenCV - https://hackmd.io/HV6hQ2PHSiWlrRsfxC10SA#Install-OpenCV
- Install OpenCV on Raspberry Pi - https://qengineering.eu/install-opencv-on-raspberry-pi.html
- Install OpenCV on your Raspberry Pi - https://raspberrypi-guide.github.io/programming/install-opencv#install-opencv-on-your-raspberry-pi
- OpenCV实践之路——行人检测 - https://blog.csdn.net/wc781708249/article/details/78589002