I'll show you how to make a replacement for the standard remote that you can control with any microcontroller (Basic Stamp, Arduino, Picaxe, EFX-Tek Prop-1, etc.) I'm going to assume you know how to program and connect your microcontroller. This Instructable is about making the control box for the fog machine.
You could just use a motion sensor and a microcontroller to blast kids with fog as they came up to get candy, but this also lets you incorporate the fog machine into a more elaborate scene...trigger a sound effect, a light, or a moving prop, and include a blast of fog as well.
Step 1: Parts and Tools
1x 5V Relay Module – www.dx.com SKU: 157153
1x IEC extension cable – this will connect to your fog machine.
1x Project box - comes with screws to hold it closed in a small plastic bag. Jameco Part no. 675462
1x Stereo plug Jameco Part no. 231176
1x Stereo jack Jameco Part no. 2095437
4x Screws 4-40, 1/2”
4x Nuts 4-40
1x 1” piece of plastic tubing, ¼” outside diameter, for stand-offs
1x Servo extension cable – connects the relay to the stereo jack
1x 3-wire cable – connects the stereo plug to the controller, 12” or more if needed
1x zip tie
Heat shrink tubing
The parts list is attached as a handy Excel file, with part numbers and websites. You can substitute similar parts for many of these.
• Soldering iron
• "Helping Hands". You can make one yourself, check these out:
• Wire clippers
• Wire strippers
• Small flat blade screwdriver
• Small Phillips screwdriver
• Small needle-nosed pliers
• Hot Glue gun and sticks
• Exacto knife and something to cut on (small board, etc)
• The remote from your fog machine
• Power drill with assorted bits
• Hot air gun or hair dryer (for heat shrink tubing)
Step 2: Overview
Why am I taking this much trouble on this project? It’s because the remote control that comes with these foggers has line voltage running through it. Now this is standard, many hand-held household appliances work this way (hair dryers, steam irons, etc.) but since we’re going to use this where it’s out of sight, at night, I wanted to make things as safe as possible. So we’re sealing the relay inside a small box and using hot glue to keep water from getting in.
About the relay: When I wrote this, these pre-made relay boards had become pretty common and were available from a lot of different vendors, ready to connect to your favorite microcontroller. The one I picked has a feature called “optoisolation” which means that the high voltage is electrically isolated from any wires going back to your microcontroller. (See Wikipedia for a big article.) If you can’t get this exact module, I suggest you order what you can with the same features and then find a project box to fit it.
Step 3: Preparing the Project Box
Relay – Notice in the picture that the relay isn’t dead center in the project box, but it’s over to the side a bit. This allows space for the stereo jack and the wires. Hold the relay in place and mark the holes for the standoffs with a pointed object in the bottom of the box. Then drill holes using a 7/64” drill bit (this is just right for 4-40 screws).
IEC cord – Drill a hole with a 5/16” bit in the side wall. This is on the right in the picture above.
Stereo jack – This is a bit tricky, the only jacks I could find didn’t have a long neck. So I drilled a hole for the neck and then counter-sunk a slightly wider hole partway into the plastic for the nut on the neck. I used a stepped drill bit and went in just enough so there was room for the nut. See picture.
Step 4: Color-code the Wires, and Check the Relay
The connections in the next few steps follow those colors, and this makes it easy to hook up to your microcontroller (and troubleshoot if necessary). But…check the connections on the relay. If you look closely at the picture, you’ll see that this specific relay board does NOT follow the pattern that the red/black/white wires do! I had to use a very small screwdriver to pry up the fingers on one end of the servo connector for red and black, pull them out, and swap their positions. Then cut the servo connector wire so you have about 3” of wire extending from the plug.
Now it’s time to solder. There are only six connections to solder but they can be kind of finicky.
Step 5: Solder the Stereo Plug
When you're done, test the connections: Use the multitester to check for shorting between wires, and to check the wires connect to the right parts of the plug. Use pliers & crimp the wings on the black lug lightly around the wires. Make sure you don’t short any parts of the plug together.
Step 6: Solder the Stereo Jack
Step 7: Test the Connections
When you’re satisfied it’s all correct, put the plastic sleeve back onto the stereo plug, and hit the heat shrink tubing with hot air to insulate the connections.
Step 8: Make the Standoffs
Using the Exacto knife, cut the small section of plastic tube in half. Then cut each half in half again, so you have four short pieces the same length.
Step 9: Install the Relay Into the Project Box
- Project box
- Screws (4-40, ½ inch long) (These are NOT the screws used to hold the project box lid in place.)
- Nuts (4-40)
- Plastic tube sections
Put the screws into the holes on the relay board, and then thread the plastic tube sections onto the screws.
Now here’s the eye-hand coordination part: Push the screws through the holes in the bottom of the project box (without losing the plastic tubes!) Make sure you orient the relay the right way, so the screw terminals face the big hole for the IEC cable.
When they’re through the holes in the bottom, put the nuts on the ends of the screws and tighten. If the screws don’t stick out far enough, you may need to trim the plastic tube sections a bit.
Step 10: Screw in the Stereo Jack
Step 11: Plug the Rectangular Servo Connector Into the Relay Board
Red – VCC
Black – GND
White – IN
Again, you may need to swap the connectors so the colors match.
Step 12: Testing
Most relay modules have an LED that shows it’s getting power from the microcontroller, and another LED to show that the relay is activated (along with a “click” when it’s on). It’s easy to connect to your microcontroller: Black to GND, Red to 5V, White to the pin.
If your microcontroller can turn the relay on and off, you've finished the first half. Now to test and wire up the connection to the fog machine.
Step 13: Test Your Fog Machine Remote
Look at the end of the cable which plugs into your fog machine, and verify which parts of the plug are connected to the switch. One person can hold the multitester leads to the connections while another can press the button on the remote. Tip: Hold your multitester leads like chopsticks with one hand; use the other hand to hold the plug. Touch the ends to the prongs of the plug, and have someone press the button. Only two of the prongs should show a connection when the button on the remote is pressed.
Step 14: Prep the Fog Machine Cable
Strip the wires. Then test the connections so that you know which colors of wire in your cable connect to the switch, using what you just learned. In the cable I used, these were Yellow/Green and Blue wires, while the Black one wasn’t needed. Cut that one off.
Step 15: Connect the Fog Machine Cable, Then Test It
Then test it with the fog machine. This is the last electrical connection! You previously verified that you could trigger the relay with your microcontroller. You can now plug the cable into your fog machine and try triggering it with your microcontroller.
A blast of fog = success!
Step 16: Close It Up!
Hot Glue everything. Now that it’s all working, we want to make sure everything stays in place and water can’t get in. Put a blob of hot glue on the following (marked by red arrows in the picture):
a. Stereo jack, so it doesn’t turn.
b. Standoffs under the relay, so they don’t unscrew.
c. Servo connector where it plugs into the relay, so it can’t come out (unlikely, but why not?)
d. IEC cable to the fog machine. Use a LOT where it comes inside the box – we want to make sure water can’t come in. Put some around the outside, too – make a little “collar”.
Finally, put the top on and use the little bag of four screws to screw it closed.
Step 17: Connecting to a Prop Controller
Black = GND
Red = 5V
White = Signal (the pin on the controller that will trigger the relay)
The basic code is very simple. The white wire goes to one of the output pins on the microcontroller. Drive that pin HIGH for two or three seconds when you want a blast of fog.
The zip file attached includes example code for EFX-Tek Prop-1 (Basic Stamp 1), and Arduino.
The Basic Stamp code is a demo, just to show how a button press will tell the microcontroller to trigger the fog machine.
The Arduino code is written to respond to a PIR motion sensor, and then to control three relays, so it acts like a "Three-Stage Timer". It's good for controlling a bunch of things that go off together.