I have my lenovo laptop. It has built in camera?

Does anyone know how i can use it as security device? I want it to take pictures for whoever opens and closes my laptop. Just for security purposes

Search Google for that software.
Here is one: https://www.ispyconnect.com/features.aspx

Yes that's very simple and free download yawcam open it and set it for motion detection and turn off the click sound!

Minimize it and when someone opens your laptop video or still photos!

Its great as a tool to find out what really happens when your not home! Set up the laptop were it captures the room turn sensitivity way up and push the button that turns off the screen!