# Push Button Servo Controller



## GCWyatt (Aug 30, 2012)

Hey Haunters, I need to tap the collective brain for some advice. Technically this question is for a costume, but it's technological in nature so I thought I'd find the best answers here. 

I'm building a Buzz Lightyear costume for my 4, soon to be 5, year old and I'm making the wings deploy-able. I've gotten pretty far on the mechanical part, but now I need to build the servo controller and I'm thinking a Picax would be perfect. I've also, PM'd Halstaf as I've built his Frankenstein Controller and that's what got me thinking the Picax would work well. I'm thinking I'll use the PICAXE-08M Servo Driver Kit but I want to bounce it off of you to make sure this is the right way to go. I need to to run the servo forward when the button is pushed, and then run it in reverse when the button is pressed again. Fairly simple. Even I should be able to program that. What do you think, am I on the right track or is there an easier way to go?


----------



## JeffHaas (Sep 7, 2010)

That sounds like the best choice for the costume. That Picaxe board can control up to four servos, if you need two for each wing, and a button.

The challenge with this build is making the wings deploy and fold back reliably. Also, picking the right servos that have the power to open and close the wings may be a challenge. The other thing will be providing a big enough battery pack so that the servos don't drain the battery too fast. 

I checked the docs for the board, it can use a 5V regulated power supply, so one of those cell phone charger packs will work great. Then you'll have to figure out how to cut an old USB cable to provide the power to the board.

If you need programming help, ask on the Picaxe forum - they are a great group over there and very helpful. It's the sort of fun project they will like to hear about, too.


----------



## jabberwocky (Apr 30, 2008)

Just chiming in with alittle input.
USB cables are.... Pin1+, Pin4-.
Pins 2 and 3 are data.
The positive and ground are usually the correct red and black when looking for the wires.
The data wires are most commonly white/green or orange/yellow.
Just my 2¢.
Goodluck.
Robert


----------



## Lightman (Aug 25, 2014)

I agree with the above... the 08M2+ will work fine. 

You might also want to add an audio module like MDFly's AU5016 that has 8 dsicrete triggers for sound effects. Bring a pin low triggers that sound effect. These are mp3 or wav files stored on an SD card.

Your son could press a button on his chest and the sound board would belt out "To infinity and beyond!" ( in Tim Allen's voice). Press another button on his chest and it again and it would say "I'm Buzz Lightyear, Defender of the universe"...etc etc.

Also, a "whoosh!" sound effect could be synchronized with the opening of the wings. Just say'in....

If you need help, let me know. I can code it up for you.


----------



## Lightman (Aug 25, 2014)

I kept thinking about this prop and decided to do a quick prototype (proof of concept)so you could see what can be done with an 08M2+ PICAXE, an AU5016 audio module, SD card, servo, and push buttons.

So I cobbled together a quick circuit with proccessor and audio module that has 2 input buttons. I then coded up a small program to demo the concept.

Button#1 controls the wings and sound effects while Button#2 fires off various Buzz lightyear phrases. These buttons would be placed on the chest... as in the toy.

This prototype runs on 3 AA batteries and a small mp3 speaker. The real prop would need to scale these up along with the servo.

Heres a quick demo video of the system in operation. You are welcome to the code.
Buzz Lightyear Prototype on Vimeo

Have fun!


----------



## FistJr (Nov 11, 2014)

Haha! Anyone else think Lightman is a major Toy Story fan?!? This project seemed to fire him up!


----------



## JeffHaas (Sep 7, 2010)

Brian, that's great! Post the code!


----------



## jabberwocky (Apr 30, 2008)

Mr. Light man, you are freakin MONSTER!
And I totally mean that in the best way.
I don't know how to "like" a post, but I "like" that a million times.
Robert


----------



## GCWyatt (Aug 30, 2012)

I. Am. In. Awe.

I post a question and Lightman runs with it and creates a working prototype. Wow. Just wow.

So, just so you all don't think I'm resting on my laurels, here's my mechanical prototype.









Scissor mechanism closed









Scissor mechanism open









Reverse side

I have some issues with binding and clearance, but I expected those. I'm debating now how I really want to mount the wings, as in, do I really want the hassle of mounting the entire mechanism inside the wing, or can I live with some of it showing when deployed.

As for electronics, it looks like the Picax is the way to go, but should I go with the kit I found online, or build a custom 08M2+ servo controller like Lightman?

I been thinking about audio, too. I've used this device twice with terrific results:
http://www.electronics123.com/shop/...utes-usb-recording-module-with-4-buttons-5320
But the AU5016 audio module is very interesting, especially the 08M2+'s ability to control it via TTL. I just have no experience programming this. Lightman, if you want to help I'll gladly take your code!

And lastly, we are all on the same page about power supply. I bought one of these two weeks ago for this project:
https://www.amazon.com/gp/product/B...=1&updatePaymentsPortalPreferenceSuccess=true


----------



## Lightman (Aug 25, 2014)

Very nice mechanism. I like the power supply too.

I will publish code and schematic later today.

BTW... the board I used is the standard picaxe protoboard kit. I use the breadboard protoboard to connect things fast, but you can use the supplied Proto PCB area on the picaxe kit.

One another Note: The 08 M2 Series has been known in the past to have minor glitches in the pulse width modulation background tasks (the ones that run their servo command). These minor glitches every now and then will tweak the servo. My understanding is they made improvements to the firmware and these latest 08 M2+ chips and are supposed to have a better background task. That said, I have still seen minor little burps here and there.


----------



## GCWyatt (Aug 30, 2012)

Thank you very much, Lightman, for the help and the compliment.

I'll order the parts today. I'll also switch this discussion over to the costume board. I think it would be more appropriate now.

I noticed the twitching of the servo in your video. I'm hoping having a little weight on the servo will dampen the PWM noise.


----------



## iowachap (Aug 19, 2015)

a fourbanger controller could work too I figure, and with the Uno has a USB port that can be used for power, thus a nice size usb battery bank could power it very easily..


----------



## David_AVD (Nov 9, 2012)

I reasonably sure the USB power goes through a diode, so there will be a lowish limit on how much current you can pull from boards 5V pin(s).

Servos can pull a bit of current under load so you may be better off powering it directly from the 5V source.


----------



## Lightman (Aug 25, 2014)

Here is the schematic and code for the Buzz Lightyear prop based on the 08M2+ PICAXE processor.










Have Fun!


----------



## GCWyatt (Aug 30, 2012)

Thank you so much, Lightman! You've saved me precious weeks of trial and error!


----------



## GCWyatt (Aug 30, 2012)

Lightman, I've gone through the code and I am humbled by the detail. You've documented everything. I am so grateful. Thank you again.


----------



## Lightman (Aug 25, 2014)

GCWyatt said:


> Lightman, I've gone through the code and I am humbled by the detail. You've documented everything. I am so grateful. Thank you again.


Thanks for the kind words. I like tinkering with various props and like to help out when I can.

The documentation is a habit I picked up years ago. It helps me keep track of what I did as well as help others.

I can't wait to see your invention operating. Your son is going to love the costume.


----------



## Lightman (Aug 25, 2014)

So any update on the Buzz Lightyear costume?


----------



## GCWyatt (Aug 30, 2012)

Sorry for going radio silent. Life got really, really busy around here. So busy I didn't even totally decorate this year. No lights, sound or fog, didn't finish my triggered coffin lid, and didn't get to finish the Buzz Lightyear wings. When we got the Disney Store costume (originally I was going to use it for the base of the costume I was building) my son was so delighted with the strap on wings we decided to just scrap the plans for the pop out wings. 

Anyway, here's pics of my kids, including the amazing home made Rapunzel costume my mother-in-law made.


----------



## RoxyBlue (Oct 6, 2008)

Awwww, so adorable!


----------



## Lightman (Aug 25, 2014)

Very cute! They all came out great!


----------

