Have you ever noticed that when you entered 7E there is a ding dong sound? Or when you enter a toilet, then suddenly the lamp turned on by itself? It’s actually using a Passive Infra-red (PIR) Motion Sensor. A sensor where it detects any heat that occurred to trigger the sensor. Let’s scroll down to get more info.
This is the sample code used for this tutorial. Try it!