With this Instructable, I'm putting in text that didn't make the cut for a size-constrained magazine article and creating a space to explore the latest options for computer control. The Win98 machine I had previously used to drive my controller can no longer by relied upon and I haven't yet conquerred external (parallel port, serial port, USB, ...) control with WinXP or MacOSX; hopefully we can collect some great pointers and links in the comments.
The original page describing this project is here.
Step 1: Background, or What Made Me a Bad Kid
As I grew older, trick-or-treating became more of a search for Haunted Houses than a search for candy and mischief. I was ever-hopeful that around the next corner would be that one weird guy who turned his garage into a haunted maze built from cardboard and bedsheets. I was never satisfied with what I found. “I could do better than that”, I often thought. So, for roughly the last ten years I’ve been perfecting my technique of scaring kids and handing out candy. In this project, I will show you how to build the tool I use most frequently in my haunted creations and give you some ideas for your own Haunted House.
Step 2: Controller
In this project, you will build a simple circuit to switch on and off AC or DC via computer control. You can then write code to sync lights, motors, fog machines, pumps, laser pointers, and other things to computer generated sounds using the parallel port.
Step 3: Materials
Grounded extension cords – One for each AC relay; one should be at least 6 feet long with the others as short as possible because you’ll be cutting them.
Wire – #16 AWG for AC, #22 AWG solid-core for DC and signals.
Resistors, 470 – 1k Ohm
24 pin DIP connector
25 conductor ribbon cable
25 contact male D-subminiature connector
Non-conductive base and cover material (I used wood and acrylic)
Hand drill and drill bits
Hot glue gun – optional
Step 4: Make It!
Attach the solid-state relays, terminal block, and breadboard to the base using the wood screws. Lay the components out, mark places for holes, and drill holes appropriately sized for the screws.
Cut the extension cords approximately 12 inches from their receptacles and strip 3/4 of an inch of insulation at the cut. Mount the receptacles to the base by drilling through holes and securing with cable ties; use hot glue for a snugger fit.
Attach the cut end of the long extension cord to the base, and strip 3/4 of an inch of insulation.
Wire up the AC side of the controller according to the schematic using the screw connections on the terminal block and the solid-state relays. Use short pieces of the #16 wire to connect hot to all the solid-state relays (it’s best to switch hot, not neutral).
The wires in extension cords are often color coded: hot is black, neutral is white, and ground is green. If yours isn’t color coded, look at the plug with the blades pointing towards you and the round, ground plug at the top; hot is the smaller blade on the lower right. Once you have identified the proper blade, use a multi-meter to check conductivity between the blade and the stripped wire. If you’re confused, ask a friend with AC experience to lend a hand and check your wiring.
Make the data cable by attaching the ribbon cable to the D-subminiature and DIP connectors. This is done by positioning the ribbon cable in the insulation displacement connectors (the two rows of forked contacts) and pressing down with the strain relief, which will then snap into a locked position. Each of the forks pierce through the ribbon cable’s insulation and make a connection with a conductor in the ribbon cable. You will need to separate one of the conductors from the ribbon cable on the DIP connector side; this will be either pin 1 or pin 13 on the parallel port, neither of which are used in this project. Use the multi-meter to determine how the pins on the D- connect to the DIP. Pins 2 through 9 are output data lines and 18 through 25 are all grounded.
Wire up the signal side of the controller on the breadboard according to the schematic. Use small pieces of cut and stripped #22 wire. The parallel port can only source a few milliamps of current and can be damaged if the data lines are shorted to ground. Ensure your wiring is correct before attaching to a computer. Use a cable tie as a strain relief so the DIP connector doesn’t get yanked out of the breadboard. Instead of a breadboard, you could use a prototyping board and solder all the connections. I chose the breadboard because I’m sure I’ll want to modify the controller later, or scavenge all these parts for some future project.
The LEDs are not required to operate the solid-state relays. They simply provide feedback about the state of the parallel port. With fewer solid-state relays than data lines in my controller, I used an LED on the fist data line to indicate that my code was operating and that there was a good connection to the computer.
Cover the AC portion of the controller. Mark and drill holes in the base and cover and connect them with the stand-offs. I used clear acrylic so I could still see the LEDs.
Once you’ve double checked all your wiring, plug the controller into your computer’s parallel port (leave the AC unplugged for now) and see if you can make the LEDs go. Use a parallel port monitor such as “lpt.exe” from http://neil.fraser.name/software/lpt/. The port number of the parallel port varies between machines, so be sure to check all the options. You may have to change your parallel port’s setting in the BIOS to something other than bi-directional, such as ECP or output only. The 8 output pins are addressed in binary fashion: writing a 0 to the port turns them all off, writing 1 turns on the first pin, 2 the second pin, and 3 the first and second.
Plug the controller into 120 VAC and plug a lamp into one of the receptacles connected to an AC solid-state relay. The power to the lamp should now be under computer control. To control a DC device, modify its power supply (for example, the device’s wallwart), switching the positive conductor with the solid-state relay. For battery powered devices, you can use an external battery pack and run the wires through the controller, or cut apart one of those AC to DC transformers of the appropriate voltage from an unused walkman or other piece of discarded electronics.
Step 5: Create the Mood
There’s a special age when children think they understand the world, but are not totally sure. To them, those long fangs might be real, the red substance in the cup could be human blood, and something actually may have escaped from the basement laboratory. Weave together a story just plausible enough that the kids will focus on whether you are being truthful or not. Once they’re off balance, scare them with something startling. I have had great success with simple, well timed, but unexpected things like the hiss of a fog machine, abruptly changing the lighting from red to strobe, and spraying a little bit of warm water. However, unless you are guiding the kids through, the display needs to be short and concise. Trick-or-treaters aren’t known for long attention spans, and you don’t want the next group arriving in the middle of your sequence and missing the fun.
Step 6: Create the Soundtrack
An easier way to get a pretty good soundtrack is to play two sound-effects discs from different stereos at the same time. In isolation, one Halloween sound-effect after another sounds stilted, but two reinforce each other to create the perfect mood.
Step 7: Write the Code
Step 8: Connect All the Devices
Step 9: Make It Come Alive
Step 10: Anecdote
Halloween seems to be one of the few holidays when it’s OK to be the weird guy on the street. I met more of my neighbors on Halloween than I had in the previous six months. Even though we lived in different worlds, we now had an easy conversation starter: “Have you started working on next year’s Halloween setup yet?” After a few years of haunted porches, families who had moved away would even bring their kids back to the neighborhood on Halloween.