The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 8, 2015 20:56:37 GMT
Hey Jerome, and everyone! I haven't seen much activity on this site for quite a while and actually thought maybe it had been dropped, then all of a sudden today when I checked, it has a new look and tons of activity! Jerome, you helped me a ton last year at halloween on moving a prop I called the "Nullifier Ray ". It worked fabulously and I couldn't have done it without you. This year, I'm doing a swamp witch theme and have built an animatronic raven as the centerpiece. Everything is working pretty well (for my experience!), but I'm trying to get the beak servo to move in sync with the sound of a raven cawing. I'm totally lost and would appreciate any help anyone could provide. I'm using the pololu mini maestro controller, which will accept an mp3 controller, but I have no idea how to hook them together and definitely no idea how to write the code to make all of it happen. I know it seems like I've waited till the last minute on this, but I actually thought the sound chip was integrated into the pololu controller, so was caught off guard when I found out it wasn't! If anyone has any ideas or suggestions for me, I would be very grateful! Thanks.
Holly
|
|
|
Post by Honus on Oct 9, 2015 3:02:21 GMT
Hi Holly! Glad that worked out for you last year- be sure to post some pics or video! I too have a mini maestro but I haven't had time to play with it yet. As I understand it you can make one of the maestro output pins digital (it goes either LOW (off) or HIGH (on) when your control script tells it to do so. Have a look here for more info- forum.pololu.com/viewtopic.php?f=16&t=5394What sound board are you using? If it's something like the Adafruit board you then use a transistor to pull the audio board input pin to ground to trigger it. If you need help with that let me know!
|
|
The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 9, 2015 4:03:49 GMT
Jerome, you're so awesome to get back to me so soon! I actually read all that stuff on the Pololu site, and I guess it's just not sinking in for me. I haven't yet bought a sound board, because I just keep reading different things and getting myself so much more lost. The thing I love about the Maestro controller is that I don't have to write a script, lol. It has sliders that control the servo movements, you click to capture that particular movement as a "frame", and put as many frames together as you want for a sequence. Then you can just copy that to the board and it works! It's literally a servo controller for dummies, lol. I never could get the script language down for the arduino, and I think that's what's "blocking" me on this. All the numbers in the script language to make different things work don't make sense to me. I've seen examples of other people having done what Im trying to do on the Halloween forum, but I can't seem to get ahold of anyone to "borrow" off what they've already done! I'm thinking if I could see someone else's script, and then watch it work on my prop, it'd click for me....sorta like after you drew me the diagram for the Nullifier last year! Once I saw it, it made perfect sense, but when I was trying to figure it out myself, I just couldn't get anything to work out. I appreciate the link, and I'll keep reading....maybe it'll click for me soon. If not, at least I've still got a cool raven whose body moves up and down, and head moves left and right and up and down. That's a major improvement over where I was this time last year! And the beak moves....just not in sync with any sound, lol. Yet!
|
|
|
Post by Honus on Oct 9, 2015 4:55:25 GMT
I'll take a look at my board and see if I can figure something out. For a soundboard have a look at the Adafruit FX board. It's about as user friendly as it gets and no programming necessary! www.adafruit.com/product/2210
|
|
The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 9, 2015 12:19:16 GMT
Holy cow, that board sounds amazing! I'll order one today, along with a speaker.
I think I understand how you're saying to hook it up, but does that mean that the sound will automatically play when my servo is triggered? Or does it work the other way around, when the sound plays, the servo is triggered?
I just can't tell you how helpful and kind you are to answer all questions that come to you. It's very rare these days, and you really do make a difference to people like me that want to learn, but just struggle with it.
|
|
|
Post by Honus on Oct 12, 2015 3:59:37 GMT
Happy to help!
You could set it up either way in your script. I'd probably set it up so the you trigger the sound first and then immediately have your servo movement.
|
|
The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 13, 2015 2:35:12 GMT
Now I'm definitely confused, I thought I didn't have to write a script if I use this adafruit board?
|
|
|
Post by Honus on Oct 13, 2015 4:27:14 GMT
Sorry for the confusion! In order to trigger the sound board you have to turn one of the Maestro's channels on and off- you use the channel as a digital output. You need to connect the channel signal pin to the sound board using a transistor. I can make you a diagram.
I'll download the software for my micro maestro after work tomorrow and see if I can get it working like how you want.
|
|
The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 13, 2015 13:07:42 GMT
Thanks Jerome, sorry for being so confused. I really appreciate you working on something just to help me understand it.
|
|
|
Post by Honus on Oct 13, 2015 18:27:09 GMT
Not a problem! This way I can figure it out for myself too. I've had this little board for a while and I've been meaning to delve into it so it'll be a good learning experience. 
|
|
The Tinkerers Apprentice
Guest
|
Post by The Tinkerers Apprentice on Oct 13, 2015 23:03:54 GMT
You're awesome!
|
|
|
Post by Honus on Oct 14, 2015 4:43:15 GMT
OK so I played with it today and it's super easy to do. I have to say it's a really neat board too.
Here's how you do it-
In the control panel go to Channel Settings and click on the channel number you want to use to activate your sound board. Note that you cannot have a servo and sound board connected to the same channel so with the Micro Maestro you won't have more than five servo channels sine you'll be giving up one channel to control your sound board.
Change the Mode button from Servo to Output.
For that channel on the button marked "On startup or error" make sure the tab says "Go to".
Now click on the Status button so you can set the position of each servo and make your sequence.
The channel number you changed from Servo to Output should now be named Digital Output and be labeled as an output.
Click on the box for that channel to enable it.
Move the slider for that channel all the way to the end so the target value reads 2000.
Set your servos for their normal position where you want them to be when your sequence starts.
Save this as your first frame for your sequence.
Now set up your next sequence and set your next servo positions.
Set your slider for your Digital Output channel to the minimum position.
Save this as your second frame in your sequence.
Continue to create new frames for your servo positions but for each new frame make sure the Digital Out channel slider is set to the minimum position.
So how this works is when the Maestro is powered on your sequence will begin- the servos will begin to move and your sound board will be triggered on. The Digital Out goes to max output and turns on the soundboard (it will actually turn on a transistor that pulls the soundboard input pin to ground, which triggers the sound.) You only need this to turn on for a split second to activate the sound board so when the next frame is played the Digital Output will turn off. Your audio file will continue to play until it's over.
When you set the sliders for the Digital Out channel to their maximum and minimum positions you're effectively turning that Digital Out channel on and off so it acts like a switch. Does that make sense?
I'll make you a diagram that shows how to connect the sound board using a transistor.
|
|
|
Post by Honus on Oct 14, 2015 6:12:29 GMT
Here's the wiring diagram. What you're going to do is connect a triggering pin on the FX sound board to the Micro Maestro using a transistor. You can do this with any of the output channels of the Maestro and any of the triggering pins on the sound board. In the Adafruit tutorial for the sound board they connect the triggering pins to ground with a push button- we're simply replacing the push button with a transistor. Think of the transistor as an electronic switch- when the transistor is turned on current is allowed to flow through it and it connects the triggering pin to ground. The type of transistor we're going to use has three pins- a base (B), collector (C) and emitter (E).  Before you do anything make sure that your audio file is properly uploaded to the sound board and it plays when you ground the correct trigger pin (see the Adafruit tutorial if you need help with that.) Pick the channel of the Maestro you want to use to turn on your sound. Connect the signal pin (normally where a yellow servo wire is connected) of the output channel on the Maestro to the base (B) pin of the transistor using a 1K Ohm resistor. The resistor is there to protect the output pin of the Maestro. Connect the ground pin of the Maestro to the emitter (E) pin of transistor and to the ground pin of the FX sound board. Connect the pin you want to trigger on the sound board to the collector (C) pin of the transistor. Now the sound board should play your desired audio file at the beginning of your servo movement sequence. Several different transistors will work- I usually just use a TIP 120 transistor (a bit overkill but who cares) as I have lots of them and they're dirt cheap. They are readily available at most any electronics shop. You could also probably use a PN2222 transistor. You can also control the FX sound board using serial commands (which is really neat) but I figured this would be easier for you since there's no programming involved. I don't have a sound board to test this out myself but I'm pretty sure this will do the trick. Let me know how it works out!
|
|
|
Post by The Tinkerers Apprentice on Oct 14, 2015 12:12:19 GMT
That all actually made perfect sense to me....I must have woke up in an alternate reality this morning! My sound board should be coming in today, and I bought some transistors a while back for another project, so hopefully they'll be the right kind. I've got plenty of various resistors so I should be ready to go when the board gets delivered. I'll try to post a video with my results, I'm very excited! Thank you again so much, you really go above and beyond to help. You're an amazing person!
|
|
|
Post by The Tinkerers Apprentice on Oct 16, 2015 21:05:49 GMT
Okay, so the soundboard came 2 days late but I've just now got everything wired together (actually just taped together for now!), but no sound is happening. Do I need to power the sound board seperate from the Maestro controller? I thought it would power on through the controller but it doesn't appear that it's getting any power. Also, I'm using a 2N 3904 transistor...could that be the problem? This just occurred to me too, the audio I'm wanting to play is the Raven "caw" sound, not any music, so should I be trying to make the sound trigger the servo instead of the servo triggering the sound? Cause otherwise I'm not going to know where in my sequence to make the beak move.
|
|