An Arduino and PIR motion sensor-based automatic multiple light control system. Room light on, table lamp off. Room light off, table lamp on. Perfect device for study. Control things by just waving at them!
I've built a PIR motion sensor based automated light / appliances project which can be found here. This project is a bigger version with relay to control 220V lights.Features
- Table lamp ON main light OFF
- Table lamp OFF main light ON
- Arduino Pro Mini (or any board)
- 2-channel relay module
- PIR motion sensor
- 220V to 5V converter
- Hot glue
I've built a PIR motion sensor based automated light / appliances project which can be found here. This project is a bigger version with relay to control 220V lights.
Just added the lights switch wires to relays and powered the Arduino and relay module using a 220 to 5V converter - for that I've used a mobile charger which gives 5V in output.
Then I put the entire circuit into a plastic box. Note that I've made some tiny holes on the lid because the relay's get warm and it is needed to get some air.
Make sure to secure all the exposed wires and to cover them with glue gun for extra security.Code
Uploading code to Arduino Pro Mini (5V 16 mHz)
The Arduino Pro Mini doesn't have USB programming option. So you may Upload code using a USB to TTL converter. Or you may use an Arduino Uno. We all have an uno right?
So let's upload code using an Arduino Uno.
- Remove The ATmega IC from Uno (using a screwdriver, but be careful not to harm the IC)
- Connect Arduino Pro Mini ------ Uno as following
- Tx to Tx
- Rx to Rx
- Vcc to 5V
- Gnd to Gnd
- Rst to Reset
Then start arduino.ide and go to tools>board> select Arduino Pro or Pro Mini
Note: You can just upload code to Arduino Pro (5V 16 mHz) mini using Uno not the 3.3v one. Check before you buy one.
Download the code from the GitHub link and upload to Arduino. That's it.
Then power it up and enjoy. Thank you.
If you find difficulties working with PIR sensors, then click here for my PIR solution post.