November 23, 2024, 10:10:13 AM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


New to Prop-1 Need Assist with Programming

Started by machtoo, June 11, 2012, 12:41:31 PM

Previous topic - Next topic

machtoo

I just purchased the Prop-1 and need to interface it with an Audio Troll from Hauntropolis.  My scenario is for a bottomless pit with a surprise for the victim.

I have a PIR that is triggering a relay that switches power  from primary lights in the pit with two 2-way  mirrors to a fast strobe in the bottom to reveal a set of bones and skull.  I want to use one set of contacts on the relay to trigger the Prop-1 and trigger the Prop-1 in two ways.

Situation 1
Victim looks in pit
PIR triggers a relay switching lights
Second set of relay contacts triggers Prop-1 with closed condition.
Prop-1 then should trigger audio track 1 on the troll from Prop-1 with a very brief closed/ground condition
Track 1 plays until scenario 2

Scenario 2
Victim walks away
PIR resets
Primary relay opens switching lights back to normal
Opening of second set of relay contacts should trigger Prop-1 (they were in closed position while PIR was activated)
Prop-1 then triggers second audio track on troll.

Can someone help with the programming?  Once I see how this works I am good at editing and tweaking the program.

There may be an easier way to do this with the Prop-1 only if it will work.  If I could connect a PIR to the Prop-1, trigger it to activate a relay to control the lighting and another Prop- 1 output to activate track 1 and then track 2 on the Audio Troll when the PIR resets.   If this can be done it is probably easier to control in the long run.

Thanks for any assistance!

Jeff Haas

It sounds like you have the following (correct me if I'm wrong):

- Prop-1
- PIR
- AudioTroll music player
- Relay #1, controlling primary lights
- Relay #2, controlling strobe light

It sounds like just one Prop-1 will work to control the entire show.  It can watch the PIR for motion then trigger the other devices. Here's the show I think you've described:

Show idle (waiting for viewer):
- Primary lights are on
- No sounds play 

Person looks into pit:
- Primary lights off
- Strobe light on
- Audio track #1 plays

Reset (person walks away):
- Strobe light off
- Primary light on
- Audio track #2 plays

Two things I'm not sure of:
- The Audio Troll seems to have an "ambient" track which you could use for background during show idle.  Is this in your plan?
- What is the audio track #2 for, when the person walks away?

Jeff

JonnyMac

Two things I'd ask:

1) Link to the audio player you want to use
2) Timing guidelines for your program; of course they'll change, so just estimate.
Jon McPhalen
EFX-TEK Hollywood Office

machtoo

June 11, 2012, 03:43:11 PM #3 Last Edit: June 11, 2012, 04:17:13 PM by machtoo
Thanks.  The ambient track is used. In your show idle, the ambient file is playing.  The first triggered track contains scary vocal track and a long sound effect filler to last longer than then the PIR reset time (the time a victim looks down the pit).  The second triggered track is a very short silence file that when played it returns to the ambient file.   There is just one DPDT relay...one set of contacts switching lighting power and the other set of contacts provide a normally open and normally closed cnonection. (on and off state).  The ambient file is a vocal teaser to get someone to look in.

The links to the audio player tracks 1 and 2 should look like momentary switches, normally open.  The troll triggers on momentary closure of 25 millisec or less.

Here is a piece of some sample code that can trigger the troll.

SYMBOL  Trigger         = PIN6  ' Trigger pin. Jumper SETUP = DN (PIN6 - PIN7)
SYMBOL  AudioTroll      = PIN0  ' Pin connected to AudioTroll (PIN0 - PIN7)


Main:

  OUTPUT AudioTroll   'Set the connected pin as an output
  INPUT  Trigger      'Set the connected pin as an input

  (need something to check trigger then execute the sequence below)

  HIGH AudioTroll                                ' trigger AudioTroll
  PAUSE 25
  LOW AudioTroll

   Would need two trigger checks one for initial look in the pit and one for the PIR reset (walk away).  One would trigger on the  PIR going high and one with the PIR going low.  Could possibly use one Prop-1 output with Trigger 1 (looking in pit) to drive a solid state relay to switch the 10v for the light circuits.  It would have to be a separate output from the two driving the troll since they are momentary.  The light relay output must remain energized during the track 1 playtime and switch off when the PIR resets.
   
So , I see 3 outputs needed...one to drive the light relay, one for track1 one on the Troll and one for track 2 on the troll.  Inputs are PIR high and low.  PIR will remain high as long as heat detected.

Relay 1 Out
Energized when PIR Input High  (victim looks in)
Released when PIR Input goes Low  (walk away)

Troll 1 Out
Momentary closure when PIR goes high.

Troll 2 Out
Momentary closure when PIR goes low.

Hope this makes sense.

JonnyMac

Sorry, what I meant by link is a URL of the product data sheet so I can understand how it works and give you the best interface between the Prop-1 and the device.  Sometimes relays are not required.
Jon McPhalen
EFX-TEK Hollywood Office

machtoo

June 12, 2012, 07:02:20 AM #5 Last Edit: June 12, 2012, 07:09:19 AM by machtoo
Here is the vendor link.

http://www.hauntropolis.com/audiotroll_usb.html

The device interface is pretty straightforward.  The trigger inputs are designed for very brief "pushbutton" like actions between the Trigger connections and Ground.

The device plays an ambient mp3 constantly unless a triggerable track is initiated by the "pushbutton" , momentary grounding action.  The "low" trigger signal should be 25 millisecs or so, otherwise it will not detect the trigger.  Would be easier if the trigger inputs detected state (hi, low) but they don't.  I've been in conversation with the designer, Michael Stragey.  He provided the sample Pbasic code in my previous post.

This is what Michael said in a recent email:  Here is sample code for an actual pushbutton operation.
It is set up to have OUT6 screw terminal of the Prop-1 connect through a pushbutton switch to GND terminal (to trigger the show) and one wire from OUT0 screw terminal of the Prop-1 going to one of the TRIG screw terminals of the AudioTroll. You will also need to attach a wire from the GND of the Prop-1 to the GND of the AudioTroll. The code essentially just grounds the TRIG terminal for just 25 milliseconds.


I want the Prop-1 to act as the "pushbuttons" on Triggers 1 and 2 on the Troll.

Based on the Prop-1 documentation, I think it should be able to perform the scenarios at the end of the post above.  I will need to use a relay controlled by the Prop-1 for the lighting control circuit as they are 110v A/C. 

Thanks.  Let me know of you need anything else.

bsnut

June 12, 2012, 07:33:10 AM #6 Last Edit: June 14, 2012, 11:26:35 PM by bsnut
machtoo welcome to the forums.

Here's a basic program that should get you started based on the information that you provided. Remember that your show timing will need to be changed based on your audio track that you have and can be changed here in the "Constants" section

SYMBOL showdelay        = 120                   'set "showdelay" here and is
                                                'set in seconds

of the program which is based on 1000ms (1 second) delay in the FOR..NEXT loop.

' =========================================================================
'
'   File...... bottomlesspit.bs1
'   Purpose... To Control a Bottomless Pit prop
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Trigger         = PIN6                  ' SETUP = DN "PIR"
SYMBOL  Lightrelay      = 0                     ' Light Relay
SYMBOL  AudioTroll1     = 1                     ' Sound trigger for sound track 1
SYMBOL  AudioTroll2     = 2                     ' Sound trigger for sound track 2

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

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

SYMBOL showdelay        = 120                   'set "showdelay" here and is
                                                'set in seconds

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

SYMBOL  timer           = B2
SYMBOL  showtimer       = w6                    ' Delay variable for the show

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

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

  PAUSE 30000                                   ' PIR warmup delay

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

Main:
  timer = 0                                     ' reset timer

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 200 THEN Check_Trigger             ' wait for 0.2 sec input

Pit_Show_Start:
  HIGH Lightrelay
  HIGH AudioTroll1                   ' audio player trigger 1 connected on OUT1
  PAUSE 25                           ' delay for triggering audio player
  LOW AudioTroll1

Pit_Show:
  FOR showtimer = 0 TO showdelay
    PAUSE 1000
    IF Trigger = IsOff THEN Walk_Away
  NEXT

Walk_Away:
  LOW Lightrelay
  HIGH AudioTroll2                 ' audio player trigger 2 connected on OUT2
  PAUSE 25
  LOW AudioTroll2
  GOTO Main


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


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


' -----[ User Data ]-------------------------------------------------------
William Stefan
The Basic Stamp Nut

machtoo

Thanks, I'll experiment with this and see how it goes.

machtoo

BSNUT,

How can I add an adjustable delay between the PIR going high and having i fire the relay output?  I want the victim to look in the well for a few seconds before the surprise gets triggered.

Thanks,
Dean

machtoo

BSNUT,

After following the logic and tweaked a coupl of things.  See if this makes sense.  I changed the Pit_Show loop to look for the PIR to go off then exit.  If it is still on (someone looking in) I looped back to Pit_Show.

Also, I added a  delay in the Pit_Show_Start after the PIR goes high to allow about 3 seconds of delay before the surprise (Pit_Show) hits.
I think this will work.  Let me know.

                         ' =========================================================================
'
'   File...... bottomlesspit.bs1
'   Purpose... To Control a Bottomless Pit prop
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Trigger         = PIN6                      ' SETUP = DN "PIR"
SYMBOL  Lightrelay      = PIN0                  ' Light Relay
SYMBOL  AudioTroll1     = PIN1                  ' Sound trigger for sound track 1
SYMBOL  AudioTroll2     = PIN2                  ' Sound trigger for sound track 2


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

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0
SYMBOL ScanDelay        = 10                    '10 ms scan delay
SYMBOL showdelay        = 120                   'set "showdelay" here and is
                                                'set in seconds

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

SYMBOL  timer           = B2
SYMBOL  showtimer       = W6                    ' Delay variable for the show
SYMBOL pirTimer         = B2                    ' for debouncing

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

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

  PAUSE 30000                                   ' PIR warmup delay

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

Main:
  timer = 0                                     ' reset timer


Check_Trigger:
  PAUSE ScanDelay
  pirTimer = pirTimer + ScanDelay * Trigger     ' advance/clear timer
  IF pirTimer < 250 THEN Check_Trigger

Pit_Show_Start:
  PAUSE 3000                         ' Pause 3 seconds while victim looks down pit
  HIGH Lightrelay                    ' Switch to bottom strobe
  HIGH AudioTroll1                   ' audio player trigger 1 connected on OUT1
  PAUSE 25                           ' delay for triggering audio player
  LOW AudioTroll1

Pit_Show:
    IF Trigger = IsOn THEN Pit_Show
    IF Trigger = IsOff THEN Walk_Away
    NEXT

Walk_Away:
  LOW Lightrelay
  HIGH AudioTroll2                 ' audio player trigger 2 connected on OUT2
  PAUSE 25
  LOW AudioTroll2
  GOTO Main

JackMan

Couple of things wrong that I see right off the bat.
In the I/O definitions you can't use PINx with HIGH/LOW commands, change the definitions to just the number.
In Pit_Show: the 3rd line has a NEXT that is wrong, delete it. You can also delete the 2nd line of Pit_Show: it isn't needed. If the trigger isn't ON the code will automatically proceed to the next line.



machtoo

Thanks Jack.  I believe I caught your edits in the update.

                         ' =========================================================================
'
'   File...... bottomlesspit.bs1
'   Purpose... To Control a Bottomless Pit prop
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Trigger         = 6                      ' SETUP = DN "PIR"
SYMBOL  Lightrelay      = 0                  ' Light Relay
SYMBOL  AudioTroll1     = 1                  ' Sound trigger for sound track 1
SYMBOL  AudioTroll2     = 2                  ' Sound trigger for sound track 2


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

SYMBOL  IsOn            = 1                     ' for active-high in/out
SYMBOL  IsOff           = 0
SYMBOL ScanDelay        = 10                    '10 ms scan delay
SYMBOL showdelay        = 120                   'set "showdelay" here and is
                                                'set in seconds

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

SYMBOL  timer           = B2
SYMBOL  showtimer       = W6                    ' Delay variable for the show
SYMBOL pirTimer         = B2                    ' for debouncing

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

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

  PAUSE 30000                                   ' PIR warmup delay

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

Main:
  timer = 0                                     ' reset timer


Check_Trigger:
  PAUSE ScanDelay
  pirTimer = pirTimer + ScanDelay * Trigger     ' advance/clear timer
  IF pirTimer < 250 THEN Check_Trigger

Pit_Show_Start:
  PAUSE 3000                         ' Pause 3 seconds while victim looks down pit
  HIGH Lightrelay                    ' Switch to bottom strobe
  HIGH AudioTroll1                   ' audio player trigger 1 connected on OUT1
  PAUSE 25                           ' delay for triggering audio player
  LOW AudioTroll1

Pit_Show:
    IF Trigger = IsOn THEN Pit_Show

Walk_Away:
  LOW Lightrelay
  HIGH AudioTroll2                 ' audio player trigger 2 connected on OUT2
  PAUSE 25
  LOW AudioTroll2
  GOTO Main

JackMan

You want to leave the I/O definition for trigger like it was, PIN6. Go here for Jon's explaination on this topic.
http://www.efx-tek.com/php/smf/index.php?topic=1773.0

bsnut

June 12, 2012, 05:38:13 PM #13 Last Edit: June 12, 2012, 05:41:42 PM by bsnut
Thanks Jack for catching my mistake. I should've known.

Dean, here's the corrected program.


' =========================================================================
'
'   File...... bottomlesspit.bs1
'   Purpose... To Control a Bottomless Pit prop
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  Lightrelay      = 0                  ' Light Relay
SYMBOL  AudioTroll1     = 1                  ' Sound trigger for sound track 1
SYMBOL  AudioTroll2     = 2                  ' Sound trigger for sound track 2

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

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




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

SYMBOL  timer           = B2


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

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

  PAUSE 30000                                   ' PIR warmup delay

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

Main:
  timer = 0                                     ' reset timer

Check_Trigger:
  PAUSE 5                                       ' loop pad
  timer = timer + 5 * Trigger                   ' update timer
  IF timer < 200 THEN Check_Trigger             ' wait for 0.2 sec input

  Pit_Show_Start:
  PAUSE 3000                         ' Pause 3 seconds while victim looks down pit
  HIGH Lightrelay                    ' Switch to bottom strobe
  HIGH AudioTroll1                   ' audio player trigger 1 connected on OUT1
  PAUSE 25                           ' delay for triggering audio player
  LOW AudioTroll1

Pit_Show:
    IF Trigger = IsOn THEN Pit_Show
    IF Trigger = IsOff THEN Walk_Away


Walk_Away:
  LOW Lightrelay
  HIGH AudioTroll2                 ' audio player trigger 2 connected on OUT2
  PAUSE 25
  LOW AudioTroll2
  GOTO Main

  GOTO Main


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


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


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


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


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


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


' -----[ User Data ]-------------------------------------------------------
William Stefan
The Basic Stamp Nut

machtoo

Great team effort! Thanks for the tips and assist.  I will hook it up first without anything attached but the PIR and take measurements on the outputs.  I'll cross my fingers.  It has been a few years since I had to program anything.  I may have to adapt Prop-1's to several other props in my large Halloween display.