November 21, 2024, 11:52:52 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.


MIB newbie help

Started by pixelmonk, October 23, 2011, 08:01:03 PM

Previous topic - Next topic

pixelmonk

I bought the Prop 1, Trainer, AP-8 and the PIR sensor module about 2-3 years ago but with life issues happening around each Halloween, I was never able to complete my monster in a box prop.   Unfortunately this year is no different and I find myself wondering if I'll be able to finish it this late in the season (a week away).

What I started with about 3 years ago was a crate with a flicker light (simple florescent transformer), fog machine, sound system w/mp3 player and a windshield wiper motor.    The motor has spiral disc created from plywood mounted on it.  It basically lifts the lid up and slams it down after it hits a notch with each revolution.   Obviously the problem with this method is it's going non-stop.

What I want to accomplish at a minimum, if I can with my current setup and current stuff from EFX-TEK is:

PIR triggers > Prop 1 goes in to action turning on the AP-8 and the windshield wiper motor.    I'm not concerned this year about the fog machine nor the flicker light.   The crate is sealed pretty well so a flicker light or smoke won't be seen coming from it, and I can set the timer for the fogger with its own controller (for now).    After reading up in the forums, I'm concerned with needing an RC-4 w/SSR in order to control the wiper motor.    The wiper motor comes with its own power supply (12v 5amp.. from another halloween supply store online).   Please let me know if this is doable with just the Prop 1, AP-8 and PIR.   I have the trainer so I can use the 2003A (which came with it)

pixelmonk

Or, should I bust out the CC and see if I can get a EZ-3micro shipped to me (in VA) by Thursday?   Would that work with the wiper motor?    I'm just trying to figure out the easiest way to get this thing set up for Halloween and worry about nailing down the prop next year.  If anything, I can always re-purpose the EZ-3 or the Prop1 for something else next year.  :)

bsnut

October 23, 2011, 10:11:36 PM #2 Last Edit: October 24, 2011, 02:04:19 AM by bsnut
We should be able to get out of the hole you are in.  Because, I won't be able to do my haunt this year at the Baltimore Streetcar Museum and know how you feel.

I will or someone will get you a basic MIB program for you. But, if you look in the recent Prop-1 threads you will find a standard MIB program that will fit your needs with some modifications to it a matching the things that you have and the good thing you will be up and running.
William Stefan
The Basic Stamp Nut

pixelmonk

sweet, thanks!!    I was planning on taking a look at some of those programs while at work today.   

bsnut

October 24, 2011, 03:09:39 AM #4 Last Edit: October 26, 2011, 12:35:31 AM by bsnut
Here is your program which is based Jon's Standard MIB code. The thing that I did do is removed the pots and left the rest unchanged. I also noted were you my need to change the timing to meet your needs. Here is the topic link for the Jon's code. http://www.efx-tek.com/php/smf/index.php?topic=1755.0

'   File...... MIB3.BS1
'   Purpose... "Standard" MIB code with reset delay in code
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Connections:
'
' P7 -   Serial connection for the RC-4
'        * must remove pin 1 of ULN2803
'        * must remove P7 SETUP jumper
'
' P6 -   Active-high trigger input
'        * Parallax PIR
'        * N.O. button/mat switch between P6.W and P6.R
'
' OUT4 - Pulse out to audio player
'        * use OUT4/GND to send start pulse to AP-8 (P input)
'        * use V+/OUT4 to send 12v pulse to AP-16 or Cowlacious
'
' OUT3 - Control to 12v light
'        * suggest 12v LED automotive brake light/turn light
'
' OUT2 - Control to 12v light
'        * suggest 12v LED automotive brake light/turn light
'
' OUT1 - To relay that controls wipper motor for lid or box jumping
'
' OUT0 - To relay that controls fogger remove
'        * Be VERY CAREFUL with fogger remote wiring


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


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

SYMBOL  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  Audio           = PIN4                  ' pulsed output
SYMBOL  Light2          = PIN3                  ' 12v LED brake light
SYMBOL  Light1          = PIN2                  ' 12v LED brake light
SYMBOL  BoxMotor        = PIN1                  ' to relay for wipper motor
SYMBOL  Fogger          = PIN0                  ' to relay for fogger


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

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

SYMBOL  FogRun          =  2000                 ' 2 seconds
SYMBOL  AudioPulse      =   250                 ' 1/4s pulse for player
SYMBOL  AudioRun        = 10000                 ' audio is 10s  <-change to meet your needs
SYMBOL  ResetDelay      = 20000                 ' Reset Delay is 20s <-change to meet your needs

SYMBOL  MinJump         =   100                 ' timing for lid/box jumps <-change to meet your needs
SYMBOL  MaxJump         =   250


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

SYMBOL  flash           = B2                    ' for light flashing

SYMBOL  timer           = W3                    ' event timer
SYMBOL  delay           = W4                    ' run delay
SYMBOL  lottery         = W5                    ' random #


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

Reset:
  PINS = %00000000                              ' clear all
  DIRS = %00001111                              ' make P0-P3 outputs

Reset_Delay:
  PAUSE ResetDelay                              ' reset delay

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

Main:
  timer = 0                                     ' reset timer

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

Start_Audio:
  Audio = IsOn
  PAUSE AudioPulse
  Audio = IsOff

Start_Fog:
  Fogger = IsOn
  PAUSE FogRun
  Fogger = IsOff
  timer = 0                                     ' clear event timer

Thrash:
  RANDOM lottery                                ' re-stir
  delay = MaxJump - MinJump + 1                 ' get span
  delay = lottery // delay + MinJump            ' calc jump timing
  BoxMotor = IsOn - BoxMotor                    ' toggle cylinder

  flash = lottery & %00001100                   ' isolate lights
  PINS = PINS &/ %00001100 | flash              ' update light outputs

  PAUSE delay                                   ' hold
  timer = timer + delay                         ' update run timer
  IF timer < AudioRun THEN Thrash               ' if not done, go again
  GOTO Reset


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


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

JonnyMac

William,

In your program notes you listed P5 as the trigger input, but the code is on P6 (which is recommended). I edited the notes.
Jon McPhalen
EFX-TEK Hollywood Office

bsnut

Jon,

Thanks for catching my mistake and will edit my program on my laptop.
William Stefan
The Basic Stamp Nut