November 22, 2024, 10:00:22 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.


Trashcan and relay board

Started by zeenon, October 19, 2013, 08:06:05 AM

Previous topic - Next topic

zeenon

The last thing I needed to add to my trashcan prop was the ability to turn a strobe on/off. I had a few of these laying around:

http://simplecircuitboards.com/Spec%20Sheets/TTL%20Relay%20Board%2010A-V2%20-%20Spec.pdf

So I hooked up 12V to it, made a two wire harness for the TTL in and added the code to the original prop-1 code below....and nothing!

I'm not sure what I did wrong here?


' =========================================================================
'
'   File...... Trashcan_popup v1.0.BS1
'   Purpose... Trashcan popup routine (Prop-1)
'   Author....
'   E-mail....
'   Started...
'   Updated...
'
'   {$STAMP BS1}
'   {$PBASIC 1.0}
'
' =========================================================================


' -----[ Program Description ]---------------------------------------------
' This program will wait FOR contact switch or PIR to close then trigger the
' trashcan lid to open, pause, then trigger the prop to pop-up. After 20 secs
' the prop will lower and the lid will close.
'
' Prop-1 moded ULN pin 1 cut/P7 jumper OFF/P6 jumper ON/DWN
' Prop-1 P7
' Prop-1 P6 is trigger to start connected to WR
' Prop-1 P3
' Prop-1 P2
' Prop-1 P1
' Prop-1 P0
' Prop-1 OUT0/V+ is connected to 12V solenoid (Lid)
' Prop-1 OUT1/V+ is connected to 12V solenoid  (Prop)


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


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

SYMBOL  Trigger      = PIN6                      ' SETUP = DN
'SYMBOL  open        = PIN5
'SYMBOL  open        = PIN4
SYMBOL  Strobe       = PIN3
'SYMBOL  open        = PIN2
SYMBOL  Valve1       = PIN1
SYMBOL  Valve2       = PIN0


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

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


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

SYMBOL  timer           = B2


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

Reset:
  PINS = %00000000                              ' clear all outputs
  DIRS = %00001011                              ' make P0-P1 outputs


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

Main:
  timer = 0                                     ' reset timer

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


  Strobe = IsOn                                  ' strobe light on
  Valve1 = IsOn                                  ' lift lid
  PAUSE 1500                                     ' pause for x secs
  Valve2 = IsOn                                  ' lift prop
  PAUSE 5000                                     ' hold for 5 seconds

  Valve2 = IsOff                                 ' retract prop
  Strobe = IsOff
  PAUSE 3000
  Valve1 = IsOff

  PAUSE 60000                                   ' 60 second post-delay

  GOTO Main                                     ' back to Main


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


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


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


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


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


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


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

zeenon

Scratch that......I know what I did wrong. I had the TTL in of the relay board connected to W&R, instead of W&B.

Z

IMTim

I was going to suggest you look at your relay or something on the strobe.  Your program ran fine on my test Prop-1.
"We had become the thing we hate. We are better dead."

Sparlimb Keelsetter "The Illearth War"

JonnyMac

You should be using the white (signal) and black (ground) leads from the TTL pin. Make sure that you're very careful with the connections.

If you had one of these, it would be plug-and-play (and no external 12v supply required!)  ;)
* http://www.efx-tek.com/topics/rc-2.html

On an interesting note, I tried to go to that web site and found the URL is for sale....
Jon McPhalen
EFX-TEK Hollywood Office