My sister constantly complains about her electricity bills because she lives alone, and if she forgets to turn her lights off, then they are wasting energy all day while she is at work. I thought it would be interesting to come up with an IOT device for her because she doesn't have any IOT appliances already in her house. I thought coming up with a solution that isn’t obtrusive and doesn’t require other IOT infrastructure would be an interesting design problem.
This device will be able to attach onto existing light switches
and turn off the lights if there is no motion is detected in a room after a set
amount of time. I wanted the device to not hinder regular use of the light switch, so it only is able to flick the light switch off.
For this project I started by individually testing the servo motor and the PIR sensor by starting with code from the DIoT Labs and Guides. From there, I modified the code to work for the range of servo motion I needed, which was limited. For the PIR sensor, I set up the code to publish an event when motion is detected, but also to keep track of when there are long periods of no motion. Lastly I wired an LED to blink 3 times after the long no motion period as a warning. The servo then is activated and rotates to hit the light switch.
While the finished project is a functional prototype, it is still incomplete. The appliance is missing all mounting hardware, which could easily be made by laser cutting or 3D printing a mount that uses existing screw holes from a light switch.
The servo lacks the torque to directly flip the light switch, which might be solved by mounting the servo, but could alternately be solved by attaching a larger lever arm to the servo horn.
Additionally, additional sensors such as a photoresistor could be added so that the PIR sensor doesn't have to look for motion when the lights are already off.
This project helped familiarize myself with reading data and debugging code on the Particle. I had no prior experience with getting feedback for debugging, and I'm used to simply adding a bunch of print statements to my code. Through coding and testing my appliance, I got more experience publishing events and variables to monitor through the cloud. I also got to familiarize myself with electrical components like sensors and servos, which I have worked with before but not recently. I am a little disappointed that I ran out of time to properly mount the servo to see if it could switch the lights off.