Can't see the PIR sensor, can you? Look at the white dot on the neck...
So this year, I decided one of my projects was going to use the guts from
this guy
(who was a semi-static prop, which moved up and down from a rotisserie motor, though a
series of pulleys). And make it into a "greeter", complete with PIR sensor to start chatting
when TOTs came up the walk, as well as have a flickering lamp in his hands.
Misc. sections of pipe for the stand (All from Home Depot)
(4) 1" x 1' threaded pipes
(4) 1" threaded end caps
(3) 1" threaded "T" connectors
(1) 1" x 3' threaded pipe
(1) 1" - 3/4" threaded reducer
(1) 3/4" x 3' threaded reducer
8 ohm speaker taken from an old car speaker box
small power strip (mounted to the "spine" of the greeter)
Old gas lantern
3/4" PVC (for arm support)
(2) 5" pipe clamps
Lots of 1" wood screws
Flicker Circuit lamp
What this prop will accomplish is when a TOT'er comes to the walkway up to the house, the PIR sensor
will trigger, and play this track to greet the TOT'ers, and warn
them of the dangers ahead, while lighting their way. The audio track was done by me, using Audacity,
a fantastic FREE audio editor. I recorded my voice, and slowed it down a few notches, and added some reverb to
get a good effect.
I was originally going to make use of the $5 MP3 player, and hack it for the audio. After about
20 hours of actual work trying to make it work, I finally caved, and went with the AP-8, which has
a proven track record in working with the Prop-1. The AP-8 was easy to program and configure. See the documentation
here.
Programming the AP-8
To program the AP-8, make sure the 012 dip switches are "UP" (on the red dip-switch bank), meaning, pushed towards the
center of the unit. This will set the unit to start recording at Bank 0, and not to loop the track. Once these are
in position, move the PLAY/REC jumper to the record side (red REC LED will light up). Hook the unit up to your computer via the
mini-jack, and hold down the record button, and then play the sound on your computer. Release once the sound has completed playing.
Once the sound has been recorded, unhook the input from the computer, and move the PLAY/RED jumper back into the PLAY position. (a green PLAY LED will now be lit).
You can sample the sound by wiring up a speaker to the green terminals, and pressing the PLAY/REC button. If all is well, move on to the next step, programming the PROP-1.
Programming the PROP-1 The PROP-1 is very easy to configure for this use. The code for this prop can be downloaded from here (greeter.bs1) and the code is fairly simple:
' (c) 2007 Garage of Evil
' http://www.garageofevil.com
'
' this program will watch for the PIR sensor to trigger on PIN7, and then
' trigger the AP-8 to play it's audio, and then wait 60 seconds before doing it
' again...
'
' {$STAMP BS1}
' {$PBASIC 1.0}
SYMBOL Audio = 0 ' AP-8 is on P0
SYMBOL PIRSensor = PIN7 ' input trigger on P7
SYMBOL IsOff = 0
SYMBOL IsOn = 1
Reset:
DIRS = %00111111 ' make P7-P6 inputs, P5-P0 outputs
PINS = %00000000 ' all outputs off
Main:
TryAgain:
'DEBUG "..CHECKING.."
IF PIRSensor = IsOff THEN TryAgain ' wait until trigger is activated
'DEBUG " SENSOR TRIGGERED! "
SEROUT Audio, OT2400, ("!AP8", %11, "P", 0) ' send signal to AP-8 to play
PAUSE 60000 ' wait 60 seconds
GOTO Main ' repeat forever
END
And that is all there is to the code. It's pretty simple, but pretty effective. For the PROP-1 connections,
I have the PIR Sensor hooked up to PIN7, using the 12" female to female 3-pin adapter from EFX-Tek, and the same
to the first connector on the AP-8, to PIN0 on the PROP-1. What the code above does is...
SYMBOL Audio = 0 ' AP-8 is on P0
SYMBOL PIRSensor = PIN7 ' input trigger on P7
SYMBOL IsOff = 0
SYMBOL IsOn = 1
In the code above, I am specifying that the AP-8 is connected to PIN0 on the PROP-1, and the PIR Sensor is connected to
PIN7 on the PROP-1. I also set two variables for ON and OFF (IsOn, IsOff) for easier reading in the code.
Reset:
DIRS = %00111111 ' make P7-P6 inputs, P5-P0 outputs
PINS = %00000000 ' all outputs off
The next code block configures the pins on the PROP-1, setting pins 6 & 7 as input pins, however we are only using PIN7. And sets pins 5-0 as output pins,
however only PIN0 is currently used. The next directive (PINS) makes sure everything starts off in an off state, or IsOff.
Main:
TryAgain:
'DEBUG "..CHECKING.."
IF PIRSensor = IsOff THEN TryAgain ' wait until trigger is activated
'DEBUG " SENSOR TRIGGERED! "
SEROUT Audio, OT2400, ("!AP8", %11, "P", 0) ' send signal to AP-8 to play
PAUSE 60000 ' wait 60 seconds
GOTO Main ' repeat forever
END
This section of the code is the guts of the program... Main: specifies the "main" block of code. TryAgain is a function created to
keep monitoring the PIR sensor, until it sees it as "on" (IsOn). If it does see that the PIR sensor has fired,
it will then run the code below it, and loop back to the beginning when done (GOTO Main). The SEROUT line sends a 2400 baud signal
to the AP-8 on PIN0, identified by the "!AP8" identifier. The "P" in the above statement is the command, in this case play, and the last
variable sent is the bank in which we want to play, which we have setup as bank 0.
The program will then pause for 60 seconds, and then start looking for the PIR sensor to trigger this all over again. I also have some debug
statements in there, which I used in verifying everything was working correctly.
NOTE REGARDING FIRST CALL TO THE AP-8 FROM THE PROP-1 One thing to note, is the first iteration of the PIR sensor firing does not trigger the AP-8, only the 2nd onwards actually fire.
This may just be mine, I've been hard on my PROP-1, but that is just something I found and thought I would share...
The Connection
The above image shows the connection in all it's glory. Really simple. The next few images show
the mounts for the speakers, and the PIR sensor location on the prop, as well as the power hookup on the prop.
The boards are mounted on a piece of 2" foam, and held on there with 1.5" screw nails. So it is on there securely,
however, easily removable if needed. The foam is then mounted to the pipe supports via two screws and a 1" copper pipe support.
PIR Sensor
Speaker
The speaker (and all speakers) have a magnet in them. This was big enough it stuck to the pipe support, but I also added a couple of zip-ties to a copper 1" pipe support for added "safety".
Front view of prop (and location of items)
As you can see in the image above, he's got shoulders and arms. To get him those working parts,
I used a utility knife and cut X's into the blucky torso plastic on either end, and fitted a 2' 1/2" PVC
pipe through. Then, to support the weight these would be bearing, I cut up his back in the center using a utility knife,
and put on 2 4" pipe clamps to secure it in place to the metal pipe that runs up the middle of him. I also then
drilled into the 1/2" PVC pipe, 1/2" drywall screws on the front and back of the blucky, to give him more support. As the
gas lamp he's holding weighs a few pounds.
I then added 1/2" 45 degree angle PVC pipe connectors to put in the upper arms, and then 2 more at the elbows for the forearms.
Over the forarms, I jammed the blucky forearms onto the PVC, which I had already attached the skeleton hands to from last years prop,
using gorilla glue, and going in at an angle, to give it more strength. I then zip-tied on 1/2" pipe insulation to give his arms a bit
more bulk.
And that is pretty much the project in a nutshell, a large nutshell, but still a nutshell.
Here is some video of the prop in action...
This page was last modified on: April 27, 2008 09:35:15 pm