Salvaging a Motion Detector

copyright H. Paul Roach and Peter H. Anderson
Department of Electrical Engineering
Morgan State University
Baltimore, MD 21239
September 10, 96

This section explains how you might salvage the motion detector assembly from an outside light assembly used by homeowners. These have become quite inexpensive, typically less than $15.00. These fixtures detect motion and then operate one or more 120 VAC lamps for a period of time. The period of time for which the lamps are operated usually can be varied by the homeowner by adjusting a potentiometer. The unit uses a cadmium sulphide resistor such that the lamps only light when the ambient light is low.

Caution. These units are powered by 120 VAC which can be lethal. Do not work with a powered unit. In the following I show how you might adapt the unit to work on a DC voltage such as +12 or +24 VDC and plugging the unit into 120 VAC is not necessary. Don't connect 120 VAC..

Further, please note that I have gutted only two models. They were similar. However, this is far from a representative sample. Therefore, please take my words for what they are worth. This discussion may not apply to a model which you have.

A block diagram in Figure #1 illustrates the two units I examined. The unit interfaces with the residence 120 VAC system with three leads, 120VAC (usually black), neutral (white) and switched 120 VAC (red) which powers the 120 VAC lamps when motion is detected. A fourth lead may be protective ground which is usually green.

The 120 VAC is reduced using a voltage divider, R1 and R2, and the result is then halfwave rectified using a single diode and an electrolytic capacitor so as derive a DC voltage in the range of +12 to +24 VDC. The value of this DC voltage may vary from one model to another. This DC voltage powers the motion detector module and the relay.

This, WITH NOTHING CONNECTED to the leads ( black, white and red) that normally connect to the residence 120 VAC system, I simply connected a DC supply across the capacitor, thus replacing the DC supply normally derived from the 120 VAC. In fact, I used a +12VDC power module; one of those thing you normally plug into the wall and are normally used to power external modems, scanners, ZIP dives, etc. For good measure you may wish to cut out the rectifier diode to isolate your DC source from the AC leads that normally power, but as I say, DO NOT APPLY 120 VAC to these leads.

You should be able to find the electrolytic capacitor with ease. Trace the black and white leads that normally supply AC, find the power resistors referred to as R1 and R2 in the figure, and locate the diode which connects to the plus side of a prominent electrolytic capacitor. (I have found there are usually two electrolytic capacitors and assume the other one is used for timing).

The DC source powers the motion detector assembly and the relay. The principle of the two units I examined was based on a pyroelectric "eye" which detects infrared radiation. Changes in the amount of IR caused by a human entering the zone or by movement causes a deviation in the pyroelectric devices output. I didn't spend the time to carefully examine the entire unit, but assume the circuitry consists of a voltage follower, averaging circuit and comparator to compare the instantaneous value of the detector with the average along with a timer to protect against false tripping. (This is all conjectural).

The "eye" is a pretty innocuous looking component and I am impressed with the fact that these motion detectors work very well at reliably sensing motion, even 30 feet away. Another miracle of modern technology!

On detection, a relay is operated which connects the black lead to the red lead. In normal operation, when the relay closes, the 120 VAC on the black lead is gated to the red, which causes the flood lamps to turn on.

Thus, other circuitry on the motion detector assembly consists of a relay driver and the timer that controls the amount of "on" time. There is also a cadmium sulphide resistor which enables the motion detector when dark. I put a piece of tape over the distinctive photo resistor so as to always enable the unit.

You might take the time to examine the printed circuit board and verify that the black and red leads are connected to the relay.

The result then is a unit which is powered, not by lethal 120 VAC, but by your +12 VDC power module. On the detection of motion, the relay closes, providing a dry closure to the external world. Just in case you haven't already gotten the message, DON'T USE THIS CLOSURE to switch 120 VAC. In our case, we used it to switch another source of +12 VDC having more current capability than the power pack we used to power the motion detector unit to a bone chilling siren which startled even the most solid students as they walked around the lab.

Alternatively, this dry closure might be used to interface with the parallel port as shown in the figure. Note that when open (no intrusion), a logic one appears on the BUSY input. When motion is detected a logic zero appears on the BUSY input.

I did not go further. Thus, I lived with the 15-30 second time interval that the unit stays on when motion is detected. You may wish to look at the circuit further to see if you can reduce the timing. Again, on the two units I examined, there was a second large capacitor and changing the timing may be no more than substituting a smaller capacitor.

In program MOTION.C, the BUSY input is continually sampled for intrusion (logic 0) and then waits for the detector to reset, and then increments a counter. This might be used as a "people" counter, but I am sure the reader can discern the limitation with the lengthy time that the closure is present; one could move an entire troop of boy scouts by the detector while the program counts a single person.

** Program MOTION.C
** Continually samples BUSY input.  If at logic zero (instrusion),
** waits until at logic one (end of intrusion) and increments counter
** Peter H. Anderson, Morgan State University, Sept 10, '96

#include <stdio.h>
#include <dos.h>

#define DATA 0x03bc
#define STATUS DATA+1

void main (void)
   int counter = 0;
      if ((((inportb(STATUS) ^ 0x80) >> 7) & 0x01) == 0)
         delay(200);  /* wait for relay to settle */
         /* intrusion */
            if ((((inportb(STATUS) ^ 0x80) >> 7) & 0x01) == 1)
            /* end of intrusion */
            printf("Number of Incidents is %d\n", counter);
            delay(200); /* wait for relay to settle */
            break;  /* out of inner while(1) */

Further, I didn't fully investigate nor experiment with the pyroelectric device. I did note that in both units it was a Hamamatsu P2288 and located a description of the pins. See Figure #2. In addition, using the AltaVista search engine, I discovered that Hamamatsu has an office in New Jersey at telephone (908) 231-0960, FAX (908) 231-1539. I don't know if they directly sell to students and certainly would welcome any information. Please send me e-mail at