The master uses Raspberry Pi as a control device.
Tools and materials: -Raspberry pi; -Resistors; -Breadboard; -Wires;
– Transistor BC337;
-Potentiometer; -Photoresistor; -DS18B20 temperature sensor; -Rain sensor; -RFID reader RC522 – 2 pcs; -MCP3008 microcircuit; -PCF8574 microcircuit;
– LCD display;
-Carpentry glue; -Glue gun; -Cable ties; -Seed paper; -Drill; -Screwdriver;
-Soldering iron; -Folding door for cats;
Step one: setting up the Pi
The first step in this process is preparing the pi.
First you need to download the image and the software to burn it.
The image can be downloaded here: www.raspberrypi.org
The software is here: sourceforge.net
Next, you need to write the image to the SD card. After recording, you need to configure.
Go to the SD-card, find a file named “cmdline.txt” and open it.
At the end of the line, add “ip = 192.168.168.168” and save this file.
Create in the same place an empty file with no extension named “ssh”.
Now you need to install the SD card in the Raspberry Pi and connect using putty via “192.168.168.168/22”.
Putty link: latest.html
Default: User: pi, Password: raspberry.
To get root rights, write:
sudo -i wpa_passphrase & # 34; ssid & # 34; & # 34; password & # 34; & gt; & gt; /etc/wpa_supplicant/wpa_supplicant.conf
Configuring a wireless network card:
wpa_cli -i wlan0 reconfigure
For updates when connected to Wi-Fi:
sudo apt-get update sudo apt-get upgrade
sudo apt-get install mariadb-server
Apache2 Web Server:
sudo apt install apache2
pip3 install flask-cors pip3 install flask-socketio pip3 install mysql-connector-python pip3 install gevent pip3 install gevent-websocket
RFID library rc522:
sudo pip3 install spidev sudo pip3 install mfrc522
Reboot at the end:
Step two: schematic diagram
The device is mounted according to the diagram.
Step Three: Database
You will need mysql software to install the database.
Now you need to install the Smart Hatch database.
Step four: door
The hatch itself can be purchased or made yourself. The master uses a purchased door made of acrylic, and makes the spoil from wood.
< img class = "aligncenter" alt = "Door for a cat, with outdoor temperature control and magnetic lock" src = "https://usamodelkina.ru/uploads/posts/2021-08/1628922540_1-4.jpg"/> The dimensions of the hatch are 30 mm x 30 mm x 10 mm and it is made entirely of wood.
Step five: interface
The interface is simple and has four tabs: “Manual”, “Cats”, “Weather” and “Statistics”. You can download it here, or develop your own.
Step six: setting SPI and I2C
Before than to use MCP3008, RFID and LCD, you need to enable SPI and I2C bus.
To enable SPI:
sudo raspi-config 5.Interfacing Options SPI
sudo raspi-config 5 .Interfacing Options I2C
Enable SPI 1:
sudo nano /boot/config.txt & # 34; dtoverlay = spi1-3cs & # 34;
Step Seven: Code
Now you need to do it, load the code. You can download it here.
And finally, we cut the hatch into the front door and connect the power to the Raspberry Pi. You need to hang a programmed RFID tag on the cat or cat. When the animal approaches the door, the tag will be read and, depending on the scenario, the door will open or remain closed.