Mestro 6 sound sensing animatronic

My partner has convinced me to build an animatronic parrot head (the one on Mary Poppins umbrella) to compare a theatrical performance at the Mary Poppins Festival she coordinates here in Australia.

I have built the parrot head, got the eyes moving left and right as needed, the beak opens and closes when the Voice actor holds down a button and all is good.

What i am thinking of doing is placing a sound sensor for each ear, and then testing the difference in volume between each to determine the direction to the source, and use this to drive a servo to turn the head to face the sound. Then after a period of time return to face forward.

I will probably use a seperate servo so as not to inhibit speech and eye movement.

What I am looking for is suggestions / code snippets to help me get my head around the comparison of two inputs.

I think something like

  If the level of left ear minus level of right ear is less than zero then
            turn head left
  Else if the level of left ear minus level of right ear is greater than zero then
            turn head right
  Else if the level of left ear minus level of right ear equals zero then
            Return to home
  End If

Any comment suggestion or code snippet appreciated.

Thanks Robert

Sorry, I suggested using another servo, I meant Maestro controller.



That sounds like a cool project, and we would love to hear about how it goes for you.

Anyway, your pseudocode does not look much like a Maestro script. Are you familiar with the Maestro scripting language, and have you looked at the example scripts in the User’s Guide? There are a lot in there that show how to use input channels. I recommend that you start with the simplest possible program, gradually add features, and post specific code here if you get stuck.


Hi Paul,

You are right about the pseudo code, and you can probably tell I am a VB/Basic/Pascal programmer from school days.

I have reviewed the manual and searched through the forum, and have a bit of a concept but am very much learning as I go. I will certainly post my progress, and yes plan to start simple and build it to the final product.

I really just posted to see if someone might just post a “I have just done that and here is how…” reply. (No point re-inventing the wheel from scratch)