Old Junk Given New Mission as Remote Motion Sensor
Long-Range Wireless Gate Annunciator
The motivation for building this came when the county converted my rural access road from a cul de sac to a through road and vehicle traffic past my place increased by a factor of a hundred. My front gate, where the driveway meets the county road, is about 1000 feet (305m) from the house and with tree growth is becoming increasingly hard to see from the house. While my dogs make an excellent "motion-sensing system" when a visitor nears the house on the driveway (or otherwise), I wanted to get a heads-up when a vehicle or pedestrian passed through the gate - a preemptive doorbell.
Amongst my pile of surplus electrical/electronic junk and other stuff gathering dust, I had this particular combination of parts, most of it given to me some years ago by a friend who came up with the original annunciator idea:
The wireless annunciator function probably could be duplicated with a currently available sensor, microcontroller and wireless modules, though I'm not sure it would work at 1000 feet. Likewise, I doubt any of the commercial [Home Depot, etc] wireless motion sensors work at that range, though I've never tried one. This approach had the advantage of being priced right - ie, cheap - with the potential of working out to a range of a mile or two. Even a wired system at 1000 feet would require a hundred dollars worth of field wire.
Anyway, the project proved to be more challenging than I thought at first it would be, but ended up being fun and educational. You may find some of this material useful in your project or application.
The Main Challenge: The Motion Sensor
I actually had 3 defunct motion sensors, removed from motion-detecting floodlights, all Heath/Zenith units, a model that seems to be particularly unreliable. Given the poor reliability of these sensors and the need to troubleshot a bad unit before even attempting to adapt it to my purpose, I decided not to try and rehabilitate the sensor electronics and returned instead to first principles. I would retain the enclosure and mount, and build the sensor electronics up from scratch.
Heath/Zenith Motion Sensor
Original electronics and Fresnel lens removed - outer case and clear plastic horn retained.
Brittle and crumbling after years in the sun, the Fresnel lens could not be reused, so I ordered a new lens.
Also, not wanting to trust the PIR sensor on the original Heath/Zenith electronics board, ordered in a new PIR sensor.
PIR Sensor/Gunn Oscillator Interface
A pretty good explanation of how a Passive (or Pyroelectric) InfraRed (PIR) sensor works can be found on Wikipedia. The main takeaway is that the useful output of the PIR sensor is a tiny AC signal superimposed on a DC voltage. The detector circuit reacts to abrupt changes in the sensor's output, in other words to the AC component produced by moving objects. The (usually relatively large) DC component is produced by steady or slowly varying background IR radiation from objects and terrain, fixed artificial heat sources or very slowly moving objects. From information in the Wikipedia article, the data sheet for the PIR sensor, snippets of circuitry found on several web pages, and some experimenting, I was able to piece together and build the amplifier/differentiator circuit shown in Figure 1.
The output of the PIR sensor appears on pin S and is directly coupled to the first amplifier stage (U1a). The first stage amplifies the desired AC signal (~2-20 Hz) with a voltage gain of about 20. The non-varying and slowly varying (<1/10 Hz) background level is not amplified. The first stage is coupled to the second (U1b) through the 22 µF capacitor. Only the AC component of the signal is passed by the capacitor. The voltage gain of the second stage is variable via the SENS control from 125 to about 350, for a total gain of 2500-7,000 (68-77 dB).
The output of U1b is directly coupled to U1c and U1d, which, with two diodes, form a voltage comparator and full-wave rectifier. When the output of the second stage amplifier reaches a level of about 1 volt peak-to-peak, one or both of the diodes conduct, charging the 150 µF capacitor and turning on the NPN transistor (2N2222) and the PNP transistor (2N2907), energizing the Gunn oscillator. The charge on the capacitor maintains the Gunn in the ON state for a few seconds after the moving object has passed.
The new interface circuit was built on a piece of perforated circuit board with the same dimensions as the original detector board, with the PIR sensor placed at the same physical location at the center of the board.
PIR Interface Board
The PIR sensor is the only newly purchased device on the board. The balance of the circuit was built with parts on hand, mostly unused old stock. Some of the capacitors had been cannibalized from equipment.
The new board was installed in the original case in place of the original detector board. The original plastic horn was reinstalled, along with the new Fresnel lens, and the case sealed up with RTV. A hole in the bottom of the case allows access to the SENS control.
I assume the function of the horn is to help focus IR radiation arriving from the front onto the sensor and maybe to shield the sensor from the tiny amount of heat generated by the electronics board.
Completed Motion Sensor
The Microwave Link
The Remote End:
The Gunn oscillator is at the head end of the communications link used to send the status of the PIR detector to the monitoring location (the house). A single bit of data is transmitted: The transmitter is off when no motion is detected; the transmitter is turned on when motion is detected (by the PIR sensor). This particular device (New Japan Radio Co NJR4104) operates in the X-band.
X-band Gunn Oscillator
It's a pretty simple device - though don't ask me to explain the quantum mechanics (again see Wikipedia). The oscillator consists of a Gunn diode mounted in a resonant cavity. The diode and cavity act as a relaxation oscillator when the diode is forward biased at a certain voltage (around 8Vdc). The current draw is around 110 mA (880 mW). The RF output from the cavity is about +12 dBm (16 mW). The oscillator frequency, nominally 10.525 GHz, can be varied slightly by varying the biasing (power supply) voltage. The cavity also includes, in addition to the Gunn diode, a mixer diode used for detecting an incoming microwave signal. Thus the device is a transceiver and probably would normally be part of a speed radar or microwave motion detector. The receive function is not used in this application. While this particular oscillator was a freebee, similar oscillators are often seen on eBay for around $100.
Microwave communication requires a line-of-site path, or nearly so. In tests with the radar detector described below, the Gunn oscillator without an antenna could be detected at a line-of-site distance of around 2000 feet (610m). While this sounds like it would be more than adequate at 1000 feet, it is only 6 dB above the detectable level, and since the working location is not strictly line-of-site from the house, with lots of microwave-absorbing growing trees blocking the path, and because I wanted the receiver to be capable of reliably operating at varying locations within the house (not just near a window), I decided to equip the oscillator with an antenna. The horn antenna, shown in the photo below, bought on eBay, provides 17 dB gain over the bare oscillator.
Antenna Mated to Gunn Oscillator
Equipped with the antenna, the system line-of-site range theoretically increases to about 2.7 miles (4300m), fade margin at 1000' increases to 23 dB.
The Receive End:
X-band Radar Detector
This appears to be an X-band only speed radar detector, the kind of thing widely available at truck stops before police radars moved to higher frequencies and began employing more sophisticated techniques. It's equipped with an LED bargraph signal level indicator, a 2-position sensitivity switch ("HWY" and "CITY" settings) and an audible alarm that sounds when a signal in the X-band is detected. For optimal sensitivity the detector must be oriented with the rear of the unit facing the microwave signal source. The unit requires +12 Vdc at 250 mA. That's about all I know about it. It works.
With the PIR sensor circuitry requiring a few milliamps continuously and the Gunn oscillator about 110 mA intermittently, the 3.5 Ah gel (lead-acid) battery is more than adequate for powering the remote end of the annunciator system. If one were building this thing with new parts, a string of NiMH AA rechargeables might be a better match to the power requirements, but the gel battery was available.
At 200-300 mA output current when the sun is shining, this is likewise probably overkill, but again the price was right.
As-Built Constant-Voltage Charger-Regulator Circuit
The LM317 regulator (U2) provides constant-voltage (CV) charging for the gel battery. The regulator is set to charge the battery at its optimal float value, 13.6 volts, at 20°C (68°F). The battery may never actually reach a full charge at that setting but will come very close over time. The float setting is very easy on the battery, which is good for long battery life. U2 is set to slightly higher output to allow for a 0.35 volt drop across the 1N5817 diode. The diode prevents the battery discharging through the charging regulator and solar panel when the sun is not shining. Due to the approximately 2.35-volt dropout headroom requirement of the LM317 regulator (U2) and 1N5817 diode, the battery charging regulator circuit does not charge the battery during heavily overcast sky conditions. Fortunately, the current requirement for the annunciator system is low, the battery capacity large, and the number of heavily overcast hours in a year at this location low; the battery stays adequately charged.
The second regulator IC on the board (U3; on the right) regulates the battery voltage to 8 V for the sensor circuitry. U3 was later relocated to the PIR sensor board. (Why? Click here.)
Gel batteries have a lot of advantages, but they're a bit fussy regarding charging voltage, especially in outdoor situations where ambient temperature is not controlled. The compensator circuit below varies the charging voltage inversely with battery temperature.
As-Built Temperature Compensator Circuit
The the output voltage of the LM34 temperature sensor (glued to the battery) drives a voltage-to-current converter, the output of which pushes or pulls current into or out of the adjustment node of the LM317 charging regulator, varying its output voltage. The component values are selected so as to vary the charging voltage inversely with battery temperature by .012 volts per °C (-2 mV/cell/°C), with 14.05 volts at -17.8°C (0°F) as the baseline reference. Charging voltage at -40°C will be 14.33V. At +40°C, 13.37V.
Temperature Compensator Board
The temperature compensator was an afterthought, so it ended up on a separate board which plugs into the regulator board.
Charger-Regulator, Temperature Compensator, LM34, Battery
No problemo. An old wall wart does the job of converting 120-volt AC service to the 12 Vdc required by the radar detector. Grid power simplifies things.
The Installed System
Battery, Charger-Regulator, Gunn Oscillator Installed in Weather-Tight Box
The antenna is glued to the side of the box. The box is made of a non-metallic material, so is transparent to microwaves.
On a Post
Motion Sensor Performance
Installed as shown above, 25 feet (7.5m) from the gate, the sensor was too sensitive initially, often falsely registering vehicles passing on the nearby county road, 60 feet from the sensor, along with those correctly registered entering through the gate. Lowering the sensitivity [SENS control] reduced the number of false hits, but I soon discovered that heavy precipitation blinds the sensor beyond 8-10 feet, regardless of the sensitivity setting. I researched this a little and found that it's to be expected at the wavelengths the sensor responds to [5-14µm]. Relocating the sensor directly on the gate (connected to the battery/Gunn oscillator box through 40 feet of 3-conductor buried cable) and increasing sensor sensitivity [SENS] greatly improved detection of vehicles passing through (100% detection) while greatly decreasing detection of vehicles passing on the county road (0% detection).
Relocated Motion Sensor
Notice the sensor is mounted with a pronounced down-tilt. This increases sensitivity to nearby motion and decreases sensitivity to distant motion.
A couple of sprigs from a fake Christmas tree stapled to the post make the sensor less obvious.
See those pretty clouds? The sensor had difficulty dealing with those at first.
The Installed Receiver
The microwave receiver (radar detector) works well in the house, though the signal level varies from location to location. As expected, the number of walls and thickness of walls between the gate remote and the radar detector is predictive of signal strength - more wall, less signal. There are a few dead spots where the signal is below detectable level. Unfortunately, a location I'd had high hopes for on some shelving convenient to an AC outlet and centrally located, is one of those spots. I ended up placing the unit at a location slightly less convenient but with an adequate signal. The installation was made in the winter months when the (deciduous) trees were leafless. It remains to be seen how well it all works during summer months. [Update: The microwave link continues to function in the summer months, though with somewhat reduced received signal level.] The receiver was later connected through a beep/siren power amplifier to an external speaker system which allows the receiver to be heard in outbuildings.
Before installing the system, I thought signals from automatic door openers, police radars and the like might cause falsing of the radar detector, indicating a gate entry when there was none. This has proved not to be a problem. Whatever "foreign" signals are out there apparently are too weak. The microwave oven in the kitchen, 25-30 feet from the detector, occasionally elicits a short beep on power-up.
System Detects Unauthorized Entry!
Very early one morning the sensor caught something passing through!
Schematics produced with DCCAD.