The Laser Sensor
A key element of the display is an accurate sensor to trigger the display when a trick-or-treater approaches the porch. We had tried everything from PIR sensors to ultrasonics but these never proved reliable (the PIR, for example is quite unpredictable in cold weather when the kids are wearing thick jackets under their costumes). The laser sensor seen here proved to be the only reliable method of triggering. In addition to providing a simple trigger, the sensor was expanded to include two beams so that it can sense direction.
The display is triggered by a sensor which uses two infrared (780 nm) laser beams to detect which direction the ‘victim’ is travelling by determining which beam is broken first. A PIC16C84 microcontroller performs the necessary logic. The sensor then drives a 12V relay which activates the pneumatic air solenoid, a green spotlight in the coffin illuminating the skeleton, and sound effects from an inexpensive doorbell which screams when pressed (a commercially-available halloween prop obtained from a dollar-store for about $2.50).
The laser diode which provides the beam was scavenged from an old handheld barcode scanner. The laser includes a matching adjustable lens which proved quite useful in collimating the beam. The entire laser is housed in an old whiteboard marker along with an LM317T acting as a current regulator (The laser diode runs well at 55mA). Along with the laser diode the scanners also provided PIN detectors with matching dielectric filters to exclude all light except the 780nm laser’s. The laser beam was collimated to cover both PIN diodes at the target distance.
An inside view of the sensor shows all optical and electronic components mounted on perf board inside an LED clock case. The PIN photodiodes along with matching filters are mounted behind a red bezel on the case front. The diodes are connected with 2M2 pull-up resistors to the input of two CMOS 4049 inverters before entering the PIC – by trial-and-error it was determined that the 2M2 resistance was optimal to provide a TTL-level signal (+5V when the beam was broken, 0V when the beam was complete). A PIC16C84 microcontroller runs a simple program to detect the direction of the motion based on which beam is broken first. Five DIP switches allow configuration changes such as direction (forward only or fwd and reverse, time for output pulse, retriggerable mode, etc.). Two DIP relays are triggered in response to the trigger event. To drive the entire display the output from the small DIP relay usually drives a much larger relay providing the current needed for the solenoid valves and spotlight.