Motion Triggered Light ProjectBy MissionPeak
Assembly Time: 12 hours (depending on experience)
This electronics project is about creating a motion triggered light that will help to reduce your energy bill! The light will automatically turn off when there is inactivity or when it is daytime.
What You Will Need:
Household extension cord, 2 conductor, 3 to 6 ft.
Four-conductor low voltage phone wires with connectors removed. Similar wires taken from computer mouse or earphone are also suitable.
Small plastic enclosure to house the motion detector and light sensor.
Adhesive and fastener to secure components, circuit board and project enclosure.
Drill and hardware for enclosure box carpentry.
Two 9V batteries, for testing purpose only.
Non-contact infrared thermometer.
Required tools and components:
(1) Comparator Quad ±18 Volt 36 Volt 14-Pin PDIP
(10) 1µF 50 Volt Radial Capacitor
(10) 10µF 50 Volt Radial Capacitor
(10) 100µF 50 Volt Radial Capacitor
(10) Diode Switching 100 Volt 2-Pin DO-35
(1) Standard Regulator 5 Volt 0.14 Amp 3-Pin TO-92
(1) Standard Regulator 12 Volt 1 Amp 3-Pin 3+ Tab TO-220
(1) Relay 12VDC @ 15A SPDT JZC-22F
(1) 50 Volt 1 Amp Df Bridge Rectifier Diode
(1) Photocell 100mW 150Vpack 3KΩ Max Light 0.2MΩ Min Dark
(1) 20VAC Split-Bobbin Power Transformer 115/230VAC
(10) LED Uni-Color Green 565nm 2-Pin T-1
(1) Socket IC 14-Pin Machine Tooled Low Profile 0.3" Wide
(1) Speedy ABS Plastic Enclosure Box 4.9" x 2.5" x 1.5"
(1) Protoboard 2-7/16 x 4-1/8 Plated Thru Pad/Hole 674 Holes
(10) Fuseholder PC Fuse Clip 5mm Front Leads GM-Series 10
(1) Fuse GMA Fast Acting 3A 250V 5mm x 20mm
(2) Potentiometer 500KΩ 3362P-504Lf Single Turn .5 Watt Cermet
(10) Capacitor Radial 0.47µF 50 Volt 20% 85°c 5 x 11 x 2mm
(50) Resistor Carbon Film 2kΩ 1/4 Watt 5%
(50) Resistor Carbon Film 51kΩ 1/4 Watt 5%
(50) Resistor Carbon Film 390kΩ 1/4 Watt 5%
(10) Transistor General Purpose BJT PNP 40 Volt 0.2 Amp 3-Pin TO-92
(1) DIP Switch Single Pole Single Throw 2 Position 4-Pin Low Profile Slide Flush
(10) LED Uni-Color Yellow 2-Pin T-1
(10) LED T1 Orange Red Diffused 622nm 18mcd 2.1Vf 3mm
(1) PIR Sensor (Rev B)
(10) Resistor Carbon Film 100KΩ 1/4 Watt 5%
(10) Resistor Carbon Film 10KΩ 1/4 Watt 5%
(10) Resistor Carbon Film 1.0MΩ 1/4 Watt 5%
Step 1: Sensor Modules → Construct and Test the Sensor ModulesThe sensor module has four wires that are connected to the main unit:
|+5V||+5V Power supply|
|MOTION||Motion detected signal, 0 – 5V, active high|
|OPTO||Light intensity voltage|
The PIR sensor, R1 and CDS photo resistor are all soldered and housed in a small, plastic enclosure forming the sensor module. The enclosure must be opaque and non-conducting. For example: small soap boxes, cups, etc. The prototype shown below used the plastic lid of a coffee can. Take precaution to provide sufficient insulation and avoid exposing any metal parts of the components.
The surface of the photo resistor without pin leads is sensitive to light. You are recommended to adjust its orientation so that it picks up the ambient light of the room while also avoiding directly pointing to the room's light source that you want switched on/off. This helps to keep the lighting feedback within the hysteresis voltage. The photo resistor is connected between the +5V and OPTO lines while R1 is between the OPTO and GND lines. The photo resistor should have resistance less than 10K Ohms in very bright light conditions, about 50K ? 100K OHMS in dim light and more than 1M Ohms in darkness. The photo resistor and R1 produce a voltage at the OPTO line with brighter light having a higher voltage.
When the construction is completed, perform Tests 1A-1C to verify the sensor module's operation.
Step 2: Component Placement on the Circuit Board → Place Circuit Board Components to Ensure FeasibilityThis component planning step does not involve soldering. Insert all of the components onto the circuit board. Some of the components may have slightly different sizes than what the placement plan gave and it may not be possible or necessary to have the exact same placement.
Cut/trim your circuit board so it is able to fit inside your project enclosure. It is important to place all of the components on before soldering to avoid time consuming to rework. If necessary, use adhesive tape to secure IC sockets and components to the circuit board.
In some cases soldering points are needed on the top side of the circuit board in order to connect the wires from the sensor module and the power cord. Make sure that these soldering points have enough space from other components to make soldering easier. Components leads of resistors or capacitors are ideal for making these soldering points. For the sensor module wires you can also use the header plug and pins.
In the plan shown below, LED-Y, LED-G, and LED-R are positioned at the side of the circuit board to avoid off-board wires. Do not drill holes on the enclosure yet; wait until Test 6B has been completed. You many need to do repositioning due to wiring errors.
Note that the bottom-view of the circuit board shown is left-right flipped
The AC power lines of the extension cord will be connected to the relay to be switched on/off. Make sure that the relay pins are correctly identified using resistance measurement of your Digital Multimeter (DMM). The coil resistance should be about 360 Ohms. If the relay is not SPST type, it will have more than two switch contact pins. Double check you identified the normally opened and normally closed pins correctly. Energize the relay coil with 12V DC battery power and measure the switch pins' resistance to identify them. The datasheet of the relay might be outdated. Do not solely rely on the data sheet information to avoid AC power line hazard.
Warning: Relay will be connected to AC power lines. Verify the pin configuration with your DMM. Do not only rely on the datasheet information to avoid AC power line hazard. Data may be outdated or contain errors.
Step 3: Circuit Board Wiring → Solder Circuit Board Components and WiresNow, you are ready to solder the components onto the circuit board. It is recommended to start with the signal wiring before the VCC and GND wiring. The excess component pin leads can be used for the front side soldering points.
The circuit board is divided into COLD and HOT sections to identify the high voltage areas. Because the wires are thicker, leave more room for the soldering points of the extension cord. Now, you can drill holes on the circuit board and use nuts/bolts for electrical connection. This method requires more space allocation. Do NOT install the transformer T1 yet, that will be done in a later step after the battery powered testing for safety reasons. However, all wiring involving the transformer, relay, and extension cord need to be marked and reserved. The four wires from the sensor module need to be soldered in this step to allow for testing. They will be reworked later to fit the wires inside the enclosure box.
Caution: Use the wiring plan as a reference. Do not use the prototype photos. This is because the board and components provided might be different than the ones that appear in the image.
Step 4: Electronic Circuit Testing → Test the Operation of the Electronic Circuit with Battery PowerIn prior steps, all low-voltage wiring of the circuit has been completed. For safety reasons, most of the testing will be done with battery power. After the electronic circuit and AC power supply are verified, they will be connected together in a later step. Completing the mechanical construction is not necessary at this step.
Make sure that you carefully follow the test procedures in the exact order they are described. This is essential to make sure that you have wired the components properly. It also minimizes the risk of damaging ICs due to improper construction, soldering, or defective components. When installing the LM399 to its socket, pay close attention to the polarity. Wrong installation may cause permanent damage to the IC. Use the continuity test of the DMM to check wiring and soldering when in doubt.
Warning: Follow the test procedure in the exact order described. Do NOT proceed to the next test until the current test has passed.
Step 5: AC Relay Switching Construction and TestingCut a household extension cord in half and solder the male and female sides of the extension cord to the circuit board based on the wiring plan given in Step 1. For North America US, the pin polarity of the AC power outlet is shown below. Check your local electrical code for other regions of the world.
Step 6: AC Power Supply Construction and TestingBefore this step, you have verified the operations of the electronic circuit with battery power. Now, you are ready to solder the primary (high voltage) side of the transformer T1. Before you begin soldering, measure the resistance of the transformer's primary and secondary. The primary should have higher resistance than the secondary. Leave the low voltage side of the transformer unconnected to DB1. It will be connected after test 6A has passed.
Safety precautions working with wall outlet AC power:
- Use alligator clips to secure the DMM probes to test points before plugging into the AC wall outlet
- Unplug or turn off AC power immediately after the measurement is taken. Do not physically handle the circuit board, probes, or DMM when the AC power is active
- Do not probe the circuit when AC power is active. Probing action might cause short-circuit accidentally
- Beware that the HOT section of the circuit board carries live AC voltage. Avoid any human body contact.
Step 7: System Completion and System TestAt this step, many critical tests have been conducted. You are now ready to install the circuit board into the project enclosure box. Glue a few non-conducting plastic washers on the back side of the circuit board to prevent the component pins from touching the base of the enclosure box. This helps avoid physical stress to the component pins and soldering.
Drill holes on the enclosure box side wall to expose LED-R, LED-G, and LED-Y. Also drill holes for the extension cord and sensor module wires. De-solder all wires used during the AC tests of the previous step. Final soldering of the wires will be done with the circuit board once inside the enclosure box.
To prevent external force of the extension cord from ripping the internal soldering, make a kink or a knot at the location where a cord enters the box. This is an important mechanical construction to prevent AC power hazard. If the internal soldering of the extension cord is loose, AC power line short-circuit may occur. Because the extension cord wires are very thick, you may want to insert the wires into the enclosure box before soldering them to the circuit board. Solder the four sensor module wires to complete all electrical connections.
Kinks inside the enclosure box avoid ripping extension cord soldering joints.
All electrical wiring soldered.
If you have an electronics story or project you'd like to share, please email [email protected].