A simple project using a PIR sensor, an Arduino UNO and an LED bulb. I built to fix on my roof so that it will normally stay off, but when there is a person, the light will switch on. When it senses no movement, i.e., no people, it will automatically turn off again.
It was nice until it lasted. One day there was a thunderstorm and the entire circuit got wet. I attached it pretty safely taking rain into account… But clearly not well enough.