I had a number of old smartphones that are still working and reuse them as security cameras. You can 'wake up' the camera with sound and motion!
Below is a link to start. There are others so Google away!
https://www.cnet.com/how-to/for-a-fr...our-old-phone/