I have this habit of never turning off lights in my bathroom when I get out, it stays on for the entire night and in the morning I get an earful from my Mom or my flatmates depending on where I am. After acknowledging that I will never be breaking this habit, I did what was an obvious choice , I built a motion sensor switch. It automatically turns off light in the bathroom if no one is inside and turns on when somebody enters it. Trust me, this was much more useful than I thought it would be. So here is a guide on how to make one if you are like me.
A list of things you need to get started:
Disclosure: These are affiliate links, I get a small commission for qualifying purchases.

Got them? Lets begin the build. Refer to the connection diagram below to wire up the components.


Test the circuit to see if it detects motion by swiping your hand across the PIR motion sensor. Use the timing and sensitivity dials( left and right respectively in the image below) to set it to the required time and range. Timing dial controls the on time of the sensor for each detection, it can be from 3s to 5min. You can set the sensitivity to adjust the range of detection from 3m to 7m.

Download STL files from here and print them to get your enclosure. Don’t have a 3D printer yet? Don’t worry, a simple plastic box would do.
Install it in your bathroom (or wherever) by referring to the circuit diagram given above.
Done and done! Simple, wasn’t it? Enjoy the surprise on your guest’s face when they enter your bathroom ;p !
Follow this excellent tutorial if you want to learn more about PIR motion sensors.
Thank you for reading, hope you enjoyed it, see you in the next post!