Project Title:
Expressive Robot Face Using Servo Motors
Project Description:
This project involves the design and development of an expressive robotic face powered by servo motors, capable of displaying basic human-like emotions such as neutral, sad, and angry. The goal is to explore how mechanical motion can be used to simulate emotion through facial features, creating a more interactive and relatable robot interface.
The robot face consists of:
A movable mouth (up and down movement),
Two eyebrows, each controlled independently to express emotion through angular tilt (±30 degrees from neutral).
A total of three servo motors are used—one for the mouth and two for the eyebrows. The servos are connected to an Arduino microcontroller, which interprets commands received via the Serial Monitor to change facial expressions.
Each expression is defined as a function, and selecting an expression (via number input) transitions the robot smoothly through a neutral state before shifting into the new emotion. This helps create more lifelike and readable transitions.
Features:
Emotion switching via serial input (e.g., 1 = sad, 2 = angry, etc.)
Smooth transitions through a neutral pose
Modular function-based structure for easy debugging and adding more emotions
Easy integration with future sensors (microphone, camera) for reactive behavior
Ardunio Code to Run it:
#include <Servo.h>
Servo mouthServo;
Servo rightEyebrowServo;
Servo leftEyebrowServo;
int currentFace = 0; // Start with neutral
void setup() {
Serial.begin(9600);
mouthServo.attach(9);
rightEyebrowServo.attach(11);
leftEyebrowServo.attach(10);
mouthServo.write(90);
rightEyebrowServo.write(90);
leftEyebrowServo.write(90);
setFace(0); // Start with neutral
Serial.println("Enter a number to set the face:");
Serial.println("0 = Neutral");
Serial.println("1 = Sad");
Serial.println("2 = Angry");
}
void loop() {
if (Serial.available()) {
int faceID = Serial.parseInt();
if (faceID >= 0 && faceID <= 2 && faceID != currentFace) {
Serial.print("Transitioning to face: ");
Serial.println(faceID);
// Step 1: go to neutral
setFace(0);
delay(500); // Hold neutral briefly
// Step 2: go to target expression
setFace(faceID);
currentFace = faceID;
} else {
Serial.println("Invalid or same face selected.");
}
}
}
void setFace(int expression) {
switch (expression) {
case 0: // Neutral
mouthServo.write(120);
rightEyebrowServo.write(90);
leftEyebrowServo.write(90);
break;
case 1: // Sad
mouthServo.write(90);
rightEyebrowServo.write(125);
leftEyebrowServo.write(55);
break;
case 2: // Angry
mouthServo.write(90);
rightEyebrowServo.write(60);
leftEyebrowServo.write(120);
break;
}
}
Tags
Source du modèle
