November 14, 2024, 07:23:18 PM

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.


What hardware would I need to run my prop?

Started by Vasago, July 27, 2009, 12:24:41 AM

Previous topic - Next topic

Vasago

Sorry about posting this in someone Else's thread.  I was thinking LED's and reading about them and thought it would be the appropriate place to post.  I assure you this will not happen again.

  Here is my original post:


  Hi Jon,

I have a question on a hardware requirement for a following display.

Two child ghosts "yellow" and "green" on a teeter-totter swing.

1. When PIR triggered one "Yellow" and one "Green" single LED lights come on to illuminate each side of the swing.

2. The swing begins to move(wiper motor)  to some ghostly sounds (AP8) for 30 seconds.

3.  After 30 seconds the music and the swing stops.

4.  A second later the "Yellow" LED (that illuminates the yellow side of the swing) fades and a sequence of 8 (eight) consecutive "Yellow" LED's light up and fade in ORDER to simulate ghostly steps away from the swing in one direction.

5  When the last "yellow" light fades, the "Green" LED that illuminates the "green" side of the swing turns off followed by another sequence of eight "green" steps in a different direction.  Once the last "green" step fades, the prop resets and cannot be re-triggered for 2 minutes.

I have prop-1 controllers, but I have a feeling this would require more channels.  Maybe DC-16, or perhaps a prop-2 controller.

I would appreciate some assistance in picking the right hardware, and if possible a program for the new hardware.

Thanks you for your time.

Vasago


JonnyMac

You could do that with a Prop-1 and DC-16.

IO:

P7 - to DC-16 (16 "step" LEDs)
P6 - PIR
P5 - motor control (relay or controller like the HB-25)
P4 -
P3 -
P2 -
P1 - Ghost 2
P0 - Ghost 1

To get the steps to fade you would put big capacitors on the DC-16 outputs (a modified version of our WickLED circuit).
Jon McPhalen
EFX-TEK Hollywood Office

livinlowe

I believe I saw someone at Rocky Mountain Haunters meeting that was using a DC-16 to do just what you want- make led "footprints". That would be a cool effect!
Shawn
Scaring someone with a prop you built -- priceless!

Vasago

I wish I could say it was entirely my idea, but it wasn;t.  I watched a u-tube video of a similar prop and was absolutely floored by the effect. 

Jon,  Can WickLED circuit be cost effectively modified to serve as a proper capacitors for the fade effect?

If so I might just get 16 of them puppies to play with.

JonnyMac

They're not hard to modify -- but you might just want to start with a couple to begin with.  The cap that needs changing is soldered on one end is an easy remove/replace (mind the polarity); you'll just need a bigger capacity cap to prolong the fade-out of the LEDs.  The "mouse house" builds a circuit like this for Halloween pumpkins; they told me it was an adaptation of the WickLed.  The use a cap that's as big as a C batter so they couldn't put it onto the WickLed board.
Jon McPhalen
EFX-TEK Hollywood Office

Vasago

Hi Jon,

Here is the program that will accomplish some of the things I need. However I am missing a DC-16 code for steps.  After the teeter stops, I want steps (LED's) heading away from the swing.  I wonder if you can help me out with the missing piece.  By the way the WickLed's will be used to light up and fade out steps.  I have a high enough capacitors to accomplish the task.

Thanks in advance.

Vasago



'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Connections:
'
'  * P7 <-- VMUSIC TX
'  * P6 --> VMUSIC RX
'  * P5 --> RC-4
'  * P4 <-- Parallax PIR sensor


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


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

SYMBOL  TX              = 7                     ' SETUP = UP, no ULN
SYMBOL  RX              = 6                     ' SETUP = UP, no ULN
SYMBOL  Sio             = 5                     ' clip ULN
SYMBOL  PIR             = PIN4               ' active-high input

SYMBOL  Ghost2       = PIN1               'Yellow LED
SYMBOL  Ghost1       = PIN0               'Green LED


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

SYMBOL  Baud            = OT2400

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL   relays         =  B0
SYMBOL   Moodlight      =  BIT0                 ' connect to K1
SYMBOL   Teeter         =  BIT1                 ' connect to K2
SYMBOL   K3             =  BIT2
SYMBOL   K4             =  BIT3

SYMBOL  timer           = W5


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

Reset:
  PAUSE 2500                                    ' let VMUSIC power up
  GOSUB VM_Stop                                 ' stop if playing
  GOSUB VM_Wait_Prompt

  relays = %0001                                ' mood light
  SEROUT Sio, Baud, ("!!!!!RC4", %00, "S", relays)

  GOSUB Start_BG_Audio                          ' start background


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

Main:
  timer = 0                                     ' reset timer

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

Teeter_Totter:
  GOSUB VM_Stop
  GOSUB VM_Wait_Prompt
  SEROUT TX, Baud, ("VPF rocking.mp3", 13)     ' start ghost chatter audio
  GOSUB VM_Wait_Start
  Moodlight = IsOff
  Teeter = IsOn
  Ghost2 = IsOn
  Ghost1 = IsOn
  GOSUB Set_RC4
  GOSUB VM_Wait_Prompt
  PAUSE 500                          ' let audio finish
  Teeter = IsOff

Ghost2 = IsOff


=========================
Here I need steps moving away from the
Teeter "Yellow"  8 steps channel 0-8
on dc-16
==============================


Ghost1 = IsOff


=========================
Here I need steps moving away from the
Teeter "Green" 8 steps channel 9-16
==============================


  Moodlight = IsOn
  GOSUB Set_RC4
  GOSUB Start_BG_Audio                          ' restart background

Pgm_Delay:
  FOR timer = 1 TO 30
    PAUSE 1000                                  ' 300 secs = 5 mins
  NEXT
  GOTO Main


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

VM_Wait_Start:
  SERIN RX, Baud, ("T $")
  RETURN

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

VM_Stop:
  SEROUT TX, Baud, ("VST", 13)
  RETURN

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

VM_Wait_Prompt:
  SERIN RX, Baud, (">")
  RETURN

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

Start_BG_Audio:
  SEROUT TX, Baud, ("VRF graveyrd.mp3", 13)     ' repeat file
  RETURN

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

Set_RC4:
  SEROUT Sio, Baud, ("!RC4", %00, "S", relays)
  RETURN


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

JonnyMac

August 15, 2009, 10:24:54 AM #6 Last Edit: August 16, 2009, 03:20:08 PM by JonnyMac
Here you go -- note that I changed your file names to recover a few extra bytes for code; this program barely fits into the Prop-1.

PROGRAM UPDATED 16 AUG 2009

'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' Connections:
'
'  * P7 <-- VMUSIC TX
'  * P6 --> VMUSIC RX
'  * P5 --> RC-4 --> DC-16
'  * P4 <-- Parallax PIR sensor


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


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

SYMBOL  RX              = 7                     ' SETUP = UP, no ULN
SYMBOL  TX              = 6                     ' SETUP = UP, no ULN
SYMBOL  Sio             = 5                     ' no ULN
SYMBOL  PIR             = PIN4                  ' active-high input

SYMBOL  Ghost2          = PIN1                  ' Yellow LED
SYMBOL  Ghost1          = PIN0                  ' Green LED


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

SYMBOL  Baud            = OT2400

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL   relays         = B0
SYMBOL   Moodlight      =  BIT0                 ' connect to K1
SYMBOL   Teeter         =  BIT1                 ' connect to K2
SYMBOL   K3             =  BIT2
SYMBOL   K4             =  BIT3

SYMBOL  idx             = B2
SYMBOL  first           = B3
SYMBOL  last            = B4

SYMBOL  timer           = W5


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

Reset:
  PAUSE 2500                                    ' let VMUSIC power up
  GOSUB VM_Stop                                 ' stop if playing
  GOSUB Setup


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

Main:
  timer = 0                                     ' reset timer

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

Teeter_Totter:
  GOSUB VM_Stop
  SEROUT TX, Baud, ("VPF fg.mp3", 13)           ' start ghost chatter audio
  Moodlight = IsOff
  Teeter = IsOn
  GOSUB Set_RC4
  PINS = %11                                    ' Ghosts on
  GOSUB VM_Wait_Prompt
  PAUSE 500                                     ' let audio finish
  Teeter = IsOff
  GOSUB Set_RC4

  Ghost1 = IsOff
  first = 1
  last = 8
  GOSUB Run_Away

  Ghost2 = IsOff
  first = 9
  last = 16
  GOSUB Run_Away

  GOSUB Setup

Pgm_Delay:
  FOR timer = 1 TO 300
    PAUSE 1000
  NEXT

  GOTO Main


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

Setup:
  PINS = %00000000                              ' all off
  DIRS = %00000011                              ' set outputs
  SEROUT Sio, Baud, ("!DC16", %00, "X")         ' clear DC-16
  relays = %0001                                ' mood light on, others off
  GOSUB Set_RC4
  GOSUB Start_BG_Audio                          ' start background
  RETURN

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

VM_Wait_Start:
  SERIN RX, Baud, ("T $")
  RETURN

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

VM_Stop:
  SEROUT TX, Baud, ("VST", 13)

  ' falls through to VM_Wait_Prompt
  ' -- ensures VM ready for command after we stop it

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

VM_Wait_Prompt:
  SERIN RX, Baud, (">")
  RETURN

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

Start_BG_Audio:
  SEROUT TX, Baud, ("VRF bg.mp3", 13)           ' repeat file
  RETURN

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

Set_RC4:
  SEROUT Sio, Baud, ("!RC4", %00, "S", relays)
  RETURN

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

Run_Away:
  timer = 500
  FOR idx = first TO last
    SEROUT Sio, Baud, ("!DC16", %00, "P", idx, 1)
    PAUSE timer
    timer = timer ** $C000                      ' x 75% to accelerate
    SEROUT Sio, Baud, ("!DC16", %00, "X")
  NEXT
  RETURN


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

Vasago

Hi Jon,

I played with it for as long as I could to see if I can make it work, but no dice.

Here is what's happening: Bkg.mp3 sound and "moodlight" works as it should.  After PIR trigger, instead of  "Chat.mp3" the "BKG.mp3" restarts again.  However, the RC-4 ("Teeter") gets triggered as it should along with 2 ghosts.  After the sound ends  Ghost2 = IsOff (works) but the DC-16 stuff doesn't (although it looks like it takes enough time that it should be working).  The Ghost1 = IsOff (works as well) but DC-16 stuff again does not.  I hope it's not my DC-16 connection, but I don't think it is.

After the reset, the trigger never fires again, it only works the first time.

Hope you can find something.

Thanks again for all your support Jon.





BigRez

Quote from: Vasago on August 15, 2009, 03:16:38 PM
After the reset, the trigger never fires again, it only works the first time.

Looks to me like a     GOTO Main        is missing at the end of the Pgm_Delay block.

Vasago

Thanks for the suggestion bigrez!  That fixed the problem with re-triggering. 

In addition by moving

GOSUB VM_Stop
GOSUB VM_Wait_Prompt

from the Reset: routine to the top of the Teeter_Totter: routine, solved the problem with music as well.

The only other problem remains is the DC-16 failing to trigger.  Any suggestion from the community would be highly appreciated !!!

Thanks


JonnyMac

Try the new version above -- it's working for me.

Forgive me for posting a program that I didn't hookup; not being a big fan of the VMUSIC I gave away my cable and had to build a new one.  The program above has a VMUSIC, RC-4, and DC-16 connected to it and is working as you desire.

Please check your connections versus mine; I tested the VMUSIC with my standard program and stuck with those connections.
Jon McPhalen
EFX-TEK Hollywood Office

Vasago

Works great.  Thanks for everyone's input!

If I can pull this off, this would be a great prop.




JonnyMac

It sounds like a very cool prop; when you're done please shoot and post pics/video for everyone to see.
Jon McPhalen
EFX-TEK Hollywood Office