November 23, 2024, 07:55:49 PM

News:

Be sure to checkout our Vixen interfaces in the Library forum -- if you want PC automation at near zero cost, EFX-TEK and Vixen is a great combination of tools.


Laser Vortex and Fog Machine Program

Started by cs1245, October 03, 2010, 02:09:36 AM

Previous topic - Next topic

cs1245


     I am looking for a program to run on a Prop-1 to turn on both a laser beam and a fog machine.  I will utilizing 120V to run the fog machine.  I will also be running the 120 voltage through a bench top power supply dropping it to a 3V output which will power the laser beam.  I will hotwire the fog machine to be "on" all the time until a 12VDC relay is triggered by the Prop-1.  There will be a 12VDC relay that when triggered by the Prop-1 that will turn on the laser beam.  The prop-1 will be not be triggered by a mat or a PIR sensor, but I want it to run a repeated cycle measured in seconds.  It takes 3 minutes and 25 seconds for the fog machine (when plugged in for the first time) to be able to be triggered.  Next, turn the laser beam on 1 second before the fog machine is triggered. The laser beam will stay on for 2 min 45 sec.  Then run the fog machine for 5 seconds every 15 seconds for a max time of 2min 45 seconds.  In other words, fog for 5 sec, off for 10sec, fog for 5 seconds, off for 10 sec and repeat this for 2min 30 sec.  So the last time the fog machine will turn on for 5 secs is at 2min 30 sec and then at 2min 44 sec turn off the fog machine and at 2 min 45 sec turn off the laser beam.  The prop delay will be 1 min and 25 sec which is the amount of time it takes for the fog machine to be able to be triggered again. 




bsnut

October 03, 2010, 06:31:30 AM #1 Last Edit: October 03, 2010, 06:40:14 AM by bsnut
It doesn't seem to be a problem to program. I need to point out one thing and that is.

When, I write your program or someone else writes one for you, the code for the fog machine warm up delay will run again when you power down or reset the Prop1, because of the RAM on the Prop1 clears it's contents back 0. This means, you will have to wait out the 3 minute and 25 second warm up delay all over again and I don't think you want to wait it out again. It also takes away the realism of your display.    

The only way around this issue, is you can add a extra push button or switch that, will let the Prop1 know that the fog machine has warmed up. This way, you don't have to wait out the 3 minute and 25 second warm up delay after you have pushed reset button on the Prop1 or have powered down the Prop1 for a few minutes and their is no need to wait for the fog machine to warm up.  
William Stefan
The Basic Stamp Nut

JonnyMac

I'm confused... you want the Prop-1 to control the power to the fog machine?  Why not just plug it in and control the remote?  We do this a lot.

Also, you could skip the bench-top supply and run the laser directly from the Prop-1.  3v regulators are easy to come by now and you would whip up a circuit very easily.
Jon McPhalen
EFX-TEK Hollywood Office

JonnyMac

QuoteSo the last time the fog machine will turn on for 5 secs is at 2min 30 sec and then at 2min 44 sec turn off the fog machine and at 2 min 45 sec turn off the laser beam.

There is a contradiction here.  The first part says "last time the fog machine will turn on for 5 secs is at 2min 30 sec" but then the latter part says "at 2min 44 sec turn off the fog machine."  If you turn the fog machine on at 2:30 and off at 2:44 that's a 14-second run, not 5.  Which is it?
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

Quote from: JonnyMac on October 03, 2010, 06:50:30 AM
I'm confused... you want the Prop-1 to control the power to the fog machine?  Why not just plug it in and control the remote?  We do this a lot.

I dont want to have to stand on sidewalk and hit the remote button to trigger the fog machine.

Also, you could skip the bench-top supply and run the laser directly from the Prop-1.  3v regulators are easy to come by now and you would whip up a circuit very easily.

I am very comfortable with hacking into a $5 computer ATX power supply and I dont know anything about 3V regulators.  With regards to running the laser directly to the to Prop-1 the voltage
I got on my multimeter exiting the Prop-1 is just over 11V and that will burn out the laser because the maximum voltage of the laser is 3V.  I have learned this lesson the hard way last year when
using a voltage higher than manufacturer recommends.

Quote from: JonnyMac on October 03, 2010, 08:04:03 AM
QuoteSo the last time the fog machine will turn on for 5 secs is at 2min 30 sec and then at 2min 44 sec turn off the fog machine and at 2 min 45 sec turn off the laser beam.

There is a contradiction here.  The first part says "last time the fog machine will turn on for 5 secs is at 2min 30 sec" but then the latter part says "at 2min 44 sec turn off the fog machine."  If you turn the fog machine on at 2:30 and off at 2:44 that's a 14-second run, not 5.  Which is it?
Let me clarify.  It should be a 5 sec run on the fog machine starting at 2 min 30sec with the laser beam turning off at 2min 45 sec.  At 2min 37secs the fog machine becomes unable to fire smoke and I thought it would be simpler to just make the time off the for fog at 2min 44 and off time for laser at 2 min 45sec, but throughout the program the smoke will be only for 5 sec bursts. 

Quote from: bsnut on October 03, 2010, 06:31:30 AM
It doesn't seem to be a problem to program. I need to point out one thing and that is.

When, I write your program or someone else writes one for you, the code for the fog machine warm up delay will run again when you power down or reset the Prop1, because of the RAM on the Prop1 clears it's contents back 0. This means, you will have to wait out the 3 minute and 25 second warm up delay all over again and I don't think you want to wait it out again. It also takes away the realism of your display.   

Bsnut - how would I wire in and connect the push button/switch that would let the Prop-1 know that the fog machine is ready to be fired.  Or could I plug in the fog machine first and when it is ready to be fired, then turn on the Prop-1 quickly and then change the BASIC stamp program to turn laser on then 1 sec later start the cycles of 5 sec on the fog machine and 10 sec off instead of the 3min 25 sec delay?


JonnyMac

You would need to know how much current the laser diode requires; from there it is a simple task to calculate a series resistor value -- much easier than hacking an ATX power supply into the works (that requires a relay between it and the Prop-1 for control). 

Since each of the cycles is 5-on, 10-off the program can be simplified in a loop.  This code should be easy to fine-tune as you desire.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------


' -----[ Revision History ]------------------------------------------------


' -----[ I/O Definitions ]-------------------------------------------------

SYMBOL  Sio             = 7                     ' SETUP = UP; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN

SYMBOL  Fogger          = PIN2                  ' controls remote
SYMBOL  Laser           = PIN0                  ' to relay or diect control


' -----[ Constants ]-------------------------------------------------------

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0


' -----[ Variables ]-------------------------------------------------------

SYMBOL  idx             = B2
SYMBOL  seconds         = W5


' -----[ Initialization ]--------------------------------------------------

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00111111                              ' make P0-P5 outputs


' -----[ Program Code ]----------------------------------------------------


Warm_Up:
  seconds = 3 * 60 + 25                         ' 3:25
  GOSUB Wait_Secs


Main:
  Laser = IsOn
  seconds = 1
  GOSUB Wait_Secs

  FOR idx = 1 TO 11                             ' 11 x 15 = 150 (2:45)
    Fogger = IsOn
    seconds = 5
    GOSUB Wait_Secs
    Fogger = IsOff
    seconds = 10
    GOSUB Wait_Secs
  NEXT

  Laser = IsOff


Re_Warm:
  seconds = 1 * 60 + 25                         ' 1:25
  GOSUB Wait_Secs
  GOTO Main


' -----[ Subroutines ]-----------------------------------------------------

Wait_Secs:
  IF seconds = 0 THEN WS_Exit                   ' if done, exit
    PAUSE 1000                                  ' hold 1 second
    seconds = seconds - 1                       ' update count
    GOTO Wait_Secs

WS_Exit:
  RETURN

' -------------------------------------------------------------------------


' -----[ User Data ]-------------------------------------------------------
Jon McPhalen
EFX-TEK Hollywood Office

JackMan

October 03, 2010, 02:51:01 PM #6 Last Edit: October 03, 2010, 02:56:17 PM by JackMan
 
Quotehow would I wire in and connect the push button/switch that would let the Prop-1 know that the fog machine is ready to be fired.  Or could I plug in the fog machine first and when it is ready to be fired, then turn on the Prop-1 quickly and then change the BASIC stamp program to turn laser on then 1 sec later start the cycles of 5 sec on the fog machine and 10 sec off instead of the 3min 25 sec delay?

cs1245 ,
    With Jon's program you would turn on your Fog Machine and the Prop-1 at the same time.

Radiowave911

Quotehow would I wire in and connect the push button/switch that would let the Prop-1 know that the fog machine is ready to be fired.

I needed to control a smoke machine from a PROP-1 for my Volcano project.  I whipped up a circuit using a couple of relays, a resistor, and a 'repurposed' power cord extension.

First, a word of caution is in order - the following deals with 120V AC power, which can be dangerous if you are not careful.  All connections to/from the fog machine must be insulated.  If you have a different remote on your fog machine, do not attempt this without knowing how the remote works and what the signal levels are.  Soldering skills are necessary to do this. 

All parts are available at Radio Shack, if you are in a hurry and don't have time to place an order with a parts house like Digi-Key, Mouser, Allied, Jameco, etc.

I found that the female connector on my smoke machine is a standard IEC connector (the same one that is on most computer power cords).  I took a cable that had an IEC male on one and and a female on the other and removed the female connector.  This left me with a male connector and cable.  The male fit my smoke machine perfectly.  I opened up the remote that came with the machine and determined that the connections were as follows:

The 'Ground' (Typically green wire in N. America) pin on the IEC is the common lead.
The 'Hot' (Typically black wire in N. America) pin is the 'ready' output from the smoke machine (120V between this lead and common when the smoke machine is up to temperature)
The 'Neutral' (Typically white wire in N. America) pin is the 'trigger' to the smoke machine - connecting this pin to the common pin causes smoke to be produced.

I connected the coil of a relay (coil rated for 120VAC) between the ready and common leads.  One normally open contact on the relay is connected to an input pin on the prop-1, the common contact is connected to the prop-1 +V.  A resistor can also be attached between the input pin and ground, if you get random erroneous inputs on the pin (not sure off hand if the prop-1 includes pull down resistors or not on all pins).  A value of 1k should be sufficient here.

I connected the coil of a second relay (coil rated for 12VDC) between one of the ULN outputs on the PROP-1 and +V, with a resistor (1k, I believe) between the same output pin and +V.  The normally open and common contacts of this relay were connected to the smoke machine trigger and common leads, respectively.  Make sure the contact rating on this relay is capable of handling 120VAC.

I used a small piece of perfboard for the 12V relay.  The other one is mounted to a chassis mount socket that was mounted to the plastic project box I enclosed the entire thing in, for safety.

Good luck!