November 23, 2024, 12:40:12 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.


Can this be done with just the Prop-1 controller?

Started by CraigN, September 24, 2009, 07:31:18 PM

Previous topic - Next topic

CraigN

I would like help to create the following prop-1 script. 

I want my prop to complete the following steps in a program.

Parallax PIR triggers Prop-1 to run program.

1) trigger 12 vdc air solenoid to air cylinder to open door of prop, hold for 30-60 seconds
2) while holding door open send command to trigger audio device (Cowlacious car/p300 audio board and ST-200 for talking skull), possibly trigger to turn on 12 vdc light
3) run audio program, wait 5 seconds, turn off light and trigger air valve to close door.
4) reset after 60-120 seconds.

I am planning on keeping everything 12 vdc for safety.  120 volt ac = bad.

Second question is will I need a separate relay board for this or can the prop-1 handle it?

I am an expert of limited experience.

Any suggestions would be appreciated.

Happy Haunting!




JonnyMac

Here you go.  Be sure to read about PAUSE in the help file so you can fine-tune the timing elements for the prop.  For the light output I would use a 12v LED car replacement bulb, you can get them at any auto store.  They are very bright, come in colors (red, yellow, white), and don't draw much current (worst I've seen is < 100ma) so you can connect them right to the Prop-1 outputs.

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


' -----[ Program Description ]---------------------------------------------
'
' Trigger :: Parallax-compatible PIR or N.O. button (mat switch, etc.)
'            -- connect N.O. button between P6.W and P6.R


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


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

SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  CARP            = PIN5                  ' V+/OUT5 to V-Trig
SYMBOL  Light           = PIN1                  ' V+/OUT1
SYMBOL  Doors           = PIN0                  ' V+/OUT0


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

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

SYMBOL  IsOpen          = 1
SYMBOL  IsClosed        = 0

SYMBOL  Yes             = 1
SYMBOL  No              = 0

SYMBOL  Baud            = OT2400                ' B/R jumper removed


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all
  DIRS = %00100011                              ' set output pins

  PAUSE 30000                                   ' let PIR warmp-up


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

Main:
  timer = 0                                     ' reset timer

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

  Doors = IsOpen
  PAUSE 1000                                    ' let doors fully open

  Light = IsOn
  PAUSE 500

Start_Audio:
  CARP = IsOn
  PAUSE 50
  CARP = IsOff

  PAUSE 30000                                   ' adjust for audio + 5s (5000)

  Light = IsOff
  PAUSE 500                                     ' dramatic pause
  Doors = IsClosed

Show_Delay:
  PAUSE 30000                                   ' 30s + 30s = 1min
  GOTO Reset


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


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


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

CraigN

Thank you so much for your help.

The timing could not be better as the prop-1 was delivered today.

I will experiment with the script and let you know if I have any questions.

Happy Haunting!

CraigN

Thanks for you help with the script. It works great and is very easy to modify.  My head is spinning with the possibilities.  ;D

New question - if I wanted to add a 12 vdc wiper motor to the prop-1; would I connect the dc power wires to the terminal block output on the prop-1 or would I have to use a relay?

I am assuming that the outputs are N/O contacts and that when the prop-1 sends the command to the terminal block it completes the circuit(?) so in theory I would complete the circuit on the DC side of the power supply and start the motor turning?

Trying not to let the magic smoke out of the prop-1 on my first time out.

Thanks!

livinlowe

Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

Thank you, Doug -- I'm glad someone is reading and following our forum rules.

Craig: Please don't violate the one-topic-per-thread rule again, otherwise I can get pretty nasty:



;D

In all seriousness, this time of year gets busy and I don't want a mess made of our forums.  Thanks for understanding.
Jon McPhalen
EFX-TEK Hollywood Office