Motion Detection Lights
i wanted to make cheap motion sensor lights that work from a standard 220V socket. This is the best that I could achieve, for now)
What Will You Need
1. A thin wooden board.you can also use any plastic as long as it's minimum conductive material
2. Double sided adhesive tape to fixate your build on the board
3. A tuperware of symmetrical proportion to the wooden board. I just used what I have lying around. You can always use whatever you like
4. FR4 fiber board pcb which you'll have to saw into the size that suits you, separate it into two areas by grinding away a line in the middle and then solder tin onto its surface
5. 12V 5V fully isolated switching power supply AC-DC module 220V to 12&5 V. Please be careful when handling 220V. You have to solder a plug with 2 wire cord to that module (plugs differs from one country to another)
6. Breadboard, jumper wires, PIR sensor and arduino nano
7. 3 LED rigid (flexible) strip lights
8. Electrical wires ( I used the wires that came with the LED lights)
Connection
First you solder the plug cord to the AC-DC module. With a voltmeter make sure the positive and ground are detected on the module and then soldered onto the already divided and covered with tin FR4 fiber boards. Once you have all the voltages assigned, you start soldering the modules accordingly. The arduino nano (power through VIN and GND), the relay and PIR sensor are all powered from the 5 V source transmitted into the breadboard whereas the LED are soldered onto the 12 V source with the positive coming from the relay (see diagram)
The Code Can Be Downloaded From Arduino.cc. You Just Have to Modify the Pin Numbers
http://playground.arduino.cc/Code/PIRsense
Fully Connected to 220V
after you have everything wired up and soldered. You make a cutout from the tuperware and screw into the piece of wood that you have your project attached to by double sided adhesive tapes and with plastic bolts and nuts for the modules after drilling holes accordingly. You also have to make small cutouts for the wires of the LED and PIR sensor on the side. After doing so, you can put back the lockable lid of the tuperware and you're ready to go
Installed in the Bathroom
luckily I have an installed power outlet in the ceiling which made connecting it really easy by just plugging in the plug. Then I passed the wires through the ceiling tiles and just fixated the lights according to my desire. You can also drill holes into the tiles but I'm renting :p
Hope you make it. Really easy and cheap. You can also use an attiny 85 for such a project instead of arduino nano.
Version 2.0
I removed the arduino, connected the pir sensor signal to that of the 5 V relay. Fixated the main wire with zip straps and covered the soldered 220v wires with plasti dip. I was able to significantly reduce the size of the project. Too bad I don't have a 3D printer,yet;)