December 1, 2020

In one of my previous projects, I made a smart desk lamp that could be turned on and off using google assistant. But since I am lazy, I would rather my light turn on by itself when I walk into my room. So, I bought a passive infrared (PIR) sensor. These sensors are able to detect movement, and are often used in buildings to turn on lights once someone walks in. I connected this PIR sensor to my raspberry pi, which was also connected to 5v relay to control my light. Now, my raspberry pi was the "brains" that could toggle my light depending on if there is movement in my room. After writing a python program that would run on the raspberry pi, my light could turn on the moment I walked into my room and turn off once 10 minutes passed without movement. Since the raspberry pi is also connected to the internet, I made it so I could toggle my light manually from my phone.