Raspberry Pi Camera Detector is a Python script with which you can use a Raspberry Pi and a CSI camera for it as a motion detector.
Warnings:
Make sure you are using Raspberry Pi OS Legacy (based on Buster) or older. It is possible to work on Raspberry Pi OS Bullseye when using the Legacy version of the Pycamera driver. There may be problems with other distributions.
Requirements:
Raspberry Pi 2B and newer
Any CSI-compatible camera
Setup:
In the Raspberry Pi Configuration Tool, enable the camera operation: