Introduction: Motion Detection Lights

Picture of 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)

Step 1: What Will You Need

Picture of What Will You Need

1. A thin wooden 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)

Step 2: Connection

Picture of 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)

Step 3: The Code Can Be Downloaded From You Just Have to Modify the Pin Numbers

Step 4: 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

Step 5: 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.

Step 6: Version 2.0

Picture of 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;)

Step 7:


NikhilK16 (author)2016-11-02

Is it switch off when we left room

souhadl (author)NikhilK162016-11-02

Of course. that's what they are intended for

NikhilK16 (author)2016-11-02

Is it switch when we left

JodyF1 (author)2016-10-25

You know, it's quite funny.... this literally gave me nightmares last night. Someone was chasing me with the IR detector coming from this device, I was running for my life so not to get electrocuted. And I think it was @SauHadl :-p

JohnC430 (author)JodyF12016-10-25

check ebay and understand what a PIR detector is. too bad about your nightmares

JodyF1 (author)JohnC4302016-10-25

Just wait till a stray wire pulls the PIR sensor up to 230v, then you'll want to stay away from it, I promise

ZeeshanZulfiqar (author)JodyF12016-10-26

by the way what will happen if it reach up to 230v?

souhadl (author)ZeeshanZulfiqar2016-10-26

The manufacturer claims that the ac-dc module can handle

AC85 ~ 265V wide voltage input.

ZeeshanZulfiqar (author)souhadl2016-10-27

so what is jodyf1 talking about pir sensor reaching 230 volts..??

JohnC430 (author)ZeeshanZulfiqar2016-10-29

he means that if there is a short from 230V to the pir sensor. the power supply is a commercial product with Isolation and beyond that there is only low voltage so I don't see how that can happen.

souhadl (author)JohnC4302016-10-30

Exactly and it also has temperature protection, overcurrent protection and short circuit full protection. Nonetheless, i agree with the emphasis on safety, especially that this website is accessible to kids

souhadl (author)JodyF12016-10-25

Too bad about those nightmares but I assure you I'm no freddy kruger. While studying for 13 years to become a surgeon and acquire my Ph.D in medicine, I didn't have time to study for 2 years to become an electrician and limited my knowledge to YouTube videos and literature so please excuse my unprofessional circuit.

JohnC430 (author)2016-10-25

oh by the way now taking JodyF's "advice". I think it is time for you to go back to college and get your engineering degree. I am an electrical engineer and also am a certified electrician and have designed and built dozens of high power and high voltage electrical and power electronics projects. I understand what he is talking about. he is right about safety, however since the project is already in a safe place and out of reach, there is no need to off the deep end.

souhadl (author)JohnC4302016-10-25

I totally agree that safety is mandatory. Thank you for your advice on going back to college but i'll stick to treating humans for now.

JohnC430 (author)souhadl2016-10-29

i was obviously just kidding about going back to school.

JodyF1 (author)souhadl2016-10-25

I must commend you on your openness about the whole thing. What I worry about is people who ignore advice, believing they know everything. And the last thing this site needs is people making kids think something is safe by saying it's safe even when professionals are saying it's not. I know this isn't a kids' project, but plenty of teenagers give these things a shot, and having just one or two adults saying it's safe is enough to make them think it'll be fine. Kids don't know the difference between good and bad advice.

souhadl (author)JodyF12016-10-25

On the contrary. I put this project up in order to get criticized by people who understand this topic and such circuits. I really appreciate everybody's feedback and do not recommend children to do it without a knowledgable adult's presence or guidance.

W0JT (author)2016-10-28

I plan to do something similar to light up the area by door between my garage and the mud room, but plan to have mine more elaborate, with two zones of lighting ((arage and mud room), ambient light sensors to inhibit turning on lights if its already bright, and more than I can fit in the allowed comment space. I'll have to write my own instructible once I get my project beyond the thought stage. I plan to use a totally enclosed 120vac to 12vdc power supply that simply plugs into a wall outlet, so I don't have to deal with lethal voltages. You ALMOST took this approach by dropping the line voltage to 12vdc and 5vdc, but unfortunately you had to bring the 220vac into the project box to attach to the power supply. It would have been safer if the supply had a standard socket into which you could plug in a standard AC power cable. By the way, to the many posters who suggested a wall wart power supply, I doubt that most such devices could provide enough amps to light the LED's. My planned project will use up to ten 3 watt LED devices, so my PS will be 12v @ 5amps or 60 watts capable. ANyway, thanks for sharing your project and thanks to the posters who had helpful comments.

oldmanbreadboard (author)2016-10-26

Lots of comments about the dangers of line voltage and they should never be ignored. The safest way to "play and learn" is to get a wall wart step down transformer that isolates the line voltage from the user. Duh, a battery is actually the safest way, so we can all speak too fast. The major point to take from all these comments is DO NOT MESS WITH LINE VOLTAGE. You will be exposing yourself to all the voltage and current supplied to your house, at least the branch circuit you are plugged into, and that will kill you in a heartbeat by stopping your heartbeat, and frying you. I lost a neighbor who was fixing his own well pump and accidentally touched a 220 volt main, he died instantly. Electronics is a great hobby, but please be safe. When I was in training to be an Air Conditioning mechanic, I was taught to keep one hand in my pocket, if the unit was powered up. That way the current would not have a path through your arms (and through your heart). It really is that dangerous. Nuff said, I will go back to sleep.

JodyF1 (author)2016-10-25

Incredibly dangerous and totally over the top. If anything went wrong and someone got hurt you'd end up in prison. If you know what's good for you, you'll scrap your circuits and take down this page. Get a qualification as an electrician as a minimum before you attempt this.

horus_m (author)JodyF12016-10-25

i dont see any contribution from JodyF1. what is the intention of his comment. only negativeness??

ZeeshanZulfiqar (author)horus_m2016-10-26

yes!! jodyf1 only mentions his negative points. please do appreciate ones effort and JUST suggest the blanks one has left.. every one know in which project you had to play with. even i made a project that could be used for severe spy purposes. after all, authors share their ideas. authors should mention precautions but again the person copying would be responsible not the author if he uses it in wrong way or do any illegal act. many projects include lasers which can prove to do a lot damage if directed towards eyes but children use it to play... it does not goes on the inventor if anyone is hurt by even the laser..

souhadl (author)JodyF12016-10-25

Thank you for the negative feedback. Suspecting that you are an electrician, what are your suggestions?

johanmoberg (author)souhadl2016-10-25

Perhaps Jody thought the pads were 220v? Thats what's nearly gave me an heart attack while browsing :D But perhaps attach the hv cable firmly to the board so it can take some force without being pulled out. Also maybe put the HV board in a splash proof/grounded box within the box.

JodyF1 (author)johanmoberg2016-10-25

Lol yes that is what I first thought too. But all you need is a single stray wire somewhere to create a risk of fire and electrocution. And there are so many ways it could happen. Not to mention other risks. Moisture, accidents, failing components, age, debris, ......... Honestly, it's a long list. But I do encourage people to have fun with electronics - it is how everyone (including myself) learns.

souhadl (author)johanmoberg2016-10-25

Thank you for the constructive advice. Although the board is already covered fully by the tuperware cover which makes it splashproof, I guess extra caution wouldn't hurt) Peace

JodyF1 (author)souhadl2016-10-25

The problem is unfortunately many-fold. The worst part is if I give advice then I could be liable merely for suggesting that it could/should be attempted by non-electricians. I will state clearly that NO work on anything other than SELV (safe extra low voltage) should EVER be played with by those not qualified. If you think about it, even 1.5V batteries can cause fires. They can even be used to produce thousands of volts. And you don't even need 10mA flowing through your heart to kill you. In some circumstances and countries it is even illegal for a non-electrican to install battery-operated devices in bathrooms. If you don't know if it's legal AND safe, just don't do it. Unless you're a qualified engineer, in theory you shouldn't even leave your creations unattended. But to give you an idea, I spotted nearly 10 problems just by looking at one photo. And without specifications of the parts used, or knowledge of how it would be installed, I can't rule out a further 20. Look, I know it is a lot of fun, and I encourage safe learning and experimentation. But for the love of God, stay away from anything that uses more than 30v, or that can deliver more than a few amps. Always use fuses at every source, consider fire risks, assume the worst: multiple parts breaking, people or children or adults accidentally accessing or breaking parts, the list is endless. This is why it takes 2 years studying plus on the job guided experience to become an electrician. And electricians aren't even qualified to design mains powered equipment. That requires a minimum of 4 years plus much experience. Even professional electrical engineers use third parties to check their work before they would risk letting a product leave the lab. I am very sorry you have put in so much work, you obviously know quite a lot to put something like this together, but at the same time not enough to make it safe without a great emount of guidance. My recommendation would be to scrap the high voltage stuff. Use a ready made wall wart of similar for a power supply that has a low voltage output like 12v, or perhaps a laptop PSU and replace the fluorescent lights with high power LEDs. And use fuses, safe wiring, read up on other safe practices such as automotive electrics best practices, a good start for safe 12v practice. Consider all possible risks and hazards. Disclaimer: do not attempt anything unless you know it is safe and legal to do so. I am not suggesting that anyone reading this is now capable of doing so.

BigRob215275 (author)JodyF12016-10-25

I'm with you JodyF1. What is the reason for using 220v when 120v is already wired everywhere and is dangerous enough. This guys idea of splash proof is a cut up tupperware, Shocking and 220v is Deadly!

JohnC430 (author)2016-10-25

Don't pay attention to the negative comments from JodyF. you did a great job of this and installed it where hands do not normally go. so "stray wires" etc is nonsense. it has already been installed.

JodyF1 (author)JohnC4302016-10-25

John, I suggest you have a good look and spend some time thinking about it

JohnC430 (author)2016-10-25

and by the way, follow the wires and you can go directly between the boards and then use a "Terminal strip" to go off the board. it is safer as well as more robust.

JohnC430 (author)2016-10-25

for the next one use a 220ac/12VDC regulated power supply and add the 5V regulator. LM7805. you do not need much power for this project and everything will be safe.

cuyler1 (author)2016-10-25

the staff at instructables needs to hire a safety manager to (censor ) weed out dangerous posts. is the staff all children? when reading the description this device is further used in a "wet" location and a GFCI type of device can only operate the device.

souhadl (author)cuyler12016-10-25

Thank you for the feedback, already looking into the GFCI. What if I was to dip the module with corrosion X instead though?

souhadl (author)2016-10-25

Thank you guys for all the feedback, I'll make sure to take them into consideration when I build the lights for the next bathroom and make some protective alterations to the existing one. However, I would like to draw your attention to the description of the AC-DC converter module:

The power supply is fully isolated industrial grade built-in power module with temperature protection, overcurrent protection and short circuit full protection, AC85 ~ 265V wide voltage input, high and low voltage isolation.

Also, the lights are LED and not fluorescent

Biztux - The country where I live has 220V and not 110V

I used this module that gives both 5 V and 12 V because it excludes an additional voltage regulator or step down module required if I was to use a PC charger or other 12 V supply converters.

JodyF1 (author)2016-10-25

And remember: the greatest risks are usually the things you cannot forsee. It has taken over 100 years of hundreds of thousands of deaths to get things as safe as they are today. All professionals rely on knowledge gained by those before them to get where we are today.

rbielitz (author)2016-10-25

I would recommend using either rechargeable batteries or a spare ac to dc adapter as a power source instead so there is no 120v or 220v ac exposed in the project. Thanks!

biztux (author)2016-10-25

For your 5V supply use a 7805 Voltage regulator and heatsink.

biztux (author)2016-10-25

I am an electronics engineer with over 40 Years experience designing and building electronic equipment and agree totally with JodyF1. I suggest replacing the power supply here with a good quality 220VAC to 12VDC Plug Pack, readily available from any electronic components supplier.

BigRob215275: FYI The international standard for electrical outlets for home and offices is 220VAC, few places outside the USA even have 110/120VAC outlets.

jaswant9 (author)2016-10-25

Nice project. Been thinking about it. and great to see its working video...

DIY Hacks and How Tos (author)2016-10-24

Lights like this are really useful. I have a motion light set up in my mud room so that it turns on automatically when I walk in.

About This Instructable




More by souhadl:Motion Detection Cat and Rodent Repellent Rechargeable Motion Detecting Cat or Animals Repeller Motion detection lights
Add instructable to: