November 24, 2024, 03:09:23 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.


EZ-3

Started by cs1245, August 14, 2010, 01:38:39 AM

Previous topic - Next topic

cs1245

I got a chance to throughly read the EZ-3 documents and I still have some questions.  I have built a prop that will run a Fog Machine, Lights, and a Wiper Motor using Relays triggered by a PIR sensor.  My first question, if I am going to connect my EZ-3 to Prop-1 and I copy and paste the EZ-3 program provided in the EFXTEK documentation onto BASIC Stamp, will I be able to control the trigger delay and the amount of time the prop runs on the CindyBob MIB or do I need a custom program loaded onto BASIC stamp and then I can connect the EZ-3 to fine tune the 3 relays I am using?  Second, if I can fine tune the timing of lights, fog machine, and wiper motor how do individually select let's say the' time on' for the fog machine - how do I adjust time on for the fog machine specifically?  I am guessing I cant have that specific control unless it is written into a program.  I am trying to avoid having to mount on the outside of the box two 25K linear potentiometers to control time out and delay times.  Last, if I ask questions about the wiring of the MIB relays/circuits project, is that appropriate or does that fall outside the expectations of what goes in this forum?   

JonnyMac

It's best to define what YOU want, not point to an outside site with what someone else has done.  You want monster-in-the-box?  No problem, we've done a bunch of those.  Just define the inputs and outputs and how the program should behave and we'll take care of the rest.

Using the EZ-3 for the pots makes things a little simpler, but the IO configuration is fixed

P7 -- usually serial control to EFX-TEK sound card
P6 -- trigger input
P5 -- trigger delay pot
P4 -- run time pot
P3 -- off time pot
P2 -- output
P1 -- output
P0 -- output

Since you're following the CindyBob (cam style) MIB design and need three relays, you can wire them to OUT0, OUT1, and OUT2.  The code from that site will not work with the EZ-3 so, again, just let us know how you want the program to behave vis-a-vis the pots and outputs and we will write you a program.

Jon McPhalen
EFX-TEK Hollywood Office

cs1245

Can you write a program for MIB using the EZ-3 using the following OUTs.  I will be using a PIR sensor to trigger the MIB. 

OUT0 Wiper Motor
OUT1 Lights
OUT2 Fog Machine
OUT3 Cowalicious ISD CAR-P 325 Player

Trigger the audio track 1 second before the fog machine turns on.  Then turn on the fog machine for 2 seconds before the lights turn on and the wiper motor activates.  If it is easier to trigger the lights and wiper motor at different times then trigger the lights one second before wiper motor starts.  The total length of time all 4 items will run concurrently is 10 secs and then turn off.  Keep the MIB off for 30 secs before it can be retriggered.  Let me know if I missed any parameters. 
How can I get a hold of the CindyBob audio clip you cleaned up?

JonnyMac

I can do this, but you seem not to be using the potentiometers on the EZ-3.  And if you are using the pots, then you cannot use OUT3 as one of the pots is connected to that.  I suggest you use OUT7 as the audio trigger output -- that's what we have the EZ-3 normally setup to do.

Let me know how/what you want to do with the three pots on the EZ-3.  Normally it would be a pre-run delay, a run time (lets you tune to your audio), and a post delay. 
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

Sounds good.  I'll run the audio on the OUT7.
For the Trig Delay (I assume this is the time from when the PIR is triggered to when the Prop starts) if so make it 1 sec.
For On Time make it 15 secs
For the Off time make it 20 secs (on the EZ-3 Doc it looks like the max time is 20secs?)

Any thoughts on how I can get a hold of the CindyBob audio you cleaned up?



JonnyMac

August 17, 2010, 08:37:20 PM #5 Last Edit: August 17, 2010, 08:39:53 PM by JonnyMac
Again... do you want variable on, run, and off delays (i.e., you will use the EZ-3) or do you want them fixed to the times you just specified?  If the later, you can take the EZ-3 off the Prop-1 and use it in another project.  If you bought an EZ-3 starter kit you will need to get a new ULN chip, and I can use the outputs you call out.

Sorry if this seems persnickety; there is no "almost" or "about" when it comes to programming.

Here's the audio I cleaned and modified a bit:
-- www.efx-tek.com/audio/mib_monster.wav
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

I would like the variable on, off, and delay in case I would like to adjust the times.

Thanks for MIB audio and I just go the USB mini A cables in the mail today and the BASIC Stamp recognizes the Prop Pot on COM5.

If I were to use the 'latter' choice as you describe I then use my Prop Pot to adjust the variable on times for the fog machine, lights, and wiper motor?

JonnyMac

August 17, 2010, 10:29:47 PM #7 Last Edit: September 10, 2010, 06:05:09 AM by JonnyMac
Since you're new I'd rather just keep with the EZ-3 and your original specs.  This program should do what you want.  Again, you may need a new ULN2803 as you need pin 1 intact so that you can control the relay to the audio board with OUT7.

' =========================================================================
'
'   File...... EZ-3_MIB.BS1
'   Purpose...
'   Author.... EFX-TEK
'              Copyright (c) 2010 EFX-TEK
'              Some Rights Reserved
'              -- see http://creativecommons.org/licenses/by/3.0/
'   E-mail.... teamefx@efx-tek.com
'   Started...
'   Updated... 17 AUG 2010
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
'
' MIB
'
' Trigger Delay... 0 TO 10 seconds
' On Time......... 0 TO 20 seconds
' Off Timer....... 0 TO 60 seconds
'
' For best accuracy of each stage you should run the POT Scaling program
' from the Run menu for each stage.  Set the scale value into the POT
' instruction for each stage.
'
' Trigger Delay... Pin 5
' On Time......... Pin 4
' Off Timer....... Pin 3
'
' Turn each pot fully clockwise and use the scale value provided.  The
' scale value will be around 100 but will vary from pot-to-pot based on
' minor component differences.


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


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

SYMBOL  Audio           = PIN7                  ' SETUP = DN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  AdjTrDelay      = 5                     ' on delay  (no ULN)
SYMBOL  AdjOnTime       = 4                     ' run time  (no ULN)
SYMBOL  AdjOffTime      = 3                     ' off delay (no ULN)
SYMBOL  Fogger          = PIN2                  ' fogger control relay
SYMBOL  Lights          = PIN1                  ' lights control relay
SYMBOL  Motor           = PIN0                  ' motor control relay


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

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

SYMBOL  Yes             = 1
SYMBOL  No              = 0


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

SYMBOL  timer           = W0
SYMBOL   negFlag        =  BIT15


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

Reset:
 PINS = %00000000                              ' clear all
 DIRS = %10000111                              ' set outputs

 GOTO Post_Delay                               ' let PIR warm-up


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

Main:
 timer = 0                                     ' reset timer

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


' Trigger delay is 0 to 10 seconds

Pre_Delay:
 POT AdjTrDelay, 100, timer                    ' raw input, 5 to 255
 timer = timer - 5                             ' correct low end offset
 IF negFlag = No THEN Run_Pre
   timer = 0                                   ' fix roll-under

Run_Pre:
 IF timer = 0 THEN MIB_Start                   ' skip if zero
 timer = timer * 40                            ' convert to 0 to 10s
 PAUSE timer


MIB_Start:
 Audio = IsOn                                  ' start audio
 PAUSE 1000
  Audio = IsOff
 Fogger = IsOn                                 ' pulse fogger 2s
 PAUSE 2000
 Fogger = IsOff


' On time is 1 to 20 seconds
' (minus 3 seconds for audio delay and fogger pulse)

Motor_Time:
 timer = 0
 POT AdjOnTime, 100, timer
 timer = timer - 5
 IF negFlag = No THEN Run_Motor
   timer = 0

Run_Motor:
 timer = timer * 80 - 3000                     ' adjust for audio + fogger
 Lights = IsOn
 Motor = IsOn
 PAUSE timer
 Motor = IsOff
 Lights = IsOff


' Off time is 1 to 60 seconds

Post_Delay:
 POT AdjOffTime, 100, timer                    ' raw input, 5 to 255
 timer = timer - 5                             ' correct low end offset
 IF negFlag = No THEN Run_Post
   timer = 0                                   ' fix roll-under

Run_Post:
 IF timer = 0 THEN Main                        ' skip if zero
 timer = timer * 240                           ' convert to 0 to 60s
 PAUSE timer

 GOTO Main


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


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

cs1245

I have the ULN 2803 that was installed on the EZ3 with the P3 - P7 clipped off on the left side of it.  Will this work the above program or do I need a ULN 2803 that has all the pins intact?

Second, with this program, if I turn the POTs on the EZ3 board will it adjust the prop on/off and delay settings or is this program you wrote have fixed time settings?

Lastly, to run the program I copy and paste everything in blue font in your last reply onto the BASIC Stamp and hit RUN?


JonnyMac

You need a new ULN2803 with pins 2, 3, and 4 removed (for the pots on the EZ-3).  We normally remove pin 1 so that P7 can be used to send a serial message to one of our audio players. 

Yes, copy and paste the code into your editor, save it, and then download it to the Prop-1 (see the instructions in the Prop-1 docs for information on that).
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

I am looking at the program you wrote and it looks like the POTs are on P3, P4, P5.  I just want to verify I am clipping pins 2,3,4 on the left side of ULN2803 and since I am running Cowalicious audio from ??P7 should I also clip P1 on the left side or do I clip P7?
Thanks again


JonnyMac

I whipped up a graphic to show you the pins to clip.  The trigger is active-high so there is no need to clip the ULN pin that corresponds to P6 -- just the ones that have POTs connected to them.



For your application make sure that the SETUP pins for P6 are set to DN.
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

I was able to download the program you wrote and load it on to the EZ-3 and when the PIR sensor is hooked up the yellow trig delay light will turn on and then the on/off time lights will turn on at the same.  So it appears the program runs as written in the PBASIC program.  My question is when I ran wires from the V+ and GRD to the Cowalicious CAR-P 300 Audio Player using the V-Trig setting nothing happened.   I know one of the rules of the forum is to not ask about other products, but I am wondering form the point of the EZ-3/Prop-1 is this hooked up correctly or do the run wires the OUT0, OUT1 etc? And just to verify I do have the Prop-1 toggle switch on position 2. 

JonnyMac

You can provide power to the CAR-P from V+ and GND -- but this only works when the power switch is in position 2.  The start output is coming from OUT7.  You should consult with Carl about starting his products with an open-collector output; we don't want to get it wrong.
Jon McPhalen
EFX-TEK Hollywood Office

cs1245

     
     I spoke with Carl and he recommended using the 1 foot jumper cable supplied with the CAR-P Audio (it has a white and black wire) and connect one end of it to the CAR-P "Trig" if I am using a separate power source for the CAR-P and the run the white wire to the OUT7 and the black wire to the GRD on the Prop-1.  I did this tonight and I am able to get the audio to come out of the speakers, but it doesnt stop playing even when the Prop-1 toggle switch is in Position 2.  It just keeps repeating the audio message over and over.  Also, with the toggle in position 2 the PIR sensor cant be triggered.  I can trigger the system with the toggle in Position 1 and when the CAR-P is not attached to the Prop-1 with toggle in Position 2.  Any ideas on what I am doing wrong?  Do I need to connect all the OUTX (fogger, lights, audio, wiper motor) before the Prop-1 will work? 
    Do think it would be easier if a program for MIB is written just for the Prop-1 with the EZ-3 not attached and buy one of the your audio players to hook up to the Prop-1?  If so, which audio player would you recommend?