📜 ⬆️ ⬇️

Face control for pets

Computer scientists, happy you! Let not quite official. We recently surveyed our Microsoft Developer community and found out that many of you have cats. Therefore, we decided to tell you today about creating an IoT door for animals with face recognition (+ tutorial).



Project Information


Today we will talk about creating a door for cats at the door to the street. With it, home owners will be able to let in and release their pets automatically using motion sensors with object recognition function.
')


Components used in the project


Hardware



Software applications and online services



Tools and devices



Project


This project involved the function of machine image recognition, allowing only your cat to enter the house. The door is activated by a motion sensor and opens only after recognition of the muzzle of your cat.

You may be interested to supplement the project with the following functions:


Initial setup


  1. Set up Raspberry Pi or MinnowBoard on your computer by following this guide.
  2. Connect the USB camera, keyboard and mouse to the device.
  3. Connect PIR motion sensors, servomechanisms and LEDs according to the diagram below. Servomechanisms are used to open and close the door.
  4. Turn on the computer and activate the Lightning connector by following these instructions.



Equipment setup


Saw one end of each servo plate with a saw so that they are flush with the servo wall (see photo below). As a result, the door will open completely without hitting the plates.



Then drill holes in the upper part of the pet door for the LEDs and motion sensors to be placed. The holes should be slightly wider than the sensors.



Finally, print out the two servo connectors and the housing on the 3D printer, if you see fit. The illustrations for this manual show the MinnowBoard package.

Attach the connectors to the servos on the opposite side of the door stops. Now servomechanisms will be able to control the opening and closing of the door.



Software setup


  1. Use the command line to go to the folder where the project will be located:

    cd < >
  2. Run the git clone command to load the project:

    git clone https://github.com/ms-iot/PetDoor.git
  3. Open the PetDoor.sln file from the folder you just downloaded using Visual Studio 2017.
  4. Download the OpenCV library, compile it and add the binaries to the project, following these instructions.
  5. In the top Visual Studio menu, choose Debug and ARM (for Raspberry PI) or Debug and x86 (for MinnowBoard).
  6. 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, which displays a video stream from the camera, as well as the most recent images created at the time 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, the images are transferred from the webcam to the OpenCV image classifier and processed by it. The classifier transmits the vector recognized in the image of a cat's muzzle. If it contains data, the door opens.

Helpful advice.
The LEDs connected to each motion sensor light up each time a trigger is activated with a supply of 5 volts.

The project is based on the Microsoft Code of Conduct for open source products. For more information, read the Frequently Asked Questions about the code of conduct or write to opencode@microsoft.com if you have additional 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 stops. As a result, the servos can control the opening and closing of the door.

MinnowBoard Max


This enclosure can be used to attach a MinnowBoard to a door.

CAD file on thingiverse.com.

Source: https://habr.com/ru/post/346950/


All Articles