How to make ultrasonic and light sensors detect whether a person moving in or out
See this tutorial on the Arduino Projecthub, that project was already made. Here is a tutorial how to use a Ultrasonic sensor.