Humanoid concept Arduino

This concept to make a humanoid head, that speaks like a human, chooses phrases randomly. As (it) speaks , it moves head, eyeballs and eyebrows randomly in an emulation of a human. This can be useful for lonely people who cannot have a pet at home.

This is the basic idea..Later it is possible to develope it further to talk longer durations, and even tell short stories stored on an SD card.

I have the sketch here, which seems to work but servo movement random as needed...but is fast and not smooth. Also qill try to add the Ultrasonic sensor to make it trigger the entire sketch based on certain proximity.

The sound part is detailed on my other forum subject called (Arduino speech)

Motor at D7 moves eyelids up and down

Motor and D8 moves eyeballs left or right

Servos move the neck on 2 axis..3Rd servo I shall try to modify so that it moves based on sound produced by the sound chip. This can be done independently from Arduino sketch with a LM555 servo controller after replacing control pot rwith an opto-coupler that takes signal from audio output.

#include <Servo.h>
Servo servo1, servo2, servo3 ; 
int pos = 0;    // variable to store the servo position
int MotPin1 = 7; // select pin 7 for Motor1
int MotPin2 = 8; // select pin 8 for Motor2
void setup()
{
pinMode(MotPin1, OUTPUT); // MotPin1 should be output
pinMode(MotPin2, OUTPUT); // MotPin2 should be output
  servo1.attach(9);  // attaches the servo on pin 9 to the servo object
  servo2.attach(10);  // attaches the servo on pin 10 to the servo object
  servo3.attach(11);  // attaches the servo on pin 11 to the servo object
}
void loop()
{
digitalWrite(MotPin1, 1); // Motor1 ON
delay(1000);
digitalWrite(MotPin1, 0); // Motor1 OFF
delay(random(500,3000)); // delay for random time 0.5 - 3 sec
digitalWrite(MotPin2, 1); // Motor2 ON
delay(1000);
digitalWrite(MotPin2, 0); // Motor2 OFF
delay(random(500,3000)); // delay for random time 0.5 - 3 sec

int time = random(0, 5000);
  delay(time);
 
  int position1 = random(60, 120);
  int position2 = random(30, 90);
  int position3 = random(20, 135);
 
  delay(15);
  servo1.write(position1);
  servo2.write(position2);
  servo3.write(position3);
  delay(15);
 
}

haloween_bust2.jpg

Eye movement

The circuit as drawn will support motor rotation in only one direction. I suspect you will need bi-direction movement. I think that a Dagu Mini Driver (RobotShop RB_DAG-106) or similar product from DFRobot would provide a more useful base platform. Just count the number of power and ground wires needed to run your current 6 peripheral setup.

looks good

looks good