Most motion sensors detect the change in infrared radiation or the change in heat when a person or object moves in their field of view.
I currently use 3 Aeotec Motion sensors in my setup since they are doing what I need to trigger my motion light automation.
If you need more precise detection then you look into MMwave based sensors that can also do per zone tracking like the ones from Aqara with thier FP2/E line or the Apollo MSR-2.
My Aeotec sensors are connected to my home assistant instance via ZHA through the skyconnect usb coordinator.
If I understand your question correctly you want to use the gpio of your HA host for motion detection. This is a project I found but I couldnt get to work myself some time ago for another use case, but maybe you get it working: GitHub - thecode/ha-rpi_gpio: Home Assistant Raspberry Pi GPIO Integration
Another raspberry solution is this: Raspberry Pi Remote GPIO - Home Assistant
Or you can use a raspberry pico with home assistant through ESP Home or a normal ESP if you dont need raspberry.
For the motion hardware the HC-SR501 PIR Sensor is probably the cheapest.