Hacking a PIR Motion Sensor for Use As a Triggering Device.




About: Professional work in various electrical and mechanical fields, obscure sense of humour and typically willing to help... Currently under contract designing environmental monitoring equipment.

This hack will allow you to create a motion sensing electrical switch

You can use this to trigger electrical devices from solenoids to motors to cameras.

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: What You Will Need

Along with basic soldering skills...

You will need a PIR motion sensor mine is from a defunct home alarm.
A small relay, preferably 12V DC coil type.
A transistor NPN type I used a 2N3904
A diode for inductive suppression I used a 1N4001
Stranded wire, Discarded network cable will work in a pinch
12V DC power supply ( Check the requirements of the sensor)

Step 2: Test the Sensor

If this is a used or surplus device you should check the operation before using.

Remove the top cover and examine your sensor.

My sensor uses a 12 V DC supply for operation. The power terminals of the device should show the proper voltage and connection. I used this power requirement to select a relay that was also triggered with 12 V DC.

Connect power, wait for the light to go off then test for motion activation using your hand. The light should go on, stay on for a short time, then off again once the motion stops.

This model worked but the relay connection next to the power connection would not activate so a second method will be needed.

Step 3: Prep the Wire and Solder

Disconnect power and disassemble the device.

Since the relay terminals would not work I chose to use the LED as the relay trigger point.

Since I was going to use this to trigger a remote device, I needed to have 5 feet of stranded wire.

Cut and bare the individual wires in the bundle. You should also tin them at this time using a soldering iron.

Drill a hole for the wire in the back panel of the motion sensor if there is not one.

Feed the wire through the hole in the back and connect to the power terminals and relay trigger points.

If you are connecting to the LED then carefully solder one wire to each leg of the LED.

Wire Colours:

Red and Brown to 12VDC+
Black and Green to 12VDC-
Blue to LED Anode
White to LED Cathode

Step 4: External Relay

Since there is not much room in the sensor case I chose to connect a relay at the opposite end of the wires.

My relay needed 12 V to trigger and since there was only a fraction of that for driving the LED I used a 2N3904 in TO-92 form since I had several of them in my parts bin.
Using standard transistor wiring, Connect the LED power wire to the Transistor Base (B)
The 12V power is connected to the one relay coil contact and diode Cathode,
The other relay coil contact is connected to The transistor Collector (C) and the diode Anode 
The Transistor Emitter (E) is connected to ground.

The other relay coil terminal is connected to the 12V ground of the circuit.

Attach your power source and test for operation. You should hear the relay trip when the LED is active. Seal and protect all bare wiring with electrical tape or Hot Glue to protect against shorting.

Now when the sensor is tripped the LED activates and the relay is activated. Now you can attach your favorite electrical device to the NO and GND contacts of the relay for activation.

One of mine is currently attached to a water valve solenoid from an old washing machine which is attached to a garden hose and is used to scare a skunk out of my back yard…

I have built another that triggers a Zombie Hand Halloween prop in another instructable.

Wiring colours:

Red 12VDC+
Black Power supply Ground
Blue transistor base
Brown relay coil and diode Cathode
Other relay coil to Transistor Collector and Diode Anode
Green Transistor emitter

Relay contacts NO is switch + for device
Relay Ground is switch -
And Relay NC was left open

One final note:

I am starting to find that no matter what you do there is always someone that has done it before you. I found this clip after I completed the build, Enjoy, I know that I did…


Step 5: Onward

This is an example of what I have used this for recently...

Check out https://www.instructables.com/id/Zombie-Graveyard/

Hack It! Challenge

Participated in the
Hack It! Challenge



    • Indoor Lighting Contest

      Indoor Lighting Contest
    • Make It Fly Challenge

      Make It Fly Challenge
    • Growing Beyond Earth Maker Contest

      Growing Beyond Earth Maker Contest

    26 Discussions


    1 year ago

    i'm using 220vac pir for my 220vac siren as my burglar alarm, the problem is when i switch on it activate the siren for around 12 seconds on and off without any detection of movement, i want to eliminate that and what is the best solution?


    2 years ago

    Could someone please help me understand where the white wire that comes off the Led cathode is supposed to be connected to

    I cannot figure it out

    1 reply

    Reply 2 years ago

    If I recall correctly I had to use the LED to circuit as a relay trigger since the on board one would not work. The white wire was connected to the external relay coil See step 4.


    7 years ago on Step 3

    I have an extremely similar if not the same PIR sensor as you do, i found that the RELAY terminals (mine are white and green) have continuity until the sensor is tripped that would be why the resistor is connected to the furthest terminal to remove the feed back that others have posted about when using an outside relay. makes sense to me. just thought i would let you know my findings maybe save you a little bit of work on your next one.

    1 reply

    Reply 2 years ago

    do you know how to get the onboard relay to actually work? I have same sensor but can't figure it out


    3 years ago

    I used the LED to power the relay just as shown, and it works great. But now my LED doesn't light when the relay is working. If I disconnect the relay/transitor circuit the LED works as normally should. It seems like the transistor is robbing the power the LED needs to light up. Any ideas to solve this?


    4 years ago on Introduction

    I am wondering about those outdoor motion activated lights. There are the 120v wiring but I am hoping that inside the motion device has a seperate board for ac to dc to the motion board. I just had an idea if I can convert the 120v outdoor light to a 24DC and connect it to a solar panel grid I might setup.

    1 reply

    Reply 4 years ago on Introduction

    ah ok nevermind. My idea can be done but the motion detectors are cheaply designed and mostly glued together. So might as well get a DC motion sensor unless you got like 100s of extra AC motion detectors, or just a couple extra, haha


    5 years ago on Introduction

    How would it work with a wireless motion sensor ?

    I am trying to re-use some wireless motion sensors from my previous Wireless Home Alarm system

    Heh, they work *really well* - I once had a cat problem, with them tearing into our rubbish bags at night in our back garden. As the floodlight PIRs use mains current to drive the lamps, I just hooked one up to a washing machine solenoid valve, through to a hosepipe with a jet nozzle.

    Set up carefully, the PIR was activated by the cats, which opened the water flow for a 10 second jet of icy water at cat height.

    The cats got the message after a couple of weeks (and I got wet ankles more than once, forgetting to shut it off when I went out the back.)

    As there was an existing floodlight in the garden, I set up a webcam on motion detection recording - the software I used tested the input values and began recording if there was a rapid change in the view. Got a *lot* of daytime cloud change triggered recordings, but (oh yes) about a dozen night-time visitors identified as the lamp came on. Nice to identify the culprits, and no ripped bags.

    Note - I housed my unit in an earthed water-tight box, and used an RCD at the socket. Wish I'd known about Instructables way back then.


    7 years ago on Introduction

    I thought most PIR sensors like the one illustrated had relays in them already as their normal Alarm Output, all of the PIR's in my house do. Why not just use those contacts. If you need a higher current rating, use the existing low current contacts to switch on a larger relay to control your load and avoid the circuit hacking.
    On a point raised by PFED2 , usually the mains switching light sensors have SCR or Triac electronic switches instead of relays and would be unsuitable for modification as the circuit board would be at lethal mains potential.

    1 reply

    As I mentioned in the second step the relay on the one that I had not operational. That is why I went the extra steps and attached the external relay.

    Special thanks to all that pointed out my circuit error. While I never had any problems with my configuration, I have updated the last step with a correct configuration


    7 years ago on Step 4

    You might want to put a diode across the relay coil terminals to protect the transistor from the back EMF generated by the coil when it de-energises. But great instructable with so many possibilites....

    1 reply
    panic modeDrJase

    Reply 7 years ago on Introduction

    DrJase is correct about diode. some relays do have one built in (also some transistors but not small ones like 2N2904).

    btw. using transistor in Common Collector configuration means that output voltage will be even lower than what you bring in (you only get current gain). In the video they show transistor in Common Emitter configuration which is optimal.

    nice video, made me laugh: