It consists of ldr which senses the light fron led fixed at the opposite side of the door.The seven segment display displays the no of interuptions in the led to ldr path.
For more information (e.g. ckt diagram etc.) you can also refer to my instructable. The link is given below⬇️⬇️
https://www.instructables.com/id/Door...
Don't forget to subscribe to my channel
#DChaurangi