The Smart Pet Door provides pets with the freedom to enter their home while ensuring security against unregistered animals. It utilizes a combination of BLE beacon technology and an infrared motion sensor to detect and authenticate a pet's approach and to automatically manage access.
To recreate this project, you should connect the hardware components as shown in the schematics, and follow the steps:
git clone https://github.com/UPB-FILS-MA/project-andrauritu.git
cd path/to/project/smart_pet_door/attempt4micro/embassy
cargo build --target thumbv6m-none-eabi
While connecting the Raspberyy Pi Pico W to the computer through a USB cable, hold the BOOTSEL button down.
Locate the binary in the target/thumbv6m-none-eabi/release/ folder and run:
elf2uf2-rs -d /path/to/your/binary
Note that there is no -s in the command, because we will connect the CP2102 USB to UART Bridge for serial communication.
In order to check if everything works as intended, there are several debug messages through the code sent through UART to the CP2102 module. If you choose not to use it, make sure to connect the HM-10 module to a 3.3V output. After the firmware has been flashed onto the pico, connect the bridge to your computer through USB and monitor the serial output through a terminal. If you choose to use PuTTy, ensure that the baud rate is set to 9600 and that you have used the appropriate port.
In case the output does not look ok in the PuTTy terminal, it might be because of a wrong baud rate for the HM-10. My HM-10 has the version 604, but in case yours comes updated to version 700 or newer, its default baud rate will be 115000. You will need to either change the code (config0 and config1) and set the baudrate variable to 115000, or change the HM-10's baudrate to 9600 by sending it the command AT+BAUD0.
To check the current version of your module, send the command AT+VERS?".
Although it does not affect the succesful running of the code, if you want to actually put this project to real-life use, you will need a beacon attached to your pet's collar. They are usually pricy, so the best alternative I could find in Romania was the IN100 NanoBeacon, which can be programmed through the InPlay application. Once you are satisfied with the configuration, you can burn it in and then use a CR1225 coin battery to power it while moving it freely, disconnected from the computer or breadboard.
| Device | Usage | Price |
|---|---|---|
| Raspberry Pi Pico WH | Acts as the central controller | 38.99 RON |
| HM-10 BLE Module | For scanning the NanoBeacon | 35.47 RON |
| IN100 NanoBeacon | Attached to the pet’s collar | 44 RON |
| Servomotor | Operates the door lock | 12.72 RON |
| PIR Sensor HC-SR501 | Detects motion at the door | 5.25 RON |