November 22, 2024, 02:55:18 AM

News:

You can now use Vixen to program your Prop-1 and Prop-2 controllers!  Get started quickly and easily, without having to learn PBASIC.  Details in the Library forum.


need program for Prop-1 and RC-4

Started by dbauer1080, October 24, 2007, 06:51:47 AM

Previous topic - Next topic

dbauer1080

Just received Prop-1 and RC-4 and can't wait to try.

Jon or anybody, could I please have a program for the following, as I will have to wait till next year to learn Basic code.
The scene needs the following:
PIR connected to Prop-1 then RC-4

PIR triggers Prop-1 to turn off AC lights for 23 seconds
At same time, Prop-1 activates Gemmy model prop using the typical store-ready "Try Me" button wires
Also at same time, Prop-1 activates DC digital voice recorder(it automatically plays 20 seconds)
3 seconds after AC lights out, Prop-1/RC-4 turns on AC strobe light for 20 seconds
After 23 seconds into the sequence, AC lights turn back on
PIR inactive for 2 minutes after sequence.

Any hookup recommendations would be appreciated....I've looked at all the docs but want to be sure. Also, is extension cord wire OK to use in the RC-4 for the AC outs? Thank you so much for your incredible support


JonnyMac

October 24, 2007, 08:45:01 AM #1 Last Edit: October 26, 2007, 08:25:27 PM by JonnyMac
Here you go:

' =========================================================================
'
'   File......
'   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  Sio             = 7                     ' SETUP = out; no ULN
SYMBOL  PIR             = PIN6                  ' SETUP = DN
SYMBOL  AudioPlayer     = PIN1                  ' relay to V+/OUT1
SYMBOL  Gemmy           = PIN0                  ' relay to V+/OUT0


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

SYMBOL  Baud            = OT2400

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


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

SYMBOL  relays          = B0
SYMBOL   Lights         =  BIT0
SYMBOL   Strobe         =  BIT1
SYMBOL   K3             =  BIT2
SYMBOL   K4             =  BIT3

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear outputs
  DIRS = %00000011                              ' set output pins (P0..P1)

  relays = %0001                                ' start with lights on
  GOSUB Set_RC4

  FOR timer = 1 TO 120                          ' warm-up / intershow delay
    PAUSE 1000                                  ' hold one second
  NEXT

  timer = 0                                     ' clear for PIR debounce


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

Main:
  PAUSE 5
  timer = timer + 5 * PIR                       ' advance/clear timer
  IF timer < 250 THEN Main                      ' wait for valid signal

  Lights = IsOff
  GOSUB Set_RC4

  Gemmy = IsOn                                  ' press "try me"
  AudioPlayer = IsOn                            ' press "start" button
  PAUSE 100
  PINS = %00000000                              ' clear "buttons"
  PAUSE 2900

  Strobe = IsOn
  GOSUB Set_RC4
  PAUSE 20000

  GOTO Reset


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

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

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


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



Make sure you read our PIR documentation -- it will help: http://www.efx-tek.com/downloads/pir_docs.pdf

Yes, you can use extension cord wire with the RC-4, we do that all the time.  You can take suitable extension cord, split the wires, cut ONE side, and then use the RC-4 in that side as a switch.  Be very careful with your connections, though; 120 VAC will bite you hard if you're not careful. 

To start your Gemmy prop you'll need a suitable 12-volt relay; connect the coil between V+ and OUT0, then connect the normally-open contacts across the start button of the prop.  The Prop-1 can now press the start button for you.  Do the same thing for your audio play using V+/OUT1.  Use this schematic as a guide:

Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Jon,

Thanks again. When you say suitable relay, any specifics I need to know for the DC relays?

JonnyMac

If you're using our power supply, 12 volts with a coil current of 250 mA (3 watts) or less.
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Jon,

Please pardon my electronics illiteracy. I can solder a wire and that's about it. Not knowing anything about relays and how to hook them up, I'm a little perplexed what to do next. Went to Radio Shack, looked at their relays, came up with this at this link. It is a SPDT 12VDC PC relay with coil resistance of 320 ohms, Nominal current of 37.5 mA and contact rating of 1a at 125VAC. Is this suitable? Are these put on breadboards, or do I just solder the wires to the pins?  I'm having a tough time going from your diagram to this thing, trying to figure out what wires go to what and how. Again I sincerely apologize for my lack of electronics knowhow, I didn't realize what I was getting into(although it's fun). Thanks for you help.

http://www.radioshack.com/product/index.jsp?parentPage=family&summary=summary&techSpecs=techSpecs&allCount=24&currentTab=techSpecs&cp=2032058.2032230.2032277&custRatings=custRatings&features=features&accessories=accessories&productId=2062481&support=support&tab=summary


JonnyMac

That relay should work fine.  I'd solder wires (#16 gauge for the coil, #22 for the contacts) directly to it.  You're probably going to have to check the packaging for the pin connections, though it's likely that you'll have just two pins on one end that are the coil, and the contacts will be on the other.  Look for markings like COM (common) and NO (normally open) and NC (normally closed).  You want to wire your start switch in parallel with the COM and NO contact points.

RadioShack is supposed to be able to answer questions, so if all else fails, see if you can break one of their reps away from cell phone sales and ask him/her to clarify the relay contacts for you.
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Thanks Jon for your invaluable wisdom.

dbauer1080

Jon,

Ran to Radio Shack and they were less than helpful. This relay has 6 pins, 4 grouped on one end that I believe are NC and NO on the end, then two coil wires, then on the other end are common. Since your diagram had no common labeled, not sure exactly what wire connects to what. Tried to insert image of the wiring diagram on this thread without success.I know this can't be that difficult, but has become frustrating as time is running out. Sorry for the ignorance.

JonnyMac

I don't have time to run out to RadioShack to buy one of those, so if you could take some clear digital photos I might be better able to help.  Any chance you have a multimeter and know how to use it?
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Jon,

I have a scanned diagram from the package, but inserting an image into a thread is not straightforward....is there a trick to it?

JonnyMac

Just e-mail it to teamefx at efx-tek dot com
Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080


dbauer1080

Jon,

Forgot the tek part of the e-mail address. It's now sent.

JonnyMac

Okay, first things first: You agree to hold me and EFX-TEK harmless if when you apply power everything goes up in a big cloud of blue smoke....  ;D  All kidding aside, if my diagram below does not sit with you, don't use it, we can't warranty "accidents" -- be careful. 

This is what I believe the connections should be, looking at the bottom of the relay, based on the information you provided.  It would be great if you had a multimeter that you could verify everything with.

Jon McPhalen
EFX-TEK Hollywood Office

dbauer1080

Jon,

Thanks for your efforts....I'll be careful. New problem though, tried to run program, gives me Error 110 undefined symbol. Any suggestions?