It’s been a while since I dug into the guts of the SP511E’s, but as I recall there’s some other electronics between the IR sensor and GPIO5 (I could be wrong).
If you haven’t found it, there’s a few threads on modding the SP511E’s. Some others as well.
FWIW I have a dozen or so of those devices in various projects as they’re cheap and pretty versatile for small projects, but you can’t beat an ESP32 for the “real deal” MCU.