November 22, 2024, 08:38:02 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.


rocking room

Started by haunter1986, October 18, 2007, 01:51:44 PM

Previous topic - Next topic

haunter1986

I have a room in a haunted house, that I need a Prop1 to control. I need the prop1 to control a 12 volt dc/ 110 ac volt relay for switching the soleniods, between the air intake and exhaust for the pnuematic cyclinders. I want the prop1 to turn the relay on for 4 seconds and then turn off for 4 seconds, using out0 and continually repeat this cycle. I will not be using a trigger or pir. i need it to just keep on repeating it self.        

JonnyMac

This one falls under the category of "I could do that blind-folded with my hands tied behind my back and bad music blaring in the background."   ;D

' =========================================================================
'
'   File...... EZ_Rocker.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Relay           = PIN0                  ' connect to V+/OUT0


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

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


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



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

Reset:
  DIRS = %00000001                              ' make P0 an output


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

Main:
  Relay = IsOn
  PAUSE 4000
  Relay = IsOff
  PAUSE 4000
  GOTO Main


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


' -----[ User Data ]-------------------------------------------------------


Keep in mind that with your relay control one valve or the other will always be hot, and you have no limit control.  If you want me to add power control and limit switch input, just let me know.
Jon McPhalen
EFX-TEK Hollywood Office

haunter1986

this program works perfectlly for my application. Thank you for your assistance on this

haunter1986

hey Jon, my rocking room is working with the program you wrote for me.  I have a small problem. load weight with people seems to change the timing ratio. So I need to add 2 micro switchs for switching my soleniods instead of letting the prop1 switch the soleniods automatically as originally written can you help with this fix,  Thanks

JonnyMac

Here you go.  When the program starts the relay will be on causing the room to move toward the B side switch; when that switch is activated the relay is turned off which will cause the room to move toward the A side switch.  When the A switch is tripped the cycle starts over.

' =========================================================================
'
'   File...... EZ_Rocker_v2.BS1
'   Purpose...
'   Author.... Jon Williams, EFX-TEK
'              Copyright (c) 2007 EFX-TEK
'   E-mail.... jwilliams@efx-tek.com
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Connect limit switches as follows:
'
' -- LimitB :: N.O. switch between P7.W and P7.R
' -- LimitA :: N.O. switch between P6.W and P6.R


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


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

SYMBOL  LimitB          = PIN7                  ' SETUP = DN
SYMBOL  LimitA          = PIN6                  ' SETUP = DN

SYMBOL  Relay           = PIN0                  ' connect to V+/OUT0


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

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


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



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

Reset:
  DIRS = %00000001                              ' make P0 an output


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

Main:
  Relay = IsOn                                  ' start motion

Rock_It:
  PAUSE 50                                      ' sw debounce delay
  BRANCH Relay, (A_Side, B_Side)

A_Side:
  IF LimitA = IsOff THEN Rock_It
    Relay = IsOn
    GOTO Rock_It

B_Side:
  IF LimitB = IsOff THEN Rock_It
    Relay = IsOff
    GOTO Rock_It


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


' -----[ User Data ]-------------------------------------------------------


Jon McPhalen
EFX-TEK Hollywood Office

haunter1986

thanks Jon, I will give it a shot. I will let you the results 

haunter1986

The new revision works perfectlly. The room has now become a smart room. It can now understand weight change with weight load in the room as people are walking through it. Thanks Jon