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.
Very nice indeed! And for next to nothing. Is the code specific to the music/vocal track being played in the video, or is the chip programmed to respond to any audio input?
The chip is designed for any audio input just like the Cowlacious board. I'm using a split track with the tones which I feel gives much better response. The video is a small part of the routine my bar room singer is going to do. It was some extra work but looks much better plus it's really the only way when you're trying to get the skull to sing a song without a separate vocal track.
Yes, the program to convert the audio to the servo movement is very short. Here's what I'm starting with -
'08 Picaxe Audio/Servo driver
'#Picaxe 08M2
'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
'C.0 is to audio player
'C.1 is from audio driver
'C.2 is PIR
'C.4 is Greeter jaw servo
Do
PIR_COUNT = PIR_COUNT + 1 * PIR_IN
Loop Until PIR_COUNT = 10
PIR_COUNT = 0
goto Routine
Routine:
Servo C.4,205 'Initialises Pin4 as a servo output and sets servo to the start position
pause 500
serout C.0,4800,($01) 'Start playing first mp3
pause 500
Begin:
w3=5000 'Counter for number of loops needed, every 1000 = about 15 seconds +/-
b2=8 'Set pause delay
b3=178 'Set Servo Min position and also offset - mouth open
b4=204 'Set Servo Max position - mouth closed
Servopos C.4,b4 '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 C.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 C.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:
servopos C.4,212
pause 500
low C.4
for time = 1 to 15 '60 is the number of seconds of retrigger delay
pause 1000 'Pause for 1 sec
next time
goto Testit
I'm using a regulated 5V power supply to run the board and the servo and it seems to work fine.
I've modified the board to utilize the other 2 outputs and plan to have it triggered by a PIR. I'm using the Tenda triggerable audio device that outputs in stereo so that I can use a tone track to activate the servo.
Hey, Steve, have you tried running this board with a 4AA (6VDC) source? I've used 4AA packs for a while for running Cow boards/servos. You need to have a spare pack available but the portability is nice.
I haven't tried it with this board but it should work. I used battery packs for a couple of the Cowlacious boards myself last year and they really seemed to eat the batteries so this year I switched all of them to wall warts. I use the powered computer speakers which need to be plugged in anyway so that shouldn't be an issue for my haunt.
Don't try running a Picaxe at anything higher than 5V - it will fry quickly. Even 5.5V is too much.
Maybe there is room for a regulator on the layout - a 78L05 wouldn't do the job as you need about 1.5V more than the regulator's rating but there are other regs around that would do the job. They are transistor size as well so not much increase in size.
Thanks, fritz. I was wondering about the voltage capabilities of the Picaxe. And yeah, a 7805 needs a couple of volts for headroom. Sounds like the regulated supply is the best solution.
Sorry I missed that. Last year I was using Fritz's VLC board and it has the capability to use split power supplies. I used 3 AA for the Picaxe and a 4AA battery pack to run the servos.
There are a lot of 5V LDO (low dropout) regulators available. One that I've used in the past is the LP2950CZ-5.0, which comes in a TO92 package and has the same pinout as the LM78L05. With a 100 mA load it should keep regulating with an input voltage as low as 5.45V.
Damn ... still have no clue what you guys are doing, but its freakin cool! Is anybody going to be building these boards for sale to the less inclined who can't build it?
Exactly. I have an RCA splitter coming from the computer with the tone track going to the board and the other track with the audio going to the computer speakers.
Here's the stereo board that I'll be trying. It's had great reviews on the Picaxe forum but there are only 8 left in stock. It sounds like they don't always have them so you need to jump on it when they are in stock. Great price as well at $10!
Halstaff is correct except that if the speaker lowers or raises his voice the jaw either may not open at all or stay open during the louder sections. That is why the tone track works better. Play the tone track on one channel and the voice on the other channel. you can just record yourself saying Baaaa or something like that and use that sound where you want the jaw to open at in sync with the voice track.
I don't as I designed it on PEBBLE. If you would like to download PEBBLE, it's free and I would be happy to provide the code so that you had bring individual items up and move things around. You can find it here - http://www.picaxeforum.co.uk/showthread.php?t=12629&highlight=pebble
If you'd rather not go that route, I've labeled the resistors in this picture -
You da man! That helps immensely, thanks!
Downloaded Pebbles, as well.
A little off topic-how long can a servo run before it overheats/conks out/ gives up the ghost. I building a 3 axis witch and not sure if I want her to be triggered or just let her run.
Mine are triggered so I'm not sure how much continuous duty they can stand.
I'm working on another Picaxe upgrade to this circuit. It will be able to control two 3 axis skulls with 2 servos for eyes as well as the audio circuit. It won't require programming individual movements but instead will rely on random movement. If it works out like I hope, all you'll have to program is the minimums and maximums for the servos.
I know there aren't many people interested in these circuits but I'm having fun learning and building them. They're allowing me to add an incredible amount of animation to my haunt and I'm not breaking the bank.
Send me a PM with your email and I'll pass along the PEBBLE code for the circuit.
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Related Threads
?
?
?
?
?
Haunt Forum
900.7K posts
23.6K members
Since 2004
A forum community dedicated to Haunting and Halloween enthusiasts. Come join the discussion about collections, displays, models, styles, scales, reviews, accessories, classifieds, and more!