# prop 1 with a motion sensor



## punch (Mar 11, 2007)

i have a prop 1 using a motion sensor, to triiger my pop-up...

this was the first year for the prop in action, can i wire a pushbutton trigger also...


----------



## TSquared (Nov 4, 2007)

The Prop-1 is looking for an input to trigger. It can be a PIR, a pushbutton or both. The trigger pin is just looking for a high or low signal depending on how you have written your code and set up your circuit.

Here's a couple of links to get you started:

http://wolfstone.halloweenhost.com/Controllers/cbsbp1_PROP-1.html

http://www.efx-tek.com/downloads/prop-1_programming_basics.pdf


----------



## Diaval (Nov 9, 2007)

I found this 'template' Prop-1 program over at the EFX-TEK forums. It was created by Jon Williams and this is basically what you can do to create both a PIR AND manual button trigger. In other words you can wire up both to the same input.

It may be a good idea to get into using this 'front end' for any program that eventually want a PIR trigger on because you can always use a switch later with it. The only caveat is that the program will do nothing but loop continuously until a trigger is attained. If you want to be able to have something going WHILE waiting for a trigger, then you need a different animal (program).

Here is the post I copied from the EFX-TEK site.

Some PIR sensors can have a bit of "ragged" output which, under some circumstances, can lead to false triggering. A simple way to prevent false triggering of your prop is to wait until the PIR signal is present for at least 1/4 second -- very short in human terms, but a very long time in microcontroller terms. A neat little math trick, called "combinatorial logic" lets us update or clear the PIR timer variable with one line of code.

' =========================================================================
'
' File......
' Purpose...
' Author....
' E-mail....
' Started...
' Updated...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
'
' =========================================================================

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

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

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

SYMBOL PIR = PIN6 ' SETUP = DN

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

SYMBOL IsOn = 1
SYMBOL IsOff = 0

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

SYMBOL pirTimer = B2

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

Reset:

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

Main:
pirTimer = pirTimer + PIR * PIR
PAUSE 10
IF pirTimer < 25 THEN Main

' control code here

END


----------

