Face control for pets
- Transfer
- Tutorial
Computer scientists, happy day to you! Let not quite official. We recently conducted a survey in our Microsoft Developer community and found out that many of you have cats. Therefore, we decided today to tell you about the creation of the IoT-door for animals with recognition of the muzzle (+ tutorial).
Today we’ll talk about creating a door for cats in the door to the street. With it, home owners will be able to let their pets in and out automatically using motion sensors with object recognition.
In this project, the function of machine pattern recognition is used, which allows only your cat to enter the house. The door is activated by a motion sensor and opens only after recognition of your cat's face.
You may be interested in complementing the project with the following functions:
Saw off one end of each plate of the servo mechanism with a saw so that they are flush with the wall of the servo mechanism (see photo below). As a result, the door will open fully without bumping into these plates.
Then drill holes in the upper part of the door for the pet in which the LEDs and motion sensors will be placed. The holes should be slightly wider than the sensors.
Finally, print on the 3D printer two servo connectors and a housing, if you think it is necessary. The illustrations for this manual show the MinnowBoard enclosure.
Attach the connectors to the servomechanisms on the opposite side of the door to the door. Now servomechanisms will be able to control the opening and closing of the door.
This application has an additional user interface, where the video stream from the camera is displayed, as well as the most recent images created at the moment of the trigger of the motion sensor. It is also possible to work without a monitor. The door opens automatically when motion is detected in the room. If the movement is observed outside, then the images are transmitted from the webcam to the OpenCV image classifier and processed by it. The classifier transmits the vector recognized on the image of a cat's face. If it contains data, the door opens.
Useful advice.
The LEDs connected to each motion sensor light up every time a trigger is triggered with a supply of 5 volts.
The project is based on the Codex.Microsoft's open source behavior. For more information, check out our Frequently Asked Questions about a code of conduct or write to opencode@microsoft.com if you have any further questions or comments.
It is necessary to print two connectors on a 3D printer and attach them to the servomechanisms on the opposite side of the door to the door. As a result, servomechanisms will be able to control the opening and closing of the door.
This enclosure can be used to secure the MinnowBoard to the door. CAD
file at thingiverse.com.
Project Information
Today we’ll talk about creating a door for cats in the door to the street. With it, home owners will be able to let their pets in and out automatically using motion sensors with object recognition.
Components Used in the Project
Hardware
- 3 Raspberry Pi Model Bed and .
We use the Raspberry Pi, but MinnowBoard is also suitable. In this case, change “ARM” in the instructions below to “x86”. - Microsoft LifeCam 3000.
Any USB camera is suitable. - PIR motion sensor (universal) - two pieces.
- Servo Plate A - two pieces.
- HS-485HB Servo - two pieces.
- LED (universal) - two pieces.
- Door for the pet.
- Adafruit PWM, 16 channels, 12 bits / Servo Driver - I2C interface - PCA9685.
Used to control PWM servomechanisms via the I2C interface.
Software Applications and Online Services
- Microsoft Windows 10 IoT Core
- Opencv
- Microsoft Visual Studio 2017
Tools and devices
- 3D printer (universal)
- Saw (universal)
- Drill (universal)
Project
In this project, the function of machine pattern recognition is used, which allows only your cat to enter the house. The door is activated by a motion sensor and opens only after recognition of your cat's face.
You may be interested in complementing the project with the following functions:
- user interface for viewing photos of animals that tried to enter the house;
- a panel that displays information about how often your pet leaves the house and comes back;
- the possibility of additional training of the classifier based on the images of your cat;
- a system for sending messages with photos of animals that were denied access to the house, with the ability to manually change the classifier's decision.
Initial setup
- Set up your Raspberry Pi or MinnowBoard on your computer by following these instructions.
- Connect the USB camera, keyboard and mouse to the device.
- Connect the PIR motion sensors, servomechanisms and LEDs according to the diagram below. Servo mechanisms are used to open and close the door.
- Turn on the computer and activate the Lightning connector by following these instructions.
Hardware Setup
Saw off one end of each plate of the servo mechanism with a saw so that they are flush with the wall of the servo mechanism (see photo below). As a result, the door will open fully without bumping into these plates.
Then drill holes in the upper part of the door for the pet in which the LEDs and motion sensors will be placed. The holes should be slightly wider than the sensors.
Finally, print on the 3D printer two servo connectors and a housing, if you think it is necessary. The illustrations for this manual show the MinnowBoard enclosure.
Attach the connectors to the servomechanisms on the opposite side of the door to the door. Now servomechanisms will be able to control the opening and closing of the door.
Software setup
- Use the command line to go to the folder where the project will be located:
cd <путь к папке>
- Run the git clone command to load the project:
git clone https://github.com/ms-iot/PetDoor.git
- Open the PetDoor.sln file from the folder you just downloaded using Visual Studio 2017.
- Download the OpenCV library, compile it, and add the binaries to the project by following these instructions.
- From the top menu of Visual Studio, select Debug and ARM (for Raspberry PI) or Debug and x86 (for MinnowBoard).
- Click the Remote Machine button. In the Remote Connections dialog box, specify the IP address of the remote computer. The IP address is displayed on the IoT panel, which can be downloaded here .
Work with software
This application has an additional user interface, where the video stream from the camera is displayed, as well as the most recent images created at the moment of the trigger of the motion sensor. It is also possible to work without a monitor. The door opens automatically when motion is detected in the room. If the movement is observed outside, then the images are transmitted from the webcam to the OpenCV image classifier and processed by it. The classifier transmits the vector recognized on the image of a cat's face. If it contains data, the door opens.
Useful advice.
The LEDs connected to each motion sensor light up every time a trigger is triggered with a supply of 5 volts.
The project is based on the Codex.Microsoft's open source behavior. For more information, check out our Frequently Asked Questions about a code of conduct or write to opencode@microsoft.com if you have any further questions or comments.
Custom Parts
Servo Connector
It is necessary to print two connectors on a 3D printer and attach them to the servomechanisms on the opposite side of the door to the door. As a result, servomechanisms will be able to control the opening and closing of the door.
MinnowBoard Max Enclosure
This enclosure can be used to secure the MinnowBoard to the door. CAD
file at thingiverse.com.
Only registered users can participate in the survey. Please come in.
What holiday is it today?
- 26.5% Valentine's Day 17
- 15.6% Geek Day 10
- 57.8% Today is a normal day 37