November 23, 2024, 10:44:44 AM

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.


Drop Panel prop 1 Help

Started by Lindiur, October 11, 2009, 08:31:13 AM

Previous topic - Next topic

Lindiur

Having trouble with what should be a simple code. I have a couple of pillars to a graveyard entrance. In one of the pillars is an air pneumatic that drops down a panel to reveal a prop with light and sound. Using 20" double acting air cyclinder with 12vdc solenoid, PIR form EFX-TEK along with the Prop 1, The light is a Luxeon Star LED and the sound is a Cowlacious Car/300.

The thing is the air pneumatic must be on when the prop is off, supplying air to keep the panel up. When the PIR is triggered it should turn off the solenoid to let the panel drop, turn on the light and the sound for 10 seconds then the prop shuts down turning on the air to close the drop down panel and reset for the next victim.

How is it you do the opposite for the air solenoid keeping on then turning off when triggered.

Thank you for any help I can get

JonnyMac

Keep in mind that I ditched class the day they taught mind reading, so posting your [problematic] code is always a good idea.   ;D

I'm assuming that you have two separate valves to control the cylinder instead of a single 4-way valve (which would make things a little simpler).  Still, you can have two valves, you just need to activate one at power-up and leave it on until you get a trigger.  Here's a bit of demo code to illustrate what I mean.

' =========================================================================
'
'   File......
'   Purpose...
'   Author....
'   E-mail....
'   Started...
'   Updated... 11 OCT 2009
'
'   {$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 @ 12v

SYMBOL  Light           = PIN2
SYMBOL  DoorDown        = PIN1
SYMBOL  DoorUp          = PIN0


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

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000001                              ' start with door up (OUT0)
  DIRS = %00100111                              ' set output pins (1s)

  PAUSE 20000                                   ' PIR warm-up / delay


' -----[ 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

  DoorUp = IsOff
  DoorDown = IsOn
  PAUSE 100                                     ' let door drop

  CARP = IsOn                                   ' start audio
  PAUSE 50
  CARP = IsOff

  Light = IsOn
  PAUSE 10000                                   ' run for 10 seconds

  GOTO Reset


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


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


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

Lindiur

Jon thanks for the demo code. Could you write a program that uses just a normal valve. Please. I can't seem to get it. When the PIR is triggered i need it to turn the power to valve off for 10 seconds, dropping the cylinder with the weight of the door. Using 2 restrictors to regulate the flow of air. At the same time turn on the light and the carp/300 audio both for 10 seconds then shuting down and turning the power to valve back on to close the door. I can't figure out how the prop1 supplies continuous power then shut it off when triggered. Anyway Thanks for all your help

Lindiur

Great Thanks for the Help! I'll give it a test.

Lindiur

How do i have doorup in pin1 and doordown in pin2 there is only one solenoid. is there special wiring ?

JonnyMac

Don't connect anything to OUT1 (the door down control) -- when you release the door up control (OUT0) the door will drop via gravity.
Jon McPhalen
EFX-TEK Hollywood Office

Lindiur

Okay now I understand. Thanks for the explanation.