# PICaxe and Scary Terry controlled talking skeleton



## tstraub (Feb 26, 2012)

I just wanted to post a short video of my newest prop. This little skeleton has 2 axis random head movement controlled by one of Halstaff's EZ-4 controllers. and a jaw servo controlled by a Scary Terry style sound to servo board. Its all completely stand alone with no computer needed. The head moves around at random while he is not talking and always looks straight forward while he is talking.


----------



## SoCal Scare (Aug 3, 2007)

Very cool little skeleton, I would love to make one of these some time. They definitely seem to have gotten a bit easier thanks to all the ingeniouse hunters out there.


----------



## RoxyBlue (Oct 6, 2008)

I know a project like this is probably straightforward for you techie guys, but I always see it as almost like magic The random movement and the ability to "know" to look forward when speaking in the absence of a computer are just impressive to me. Yes, I know it's programming, but it's still way cool.


----------



## Otaku (Dec 3, 2004)

Sweet! Is that a foam skull? It looks pretty lightweight. Nice skellie, tstraub!


----------



## Hairazor (Mar 13, 2012)

One hot little dude!


----------



## tstraub (Feb 26, 2012)

The skull is made of very thin plastic and is very lightweight I got 4 skulls on eBay several months ago for $13 shipped but the seller does not have any listed for sale now. The rest of the skeleton was from Lowes and did not have a movable jaw so I gave it a skull transplant.


----------



## Dead Things (Apr 4, 2009)

Great job, if that seller has those skulls again, could you let us know? You said you modified halstaff's code, could you post it?


----------



## tstraub (Feb 26, 2012)

I can post the code sometime in the next few days. The current code needs some cleaning up. Lots of comments that refer to old code need to be updated to the new code.


----------



## halstaff (Nov 18, 2009)

That looks awesome Tyler! I'm anxious to see the new code as well.


----------



## tstraub (Feb 26, 2012)

Well here is the code. The code I started with uses the directions left/right for both side to side and up/down. I didn't bother to change it as I think it is easy enough to follow. I believe my edits are commented well enough that anyone with some PICaxe experience should be able to wrap there head around it. If you have any questions I would be happy to help out any way I can.


```
symbol counter = b9
symbol pointer = b8
symbol delay = 20
symbol counter1 = b19
symbol pointer1 = b18
symbol delay1 = 20
symbol talk_count=b1

start0:  ;up/down
	let b8=140 'set pointer offset so that head loop does not get stuck
	let b6=150
	let b7=150 'set default center values
	let talk_count=1


	servo C.1,pointer 'center servo
	pause 6000  'full motion range test
	for counter = 140 to 100 step -1 'move head from middle to right side
	servopos C.1,counter
	pause delay
	next counter
	pause 3000
	
	for counter = 100 to 190 step 1
	servopos C.1,counter 'move head from right to left
	pause delay
	next counter
	pause 3000
	
 	for counter = 190 to 140 step -1
	servopos C.1,counter 'move head from right to middle
	pause delay
	next counter
	pause 2000
 
 
move: 
	random w3 'place a random number in wo (also B0 & B1)
	if talk_count>100 then talk ;check for talking
	if b7<120 then left 'check for random left
	if b7>=120 and b7<150 then middle 'check for random middle
	if b7>=150 then right 'check for random right
	goto move 'keep moving the head back to move loop
 
 
right: 
	if pointer = 100 then move 'if head is already Right goto back to move
	if pointer = 140 then mr 'check to see if head in pointed middle or the left
	for counter = 190 to 100 step -1 'move head from left side to the right side
	servopos C.1,counter
	pause delay
	next counter
	pointer = 100 'set head pointer direction to right
	goto skipmr
 
mr: 
	for counter = 140 to 100 step -1 'move head from middle to right side
	servopos C.1,counter
	pause delay
	next counter
	pointer = 100 'set head pointer direction to right
 
skipmr: 
	for b2=1 to 140
	if talk_count>100 then talk
	pause 50 'delay to look natural
	next b2
	goto move 'return to move loop
 
middle: 
	if pointer = 140 then move 'if head is already in the middle then go back to move
	if pointer = 100 then ml 'check to see if head is pointed left or right
	for counter = 190 to 140 step -1
	servopos C.1,counter 'move head from right to middle
	pause delay
	next counter
	pointer = 140
	goto skipml
 
ml: 
	for counter = 100 to 140 step 1
	servopos C.1,counter 'move servo from left to middle
	pause delay
	next counter
	pointer = 140
 
skipml:
	for b2=1 to 160
	if talk_count>100 then talk
	pause 50 'delay to look natural
	next b2
	goto move 'return to move loop
 
left: 
  	if pointer = 190 then move 'if head is already left then return to move
	if pointer = 100 then lmr 'check if the head is in the middle or the right
	for counter = 140 to 190 step 1
	servopos C.1,counter 'move head from middle to left
	pause delay
	next counter
	pointer = 190
	goto skiplmr
 
lmr: 
	for counter = 100 to 190 step 1
	servopos C.1,counter 'move head from right to left
	pause delay
	next counter
	pointer = 190
 
skiplmr: 
	for b2=1 to 180
	if talk_count> 100 then talk
	pause 50 'delay to look natural
	next b2
	goto move 'return to move loop

talk: 
	if pointer = 140 then move 'if head is already in the middle then go back to move
	if pointer = 100 then ml 'check to see if head is pointed left or right
	for counter = 190 to 140 step -1
	servopos C.1,counter 'move head from right to middle
	pause delay
	next counter
	pointer = 140
	goto move
 
start1: 'Side to Side
	let b18=173 'set pointer offset so that head loop does not get stuck
	let b16=130
	let b17=130 'set default center values
	servo C.4,pointer1 'center servo
	pause 8000 'full motion range test
	
	for counter1 = 170 to 155 step -1 'move head from middle to right side
	servopos C.4,counter1
	pause delay1
	next counter1
	pause 3000
 
	for counter1 = 155 to 180 step 1
	servopos C.4,counter1 'move head from right to left
	pause delay1
	next counter1
	pause 3000
 
	for counter1 = 180 to 170 step -1
	servopos C.4,counter1 'move head from right to middle
	pause delay1
	next counter1
	pause 2000
 
 
move1:
 	random w8 'place a random number in wo (also B0 & B1)
	if talk_count>100 then talk1
	if b17<155 then left1 'check for random left
	if b17>=155 and b17<170 then middle1 'check for random middle
	if b17>=170 then right1 'check for random right
	goto move1 'keep moving the head back to move loop
 
 
right1: 
	if pointer1 = 155 then move1 'if head is already Right goto back to move
	if pointer1 = 170 then mr1 'check to see if head in pointed middle or the left
	for counter1 = 180 to 155 step -1 'move head from left side to the right side
	servopos C.4,counter1
	pause delay1
	next counter1
	pointer1 = 155 'set head pointer direction to right
	goto skipmr1
 
mr1: 
	for counter1 = 170 to 155 step -1 'move head from middle to right side
	servopos C.4,counter1
	pause delay1
	next counter1
	pointer1 = 155 'set head pointer direction to right
	goto move1 
	skipmr1: 
	for b2=1 to 14
	if talk_count>100 then talk1
	pause 500 'delay to look natural
	next b2
	goto move1 'return to move loop
 
middle1: 
	if pointer1 = 170 then move1 'if head is already in the middle then go back to move
	if pointer1 = 155 then ml1 'check to see if head is pointed left or right
	for counter1 = 180 to 170 step -1
	servopos C.4,counter1 'move head from right to middle
	pause delay1
	next counter1
	pointer1 = 170
	goto skipml1
 
ml1: 
	for counter1 = 155 to 170 step 1
	servopos C.4,counter1 'move servo from left to middle
	pause delay1
	next counter1
	pointer1 = 170
 
skipml1: 
	for b2=1 to 180
	if talk_count> 100 then talk1
	pause 50 'delay to look natural
	next b2
	goto move1 'return to move1 loop
 
left1: 
	if pointer1 = 180 then move1 'if head is already left then return to move
	if pointer1 = 155 then lmr1 'check if the head is in the middle or the right
	for counter1 = 170 to 180 step 1
	servopos C.4,counter1 'move head from middle to left
	pause delay1
	next counter1
	pointer1 = 180
	goto skiplmr1
 
lmr1: 
	for counter1 = 155 to 180 step 1
	servopos C.4,counter1 'move head from right to left
	pause delay1
	next counter1
	pointer1 = 180
 
skiplmr1: 
	for b2=1 to 140
	if talk_count> 100 then talk1
	pause 50 'delay to look natural
	next b2
	goto move1 'return to move loop

talk1: 
	if pointer1 = 170 then move1 'if head is already in the middle then go back to move
	if pointer1 = 155 then ml1 'check to see if head is pointed left or right
	for counter1 = 180 to 170 step -1
	servopos C.4,counter1 'move head from right to middle
	pause delay1
	next counter1
	pointer1 = 170
	goto move1
	
	
	;this section of code is used to check for talking active low siginal
	;from pin1 of the 4066 chip of the ound to servo board
	;you will also need to install a 10k pull-up resistor from +5 volt to C.2 
start2:  
	if pin2=0 then goto talking
	if pin2=1 then goto not_talking
	goto start2
	
talking:
	let talk_count=talk_count+20 max 200
	goto start2
	
not_talking:
	let talk_count=talk_count-1 min 1
	pause 200 ;delay the transition from talking to not talking increase this number for longer wait time before returning to random head movement
	goto start2
```


----------



## tstraub (Feb 26, 2012)

It just occurred to me that if you are interested in the code that you might also like a description of how I connected the two boards together. They say a picture is worth a thousand words and I am a slow typer so here is a picture.

View attachment 2796


----------



## Spooky1 (Aug 25, 2008)

Nice job. I've really got to learn how to do this kind of thing someday.


----------



## tstraub (Feb 26, 2012)

Dead Things said:


> Great job, if that seller has those skulls again, could you let us know? You said you modified halstaff's code, could you post it?


I was at my local Menards store NOT shopping for Halloween props. Somehow I found myself in the seasonal decoration section of the store. This is a habit that until this year only happened from November to January. I came across this little guy. It is the exact same skull as I used but mounted to a different body.

The skeleton would not have been my first choice for my joking skeleton but if you were going for creepy this one would be a great one to use. The skull does have a few holes drilled in it but I think you could work around them. Both eyes are drilled and fitted with LEDs. Pin C.0 of the PICaxe chip is currently unused in my firmware so you could make use of those LEDs. It also has a fairly large hole in the rear of the skull for the batteries and LED circuitry. Maybe put a hood or something on him to cover that hole.

Anyway after much thought I put him back on the shelf. I'll keep an eye on the local stock and gamble on getting one or two in the post season sales for a next year build. Thanks a lot Steve I was perfectly happy in my world filled with candy canes and ginger bread cookies. Why did I ever take a walk in your world of tootsie rolls and peanut butter cups.

Tyler


----------



## hpropman (Jul 27, 2008)

Hey nicely done! That code looks like it started out as my random head movement program, I am Glad that you were able to adapt it to your needs. If you need the MP3 files for the joking Skellies I have the Joke track and the who is on first slab routine.

Halloween 2007 :: Halloween 2007 video 3 video by jmalt31 - Photobucket

Halloween 2008 :: Video_0009.mp4 video by jmalt31 - Photobucket


----------



## Northrad (Jan 8, 2009)

Wow Tyler!
I like it and think I'll dare to do it "this" year even though it's this late in the game. Thanks...I think I'll now have a skeleton driver in my Sarasota Wagon. Something was missing and my static prop wagon driver was not gonna get it.

Come on China...waiting on some parts -hehe


----------



## Xpendable (Sep 19, 2006)

Nice job on this. I like the code tweaks you did. Very cool!


----------



## Otaku (Dec 3, 2004)

Tyler, did you happen to get any pics of the servos and mounting hardware? I've been wanting to do a 2-axis skull for a while now - this looks like just what I need for my porch display.


----------



## tstraub (Feb 26, 2012)

I did not get take pictures while assembling it. It is just one servo glued to the horn of the other. I'll try to get some pics of it later today or tomorrow.

Tyler


----------



## Otaku (Dec 3, 2004)

Cool, thanks.


----------



## tstraub (Feb 26, 2012)

Well, I snapped a few pictures. I hope they help it's hard to see much after it is assembled. Everything is held together with hot glue so it would be difficult to disassemble for better pictures. I tried to turn the neck in several positions and snap pictures from different angles so maybe you can see what is going on. The rotate servo is glued to the neck with the horn facing up. The nod servo is glued to the horn of the rotate servo and rotates with the head. There is an L bracket that attaches the nod servo horn to the back of the skull. This method worked well for this skull because it is very light weight it is probably not suitable for a heavy skull.

View attachment 2825


----------



## tstraub (Feb 26, 2012)

hpropman said:


> Hey nicely done! That code looks like it started out as my random head movement program, I am Glad that you were able to adapt it to your needs. If you need the MP3 files for the joking Skellies I have the Joke track and the who is on first slab routine.
> 
> I guess I missed this post. Looks like I may have credited the wrong guy as the creator of the random movement code. Thank you for putting the code out there for the rest of us to use. It was just what I needed to get started on this project. Your skeletons are great. Thanks for the offer but I don't need the MP3 this guy will be run with a microphone so he can call the kids by name as he passes out the candy. I might add some of the jokes to our joke list.
> 
> Tyler


----------



## Otaku (Dec 3, 2004)

Good pics, thanks Tyler. I'm having trouble getting a perspective on the jaw servo, though, it looks like its mounted sideways relative to the direction that the jaw will be moving. Is it just the camera angle, or do you have a cool new way to make the jaw linkage?
What servos did you use for this guy? Instead of using a PicAxe I was planning to get a 2-channel PicoTalk for the nod and rotate servos and use either a Cow or AutoTalk board for the jaw.
Thanks again!


----------



## tstraub (Feb 26, 2012)

All 3 servos 2 neck and 1 jaw are Turnigy 9 gram servos I got them here. The jaw servo is turned sideways from the direction the front of the jaw moves but if you connect the linkage to the lower rear part of the jaw that part does move forward and back as the jaw rotates on its pivot point. I chose to mount the servo this way because of limited space and access. The servo is all the way forward and setting against the back of his nose out of the way of the other servos. When I got the skull the jaw was binding badly up near where it screws on. I solved this by removing the screws and remounting the jaw slightly forward and lower than it originally set. This gave him a very slight under-bite but it now moves smoothly. I have linked to a short video of the jaw linkage in action.


----------



## Otaku (Dec 3, 2004)

Aha! Now I see how the movement translates. Thanks, the video cleared everything up.


----------

