[ DONE! ] Need Help with Talking Head

I have an Arduino UNO and starting my first big project, after working my way through the basics. I have made all parts for my project work on their own, but would appreciate a little guidance on the best way to get all parts to work together and trigger properly so my talking head will be more lifelike (although, it is a robot so should be robot like).

The state machine appears that it could be helpful but I am not completely comfortable with how to implement that in my project if it is the best way to go.

I have 2 weeks to get this working so am reaching out to the forum for some guidance to help get me pointed in the right direction. I am not asking for anyone to do the work for me, just words of wisdom and suggested approaches. Then, once I dive in, I will be back with specific questions, if I have problems.

Here is an outline of what I need to create:

  1. 1 super bright LED in brain is always on bright (255)
  2. 6 standard LEDs in multi colors always flash randomly, like Christmas lights, in brain
  3. gears always rotating in brain at constant slow speed
  4. periodic slow, smooth head rotation left/right with total range of motion of 45 degrees (+- 22.5 degrees from center); not rotating the full range but rather to a randomly selected spot in the total range of movement, pausing in that spot for at least 1 second before moving again
  5. 2 super bright eye LEDs always on low glow (50)
  6. ultrasonic sensor to detect when an object is within 20 inches, which will trigger the robot to speak one of 12 wav files, selected at random
  7. while a wav file is playing:
    a. mouth will open/close in synch with the audio, with maximum total range of movement = 30 degrees
    b. when mouth is open, turn eye LEDs to glow bright (255)
    c. when mouth is closed, return eye LEDs to low glow (50)
    d. move eyebrow servo according to values in an array with settings changing every 1 second during the audio, with maximum total range of movement of 20 degrees (+-10 degrees from center)
  8. everything will need to turn on/off with a switch
  9. all servo movement must be smooth, not jerky

I have most of the components already but am expecting my wave shield to arrive any day now to solder up and start testing. I also have a joystick shield from elecfreaks that works, but only for up to 2 servos and stops working when I add a third. Not sure I need the joystick shield for this project anyway.

Any suggestions for approach and/or components will be appreciated. Thank you!

Hi,
What motor(s) move the head? What pins does the Wav shield use?

And biggest question: What conflicts may there be between drivers / libraries / devices?? Regular Servo Library will conflict with NewPing and other Ultrasonic sensor libraries. You may have to drive servos directly with code and no timer support.

How are you planning to handle coordinating the Audio with movements?

A little on combining multiple sketches on the ArduinoInfo.Info WIKI HERE:

What motor(s) move the head? What pins does the Wav shield use?
Right now, we are planning to use a Tower Pro SG90 for the servos. The Wave shield uses pins 2-5, 10, and A1/16. In my experiments today, I have assigned my servos to pins to 6, 9 and 11 and they worked fine. I have not finalized the design for the pin assignments yet. We have switched to ultra bright LEDs for the eyes to make them plenty bright as they will be behind goggles.

And biggest question: What conflicts may there be between drivers / libraries / devices?? Regular Servo Library will conflict with NewPing and other Ultrasonic sensor libraries. You may have to drive servos directly with code and no timer support.
Thank you for the question. Interestingly, I just saw some comments earlier today on this topic and loaded in the ServoTimer2 library, although I have not yet implemented it. I'm not all too fond of the performance of the pulse method of moving the servos, at least not from the code that I have found so far.

How are you planning to handle coordinating the Audio with movements?
This is the biggest concern right now. We have just started experimenting with adding high frequency beeps to the audio to signal the servos. I added a jumper wire to enable the Wave shield to send voltage readings on pin 15. This sounds like it might be the best way to do it, although I need to come up with a better way to move the servo than the pulses. This little guy will be at an event where professional animatronics folks may be wandering around...in the daylight...so I would like him to look good. We're promoting some workshops we are developing for kids for a local school.

A little on combining multiple sketches on the ArduinoInfo.Info WIKI HERE:
Thank you! I had not yet seen this. It will be very helpful.

We finished our talking robot. Here is a short video showing him in action: Meet Sprocket! on Vimeo

We ended up using a Mega with a wave shield and an Uno. Amazed that I got it going so quickly. Thanks go out to @majenko for his awesome ICSC library and to @terryking228 for his guidance and for being an overall good guy -- awesome resources for newbies at his site ( http://ArduinoInfo.Info ).

While our initial plan for making this little guy talk was to follow what some have done using the volume from the wave file, sometimes using beeps, we just did not care for that method. So, I created a random talking script that seems to work pretty well. If I had longer to create the robot, I may have created a custom speaking script for each of the dozen lines that he says, but it likely would not have been that much of an improvement over the random.