Halloween Forum banner

1 - 18 of 18 Posts

·
Registered
Joined
·
877 Posts
Discussion Starter #1
I've been working this season on expanding my use of the Picaxe chip for controllers to use in my haunt. With hpropman coming up the concept and the help of Fritz42_male, we've come up with an inexpensive and easy to build controller utilizing the entry level Picaxe 08 to take an audio input and have it drive a servo for a talking skull. Cowlacious makes a great off the shelf unit, but I wanted to see if we could make one cheaper and with the ability to program it to better fit our needs. The basic board costs around $15 in parts if you order in quantity once you have the Picaxe download cable which runs about $20. The code for the board is very simple and you can just cut and paste it into the free editor.
So here is the basic board. I'll be modifying it yet to utilize the other 2 outputs in order to have it triggered by a PIR and to use one of the 300 second audio boards from Electronics123.



 

·
Bête noire
Joined
·
2,631 Posts
I found a number of useful things on Halloween2go, but I didn't see this one. They describe a servo driver using a Pic 16F84 chip. Is that the project you're referring to?
 

·
Registered
Joined
·
877 Posts
Discussion Starter #7
Any chance of getting a complete parts list for this or should I wait until your final mods?
Here's the parts list for the board as shown above.

Parts List for Picaxe 08 Audio/Servo Driver
PART PART NUMBER SUPPLIER COST EACH
1. PC Board 276-150 Radio Shack 2.19
2. 1/8 Phone Plug 274-286 Radio Shack 1.60
3. 5K Pot 43078 Jameco 1.25
4. 8 Pin Socket(2) 112206 Jameco .13
5. 0.1 Capacitor(2) 15229 Jameco .06
6. 10uF Capacitor 1946367 Jameco .05
7. Header 160882 Jameco .59
8. 1K Pot 253982 Jameco .95
9. 330ohm Resistor 690742 Jameco .03
10. 22K Resistor 691180 Jameco .03
11. 10K Resistor(4) 691104 Jameco .03
12. 2.2K Resistor 690945 Jameco .03
13. 1K Resistor 690865 Jameco .03
14. 47K Resistor(2) 691260 Jameco .03
15. N4148 Diode 179215 Jameco .05
16. LM1458 23131 Jameco .35
17. Microcontroller 08 Picaxe phanderson 2.65
18. 5V Power Supply PS-513 AllElectronics 4.50
19. Assorted Wire links


Even though I've started to modify the board already, I still need to decide on what I'll be using for an audio source and then I can update the parts list. Currently you'll just need to cut a few more headers, use a couple of resistors which you should have plenty of if you buy from Jameco since they sell them by the hundred and add the following components.
2N4401 Transistor 38421 Jameco .06
[FONT=&quot][/FONT]1N4401 Diode 35975 Jameco .05
5V Relay 2081414 Jameco 2.49[FONT=&quot][/FONT]
 

·
Registered
Joined
·
877 Posts
Discussion Starter #10
I finished the modifications and have the board running from the stereo audio board and being triggered by a PIR. The whole setup including the PIR, computer speakers, audio board and SD card, power supply and the audio jaw servo circuit came to less than $50.

[video=youtube;HWZ8H3VG7fo]http://www.youtube.com/watch?v=HWZ8H3VG7fo"][/url][url="http://www.youtube.com/watch?v=HWZ8H3VG7fo[/video]
 

·
Registered
Joined
·
877 Posts
Discussion Starter #11

·
Registered
Joined
·
877 Posts
Discussion Starter #13
Pshort has come through again and put together a schematic with the current modifications. My thanks to him for continually updating the schematic when I decide to make improvements. His work is greatly appreciated.

 

·
Registered
Joined
·
877 Posts
Discussion Starter #17
Here's the code I used for the current design which uses a single audio track of 15 minutes that I put together with Audacity -

'08 Picaxe Audio/Servo driver


'b1 byte variable 0-255 in 10uS increments.
'b2 Pause variable 0-65535 in 1mS increments.
'Hitec servo's like signals between 0.740 and 2.740 mS and period of 1 to 20 mS
'pin0 is to audio player
'pin1 is from audio driver
'pin2 is PIR
'pin4 is servo for jaw


Init: 'Just a starting point label
Pause 60000 'Wait 60 secs for PIR to 'settle down
Symbol delay = 5000 'Sets variable delay for making the whole thing wait for a while after pressing the button
Symbol time=b1

low 0 'Ambient audio or No audio

Testit:
readadc 2,b0
pause 5 'Brief pause on the checking loop
b0 = b0 + 5 * Pin2 'Pin 2 is PIR
if b0 < 100 then Testit

high 0 'Start audio

goto BEGIN

Begin:

w3=60000 'Counter for number of loops needed, every 1000 = about 15 seconds +/-

b2=8 'Set pause delay
b3=180 'Set Servo Min position and also offset - mouth open
b4=219 'Set Servo Max position - mouth closed
Servo 4,b3 'Initialises Pin4 as a servo output and sets servo to the start position

OP:

ADCA: 'Reads input voltage in 256 steps Pin 1 (leg 6)

Readadc 1,b0 'Read input voltage into b0
b1=225-b0+b3 'Add offset for servo's CCW output
If b1<b3 then gosub servomax 'Test for less than servo min position and if less, set at servo min
If b1>b4 then gosub servomin 'Test for more than servo min position and if more, set at servo max

MoveA: 'Move servoA
servopos 4, b1 'Pulse pin 4 (leg 3) width=b1 - Using servopos can help prevent jitter

pause b2 'Wait Delay b2


w3=w3-1 'Decrement the counter
if w3>0 then goto OP 'Test for counter being larger than 0 if yes, go round the loop again

goto Hold

goto OP

servomin:
b1=b3
return

servomax:
b1=b4
return

Hold:

low 0 'Stop audio or ambient track
for time = 1 to 30 '30 is the number of seconds of retrigger delay
pause 1000 'Pause for 1 sec
next time


goto Testit
 

·
Registered
Joined
·
877 Posts
Discussion Starter #18
I received the 5V power supply to run the wiper motor for the Kiwi controller board for the seance room and it works perfectly. All the components are happy and working together now.
The Kiwi board controls the entire scene. When the PIR is triggered, it starts a wiper motor on the rocking chair, starts the moving books, turns on the LED lights on both the books and the rocking chair, triggers the Tenda board to start and runs the jaw servo on the skeleton. After the skeleton says his piece, the audio, the rocking chair and its light stop. A second servo pushes down on the DVD remote and starts the Madame Leota projection. After it finishes, the moving books and its lights go off and the system waits for 60 seconds before it can be retriggered.
Everything including the PIR, Tenda board, Kiwi board, components, speakers and power supplies came to around $80 with the 5A power supplies costing $30 alone. I have to order some off Ebay to cut down that cost.
Here's a picture of the completed electronics package with the Kiwi board and the audio/servo driver using the Tenda stereo board.

http://http://
 
1 - 18 of 18 Posts
Top