The entire setup consisted of 2 computers, 3 microcontrollers, 2 boom boxes, 4 pair of amplified speakers, and 4 CD players. The master computer was a Compaq 486 running Linux. The Compaq had a digital I/O card in it to allow it to sense and control the various other components of the setup. I used to use a 166MHz Pentium for this, but it got fried by lightning earlier in the year. The computer that replaced it didn't have the ISA slot that the digital I/O card needed, so I had to settle for the 486 I had lying around. The master program was written in C, which some parts written in Bourne shell script.
The other computer was an HP laptop with an AMD K-6 CPU running Windows 98. The program was a simple Java program, which was used exclusively to play a wave file on command.
The three microcontrollers (henceforth called MCU) were PIC16F84A microcontrollers, made by Microchip. The programs were written in PicBasic.
I bought two CD players from Walmart for $18 each. I rewired them so that an MCU can control the fast-forward and rewind buttons. One of them also had the play and stop buttons similarly wired, but the play button was giving me some trouble, so I didn't make use of the play and stop buttons. Both of these CD players were loaded with CDs I burned myself. Each consisted of 2 tracks. The first had several minutes of silence. The second had the desired sound.
Since the play buttons on the players were not controllable, I had to manually press play at the start of the night. While the MCU was waiting for the signal to play track two, it would periodically "press" the rewind button to keep playing the silence track. When the appropriate signal arrived, it "pressed" the FF button to advance it to track two. After a certain amount of time, or after the receipt of the appropriate signal, the MCU "pressed" the rewind button twice to move the CD player back to track 1.
Since it might have been cold enough that I'd be wearing gloves, using a computer keyboard during the night was out of the question. Instead, I constructed a control panel consisting of 4 momentary push buttons, a toggle switch, and an LED.
Button one was used to turn off the main sequence. It could also be used to activate the main sequence should the laser fail. Button two toggled the laser MCU. If the laser was pulsing, it would stop. If it was not pulsing, it would start. Button three fired the headless dummy. Button four was not used this year. Turning the toggle switch off stopped the laser pulsing and put the Compaq's program into a sort-of sleep mode where it would poll less frequently, and the only valid action was to turn the toggle back on. All other buttons were ignored while the toggle was off. The LED on the panel indicated whether the main sequence was currently running.
The main sequence was started when someone walked into the garage and broke the laser beam. The laser was a cheap laser pointer I picked up from All Electronics for $4.50. An MCU pulsed the laser every 80ms. The laser beam reflected off a mirror on the other side of the garage and came back to a light sensor, which was a foot or so away from the laser. The MCU polled sensor 1ms after turning on the laser. If no light was detected, someone had broken the beam. In that case, the microcontroller turned on the LED-side of an optoisolator. The Compaq was monitoring the other side of the optoisolator. At that point, the MCU stopped pulsing the laser and waited for a signal from the Compaq, via a second optoisolator, to resume pulsing.
When the Compaq detected the signal sent by the laser MCU, it sent a signal to the MCU controlling the head-turning dummy (dummy 2). Upon receiving this signal, the dummy MCU sent the appropriate signals to the servomotor connected to the dummy such that the dummy turned its head to face the garage door. The MCU then "pressed" the FF button on the CD to play the sound for the dummy. 7 seconds later (after the dummy stopped "talking"), it turned the head back. 10 seconds later, the dummy started laughing. This consisted of turning the head back and forth in short spurts in time with the CD.
In between the greeting and the laughing of dummy 2, the Compaq played a wave file of thunder, which played out of the right channel of the Compaq's sound card, and triggered a strobe light in time with the thunder to make it look like lightning. Unfortunately, the strobe light wasn't very bright, so it wasn't a very effective effect. I had originally planned to put the strobe light outside the back window of the garage, which would have looked more realistic, but it rained that night, so I had to go with plan B.
Dummy 1 didn't move, but he did make noise, which came from the left channel of the Compaq's sound card. This sound card was fed into a JVC boom box with detachable speakers for amplification purposes.
After the all the visitors left the garage, I pressed button 1 on the control panel to stop the main sequence and to inform the laser MCU to begin pulsing again. Button 1 could also be used to activate the main sequence if someone managed to enter the garage without tripping the laser, but this didn't happen. The laser worked everytime. The only problem I had with the laser is that the sensor got out of position a few times and had to be re-aligned. Other than that, it worked perfectly.
In years past, I've had people walk past the garage door, look in, then go to the front door. In case that happened this year, I built a headless dummy and put it in front of the front door. I put a speaker behind it. This speaker was attached to the laptop, which was connected to the Compaq using a LAN. When I saw someone heading to the front door, I pushed button 3 on the control panel. This caused the Compaq to open a socket to the laptop, then close it. No bytes were sent. The connection request itself was the trigger. When the laptop received the connection request, it executed Windows Media Player to play a wave file that directed people to the garage.
The knight and bowl were totally independent from the main sequence. I stripped two inches off of two wires and wove them into the cloth that covered the table in front of the knight. I set the metal candy bowl on top of the wires to close the circuit. When I took the bowl off the wires, the knight's MCU turned on the knight's red LED "eyes" and played track two of the CD it was controlling, which said, "What do you think you're doing with my candy?!?!?"
2 CD players played uncontrolled tracks non-stop. The first was in the rafters in the garage and just played background noise. The second played out of a window in the front of the house. This played a 60 minute CD I picked up in a store last year.
Back to the Halloween pictures.
Page last modified on 09/24/2002