November 23, 2024, 07:03:38 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.


Prop1 Groundbreaker prop

Started by youngti, May 19, 2009, 03:25:02 PM

Previous topic - Next topic

youngti

I did think of that and yes it is in the DN position.  However the pins on the ULN have been bent up on P7,P6,P5.  would that cause an issue?  I'm also considering a bad PIR, but if it wasn't working wouldn't it just not trigger at all?

youngti

August 02, 2009, 08:09:49 AM #31 Last Edit: August 04, 2009, 04:03:12 PM by youngti
Hey Guys,  I'm hoping you have some suggestions as I am pulling my hair out (and I don't have much left).

I have pulled everything appart and have tested each section independently.  I have also replace every hardware part as well to check.  And the code seems to work independently, except for the CAP200 and PIR triggering.

PIR is on Pin7 with the jumper set to DN and a new ULN in with all pins on it.

Removing the Start Audio section the code works perfectly with the solenoids firing and the K1 on the RC4 lighting up.  With the PIR connected and  everything is triggered by the PIR.

With the Start Audio line in and the CAP200 is connected, and I have followed the instructions you have for this, the following happens.

At power up the CAP200 plays once to finish.
At about 5 to 7 seconds into the CAP start the solenoids start to randomly fire lasting approximately 27 seconds.

7 seconds go by and the solenoids start to fire again lasting approximately 27 seconds.
7 seconds go by and the solenoids start to fire again lasting approximately 27 seconds.
7 seconds go by and the solenoids start to fire again lasting approximately 27 seconds.
7 seconds go by and the solenoids start to fire again lasting approximately 27 seconds. 

Continuing until I turn off the power. This is with the PIR connected, but it doesn't seem to trigger .
Any Ideas?


JonnyMac

Tim,

Sorry, I thought I answered this yesterday -- let me see what I can do to save the rest of your hair.  I looked at the last available listing in this thread and found things that I'm pretty sure I didn't do because they *violate* my standards. 

Things that will make your life easier:

1) Serial I/O to EFX-TEK devices like the RC-4 is always on P7 (easier to deal with ULN; must be removed)
2) Trigger input is on P6; make it active high (like the Parallax PIR) and you can leave the ULN in place

You have eye "outputs" in the program but the DIRS was not setup correctly to allow them to come on.  Also, you were not shutting them off after the ground-breaking section.  You have a PAUSE 5000 write after the GOSUB to start the CAP, this explains the delay in starting the shaking.  On the assumption that you want the shaking to start with the audio I took that out.  You then have a PAUSE 5000 at the end before you can re-trigger.  I've moved this to the Reset section and changed it to 30000 (30 seconds).

Do me a favor: Rewire you serial and trigger connections to conform to this code and give it a try.  The connection to the CAP board is via OUT5 (don't forget to connect GND to the CAP if you're not providing power from the Prop-1).  Run the code as-is; please don't change anything until you get a full grip on what each of the language statements do and their implications when used. 

' =========================================================================
'
'   File...... GroundBreaker_V1.BS1
'   Purpose...
'   Author.... Tim Young (clean-up by Jon Williams)
'   E-mail....
'   Started... 05-19-09
'   Updated... 04 AUG 2009 (JW)
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


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


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


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

SYMBOL  Sio             = 7                     ' SETUP = UP, no ULN
SYMBOL  Trigger         = PIN6                  ' SETUP = DN
SYMBOL  CAPAudio        = PIN5                  ' Cowlacious CAP200 (OUT5)

SYMBOL  LeftEye         = PIN3                  ' Led eye
SYMBOL  RightEye        = PIN2                  ' Led eye
SYMBOL  Solenoid2       = PIN1
SYMBOL  Solenoid1       = PIN0


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

SYMBOL  Baud            = OT2400

SYMBOL  IsOn            = 1
SYMBOL  IsOff           = 0

SYMBOL  BreakTime       = 30000


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

SYMBOL  relays          = B0
SYMBOL   Light          =  BIT0
SYMBOL   K2             =  BIT1
SYMBOL   K3             =  BIT2
SYMBOL   K4             =  BIT3

SYMBOL  delay           = B2

SYMBOL  timer           = W4
SYMBOL  lottery         = W5
SYMBOL   lottoLo        =  B10
SYMBOL   lottoHi        =  B11


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

Reset:
  PINS = %00000000                              ' clear IOs
  DIRS = %00101111                              ' define output pins

  SEROUT Sio, Baud, ("!RC4", %0000, "X")        ' clear RC-4 outputs
  PAUSE 30000                                   ' PIR warm-up, reset delay


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

Main:
  timer = 0

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

Start_Audio:
  CAPAudio = IsOn
  PAUSE 250
  CAPAudio = IsOff

  Light = IsOn
  GOSUB Update_RC4

  LeftEye  = IsOn
  RightEye = IsOn

  timer = 0                                     ' restart timer for shakes

Ground_Break:
  RANDOM lottery                                ' create new outputs
  Solenoid1 = LottoLo
  Solenoid2 = LottoHi
  RANDOM lottery                                ' re-stir random
  delay = lottery // 201 + 50                   ' between 50 and 250 ms
  PAUSE delay                                   ' hold
  timer = timer + delay                         ' update timer
  IF timer < BreakTime THEN Ground_Break        ' check run time

  GOTO Reset                                    ' clear everything, delay


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

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


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





Jon McPhalen
EFX-TEK Hollywood Office

youngti

August 04, 2009, 10:34:00 PM #33 Last Edit: August 04, 2009, 11:01:39 PM by youngti
Jonny,

Thank you so much for your help.  I rewired the system as you specified and I'm getting better results.  The trigger is working for both the solenoids and the RC-4.  However the CAP200 still plays once immediately when I turn on the power and then never again.  Would like the sound to trigger each time the PIR is tripped so all three events, Light, solenoids and CAP are running at same time.  I have the CAP on Pin5, power to V+ and both grounds to ground.  The white from Pin5 and black ground go to the trig pins on the CAP200.

JonnyMac

Just for clarification, you should have three wires from the Prop-1 to the CAP -- all of the wires should be coming from the green output terminals.  Do not use P5 (WRB header).

V+ goes to the positive power input on the CAP
OUT5 goes to the positive side of the trigger connection (white wire)
GND goes to the ground side of the power input

It doesn't hurt to connect the trigger black wire to the GND terminal, but the power connection gives you ground so this connection would be redundant.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

That is the way I have it set.  Power from CAP to Green V+, Ground on CAP to Ground on Prop1, White wire from Prop1 Out5 to trigger on CAP, Ground from Prop1 to ground on CAP trigger.  I did disconnect the Trigger ground on the CAP but it wouldn't play at all so i reconnected it.

JonnyMac

It may be that you have the ground connection into the trigger port.  That would explain it playing when you power up and not playing again -- well, maybe, seems to me that if the play input was grounded it would loop (the old boards did that, anyway).  Perhaps the new boards debouched that input and force it to be released before it will play again.

You may need to get an assist from Carl as he made the board.  I've had no trouble starting mine with the code I gave you; in fact, I determined that the 250ms low pulse is needed because of a cap (intended to suppress noise) on the trigger input.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

Thank you again for all of your help.  I'm going to try switching the trigger from pin to pin on the CAP and see if that helps.  Then i will try just using the CAP and a PIR alone and see if that works.  You guys are great and I appreciate your Patience and help.

once I get this figured out I will come back to you and ask you about the LED eyes and how to make them turn off and on when the program runs.  Just feeling a bit frustrated with all of this right now.  I thought I had a better handle on it and it's humbling to see that I don't.

youngti

just to be sure I attached a JPG that shows where I have connected the white trigger on the CAP from PIN5 on the Prop1.

JonnyMac

It's time to call Carl and check with him.  I have a CAR/P-200 and the connection point is as you indicate and the code I gave you is what I use with that board.  When you call Carl tell him you're using an open-collector output to start the board.  The board that you have might have different requirements than mine.

Or... you could write a test program; that's how I came up with my code.  I knew that the Trigger input (white wire) had to be pulled low to start the board but I didn't know for how long.  It was through experimentation that I found 250ms was the most reliable.  Your specific board might have a different requirement; only Carl would know that.
Jon McPhalen
EFX-TEK Hollywood Office

youngti

Okay, thanks.  I've sent Carl an e-mail and will try just triggering the CAP by itself tonight.

Thanks again for all your help.

ccowley

Hi,

I sent the following info to last night, but I couldn't post it here until I was approved for membership, so it is.

"First off, the CAP200 will play a sound once when triggered and will not play again until that trigger is released. So, it looks like your system must be holding that pin low.

Second, I would recommend using the V-Trig connection instead of the Trig connection. If you use the V-Trig connection you will need a gnd connected to one of the V-Trig pins and your Prop1 pin would connect to the other. It does not matter which pin on the V-Trig connection gets ground and which gets the high output from your Prop1. Make sure you change the V-Trig voltage selection jumper to 5V. Whenever you send out a high from the pin of your Prop1 it will trigger playback on the CAP200. Again, you must release that high before you can retrigger the CAP200.

Alternatively, if you only want to send three wires to the CAP200 (gnd, positive, signal), then you could use the Sig. pin on the CAP200's motion sensor connection and send a 5v high to it to trigger the sound."

That being said, I hadn't caught the part about these outputs being open collector. I don't have a Prop1 or Prop2, so I am not too familiar with them. If I remember right they use an ULN2803 on their high current outputs. Are there regular TTL output too or just the ULN2803 outputs?

Looking at the schematic of our Trig input will help you see why that is case. It might appear a little odd for an input trigger, but it is extremely robust and protects the microcontroller from people hooking things up wrong and destroying the unit. I have attached an image of our Trig schematic (I couldn't seem to be able to paste it here with image button).


If there are only ULN2803 outputs, then I wouldn't use the TRIG connection on the CAP200 at all as it probably won't be able to pull the voltage low enough to properly trigger the unit. I would use the V-Trig connection by connecting the positive of your power source to one of the pins of the V-Trig connection and connecting the other side of the V-Trig connection to one of your open collector outputs on the Prop1. That should give you a reliable trigger.

youngti

There are regular TTL's (PIN0 to 7) as well as the high current outs (OUT0 to 7).

youngti

Success!!!!!!!!

I moved the connection to the CAP from OUT5 to PIN5 and connected the V-trig to the W and B pins on PIN5.  Triggering every time!

Now I just need to do one more thing, get the LED Eyes to turn off and on with the trigger. 

ccowley

 Glad to hear you got it working! There are a couple more things that I should mention about the CAP200 board. John only has the CAR/P200 (Recorder/Player) board which didn't have the V-Trig section, so he would not be familiar with it. The CAR/P300 (our newer Recorder/Player) has all the same triggering abilities as the CAP200. Also, in ALL the older boards the capacitor on the trigger input was .1uF (even though I had originally spec'd .01uF's). So, as John mentioned, you had to hold the pin low for 250ms to get a good trigger. For over a year now, all the boards have had .01uF's, so the new boards shouldn't need to held low near as long.

With all that, the TRIG input was designed to be used with a switch or relay contacts as it's inputs. So, I still recommend the V-Trig (Voltage level Trigger) header for trigger from a voltage source or another microcontroller etc., which is why we added the capability to the CAR/P300.

Hope that helps clear some things up so everyone can get there props working they way they want them to! Halloween is just around the corner.

Talk to you later,

Carl Cowley
www.cowlacious.com