If you are like me you have probably seen those timer modules for your smoke machine at the Halloween store and thought "$40!?! I could probably just build one of these with an Arduino!" Well here is how you do it...
Plus, with the flexibility of the Arduino you can do some things that is just possible or easily done with the store bought unit like controlling multiple fog machines, triggering your fog with other props or motion sensors, increasing the maximum delay limits, synchronizing lights, etc... the possibilities are endless once you take control.
One of the reasons I like using the Arduino for projects like this is that it is not a unitasker. I only need to control my fog machines a few times a year. The rest of the year I am free to use my $22 microcontroller in other projects. The store bought timer would just sit in a box in the attic all year long :(
Step 1: Parts List
Step 2: "Hacking" the Fog Machine
This is very easy and does not require you to open or tinker on the machine at all.
The controllers connect to these machine via a IEC-320 C14 Power Connector. This is the same type of connector that is used on the A/C power cord for desktop computers. Many of us have these cords lying around, unfortunately, they are no use to us here as the connectors on these cords are the wrong gender. So just grab a MALE connector from Amazon or Ebay (link above)
These connectors have 3 pins. The middle pin is ground on all machines. The other two are:
- The Activation Trigger
Unfortunately, The position of these two pins are not the same for all brands of machine. Check the included image to determine which pin is the trigger pin for your machine. Note that the Power pin carries household voltage (110v here in the US). Take caution not to touch this pin. There is no need to mess with it. Leave it alone!
To confirm which pin is the trigger pin on your machine. First consult the image here. Then warm up your machine and short this pin to the middle ground pin with a bit of spare wire. Make sure you are holding the wire by its insulation to avoid shock. When you ground the trigger pin the machine should begin to pump smoke. If you ground the wrong pin (power) you will probably get a spark and the machine will not smoke. Dont worry this quick test will not hurt the machine or you (if you are only touching the insulation on your test wire).
Now that we know which are the trigger and the ground pins all we need to do is create a custom cord so we can connect it to the Relay Module.
Make a cord using some 18 gauge wire and the IEC-320 C14 Male Power Connector at whatever length is appropriate for your application.
The other end of this cord will be connected to the Relay Module. Once you do this you will have a switching mechanism that can trigger the smoke cycle of your machine. You can connect any 5 volt signal source to the relay to trigger it: a motion sensor, a store bought prop, or a customizable microcontroller (aka our Arduino)
Step 3: The Controls
Now to build a control panel using a breadboard or protoboard
Connect the Relay Module to the Arduino. There are 3 connections to connect: 5v, ground & signal. Connect the signal to input #13.
Note: If you have a specific application with specific timings you could skip the rest of this step. Modify the code to 'hard code' your timing values and simply connect the Arduino to the relay and you are Done! (This is actually how I started this project myself.)
Timing Controls: Connect the middle connection of each of the two potentiometers to the A0 and A1 Arduino inputs and one of the outer connections to 5v on the Arduino. A0 will be the smoke/fog duration setting control: how long the relay is closed and make the machine smoke. A1 will be the delay time setting control.
You could be done at this point. You now have all you need for a controllable timer. These last controls will add a Pause Switch and a Smoke Now!Button
Pause Switch: When closed this switch will pause the timers and prevent the machine from smoking. Connect a latching switch (one that stays open/closed when you activate it) between input #11 and 5v on the Arduino
Smoke Now! Button: when closed this button will make the machine smoke regardless ignoring the delay timers. Connect a momentary button (one that is only on while you press it) between input #12 and 5v on the Arduino
Step 4: The Arduino Code
The code is relatively simple and does not require any additional libraries.
Simply download it from here and upload it to your Arduino
Look for the #defines at the top of the file if you want to adjust the timer Min/Max limits
- FOG_TIME_MIN & FOG_TIME_MAX controls the duration of the smoke burst.
- REHEAT_DELAY_MIN &REHEAT_DELAY_MAX controls the duration of delay between smoke bursts.
Step 5: Enjoy!
You have now have a fully capable smoke machine controller that can do what that store bought controller does but is much more flexible. Connect it up to your smoke machine and get smoking!
Some Ideas on extending the project:
- Add several relays to control multiple fog machines. Make 3 fire at once for a huge amount of smoke or round robin them to get a contant stream without waiting for reheat cycles.
- Use the Arduino to control other props and/or lights in synchronization with your smoke
- Add WiFi control using ESP2866 based development board in place of the Arduino. With just a bit more code you could control your smoke machine from your mobile phone