further instructions - can anybody expand for me?
You’d have to solder the LED to the perf board and use some wiring to connect them to the relay sharing a common ground with the 9V power supply of the Arduino and then connect the Arduino to the relay using some male to female jumper wires and then program the Arduino using an IDE to interact with your motion sensor and control the lights
I wit ant to be able to get this to work so I can put the resin disk and see work
I’ve linked a useful tutorial for using relays with the Arduino Uno, if that’s the micro controller that you decide to use. If someone else from our community has any advice or if you have any further questions feel free to add another post. Have a great day mate!
"a motion activated wall light that turns on an led and after a time turns it off" These type of devices are readily available in many stores. Most are used as outdoor sensors to turn light on when movement detected. You may be able to adapt one to your needs, maybe not.
Anyway you don’t need the complication of a UNO or any other microprocessor.
The PIR device listed above has very little information about it, the wiki shows a blank page for me. Another supplier (local for me) has a similar device with detailed information and is cheaper. I have used one of these to do what you want to do.
The circuit is very simple and does not use a micro. I am happy to provide it here, with explanation of how to wire it up; if you want to do this as an electronic project. I still think you would be better off finding a commercial product that does close to what you want.
Have put the following together for you.
Modified my design to include a single LED as listed in your original post. (see pic below)
This PIR is the same as the one I used, its power requirements are quite flexiable. 5V to 20VDC.
It outputs 3.3V when motion is detected, easily driving the transistor. It also has a trim pot to change the time the PIR remains active. (LED on time)
Suggest this resistor pack as it has the values in my design and is not too expensive. You could just buy individual resistors if you wanted,
I am unsure of what you have for putting electronic circuits together. Suggest this as an easy way to build and test the project and change parts quickly if necessary.
A battery holder similar to this could be used to power the project. If the LED is on all the time, 4 x AA cells should last about 24 hours. If it is only on for a short time then much longer. If you need longer life you could use NiMH cells, or use 6 x AA or 8 x AA cell battery packs. If you decide to use more cells you should increase the 220 resistor to 470 for an 8 x AA battery pack.
In my design I used a BC338 Transisitor. You can use the BC337 Core Electronics provide.
I have listed Core Electronics products because this is their forum. You could source parts from a local electronics shop if more convenient for you.
All the best
(Core Electronics Customer)
As far as I can tell the LED in the you tube video would drain the 9V battery in a few hours. The specifications say the LEDs are 0.75W to 1W (60mA to 80mA) at 12VDC. At 9V it would draw less current.
The Super Bright LED is listed at 20mA. The 9V battery would last longer. By changing the 220 ohm resistor to a higher value you could reduce the current further. But LED intensity might not be what is desired.
The circuit I have provided above is about as simple as you can get, given what is available from electronics shops. It is also quite flexible with respect to the power source. (5V to 20V)
If you know someone with some electronic skills they could build the circuit for you. It would all fit on a small piece of vero board, as you can see for the attached pics of the device I built.
I see now with what you want to achieve, commercial motion detectors would not work.
Just want to be clear, whatever you purchase and build is up to you, I am not telling you to do anything.
If it does not work I will try and resolve it for you on this forum, but I cannot control what you do and what you buy. You need to understand what you are buying and why. The links above are suggestions to help you get the project working.
The attached pics are what I put together today and show that the project will work. I used a solder station to connect wires to the LED and battery pack and cutters to cut the wire. Heat shrink to cover the soldered wires. Jumper wires to connect to the breadboard.
I suggest building the project on a breadboard because it allows easy change to the components. It also gives you confidence the project will work. The LED was the only bright one I had in my parts bin. The 220 ohm resistor was too high and the LED was not very bright. Replacing it with a 120 ohm (large resistor) allowed the LED to shine brightly. When making changes always disconnect the power.
The following is a list of items in the pics.
PIR Infrared Motion Sensor (HC-SR501) SKU: CE05786
170 Tie Point Mini White Solderless Breadboard SKU: CE05142
One of the following, depending on price and soldering availability.
4xAA battery holder (square) SKU: FIT0079 $1.86 (cheap but need to solder wires)
2x2 AA Battery Holder with Premium Jumper Header Wires SKU: ADA3905 $6.07 (jumpers already attached)
1 Watt Cool White LED - Heatsink Mounted SKU: ADA518 (this can be very bright)
BC338 Transistor (BC337 would be ok)
470 ohm resistor
120 ohm resistor
The wiring connection is the same as in my previous post. The transistor must be orientated correctly, if not it wont work. Applying the voltage incorrectly can cause the transistor to fail. The same with the PIR device. The resistor pack I previously linked has the resistors you need. You will have to look up the jumper wire.
If you understand all of the above and are happy to spend the money, go ahead.
(Core Electronics Customer)
The magnetic reed sensors are non-latching which means they are only active when a magnet is near. Remove the magnet and the switch deactivates.
If the reed switch is normally open. MP201701
It would be connected between +ve and the DO end of the 470 ohm resistor. When a magnet is placed near the reed switch the light would turn on. When removed the light would turn off.
If the reed switch is normally closed. MP201702
It would be connected between GND and the DO end of the 470 ohm resistor. Another resistor would be needed to between the DO end of the 470 ohm and +ve.
Yes you could use the reed switches to activate your light.
The PIR feature of remaining on for some time after being activated would not happen with these switches.
Some pics that might help you in your construction.
I cut the leads on the components so they would not short out on the breadboard.
The 5 connection points in each row on the breadboard are connected together. 5 on one side and 5 on the other of the center section. (hope that makes sense)
The transistor has a curved side and a flat side. Note it is placed across 3 rows with the curve side to the outer edge of the board. This is important, if it is orientated wrong it wont work and may get damaged.
In the last pic the red wire is like the PIR it activates the transistor and the hence the light. This is just a test to show the transistor and light are working correctly.
I will post the connection to the PIR in another post.