This is a simple, home-made door alarm based on ultrasound sensor distance measurements
The peripheral device is powered by a Raspberry Pi Pico W, with the following diagram