Group 5: Parrot Theatrical Prop

We chose to create an interactive parrot theatrical prop.
This prop would be used during a live performance to interact with the audience and bring life into the scenery. 

Sketching and Ideation

  • The main interactive feature in our design is the wing movement:
    The two wings of our parrot will be moving in a motion that resembles flying.
  • Complementary interactive features:
  1. Sound effects: our prop will be able to make parrot sounds 
    we also planned to add a microphone to record the user’s audio which the parrot will then be able to repeat.
  2. Light: the eyes of the parrot will light up in the dark
Early design sketches of the parrot and exploration of the wings’ range of movement

Low-Fi prototype

paper prototype showing feather groups of wings
reverse side with lolly sticks showing bone structure

Supplies

We aimed to make sustainable design decisions and use recycled materials as much as possible:

  • For the main body of the parrot, we chose to use a 2-litre plastic water bottle that provides shape and also allows us to hide the wooden wings’ supporting structure.  
  • For the head, we used another 0.5-litre water bottle and added a beak-like part, also made out of the plastic bottle.
  • For the base, we used a cardboard box that hides most of the Arduino’s electronic components to achieve clean aesthetics on the exteriors.
  • For the wings, we chose to use umbrella parts which allow for a similar movement to that of a wing.

Wing mechanism testing

The wing structure and motion were achieved using a broken foldable umbrella controlled using a servo. We used 90 degrees range of movement to open and fold back the wing.

foldable umbrella mechanism explained
wing mechanism sketches
umbrella rib with feather groups (folded)
umbrella rib with feather groups (outstretched)
wings with body

Internal structure

wooden structure with servos and wings attached

Paper Mache

In order to create a solid base for the acrylic colouring as well as to add a feathers-like texture, we used paper mache in both the body and the head of our prop.

Inside: body with a head and supporting wooden structure
Outside: body and head (paper mache) with wings attached to the internal structure

Colouring

We used acrylic paint for the surface area to achieve the typical macaw parrot’s look and create a tropical leaf pattern on the box at the base.

Wing motion

Project Task List

TaskDeadlineAssignment
Researching components required25th NovemberInbar
Making body exterior29th November Luciana
Making wings29th NovemberOlivia
Creating internal structure 2nd DecemberLuciana & Olivia
Adding microphone and speaker functionality2nd DecemberInbar
Adding wing controls 6th DecemberOlivia, Inbar & Luciana
Decorating exterior9th DecemberLuciana & Olivia
Adding speaker control9th DecemberInbar
code testing10th DecemberLuciana, Olivia and Inbar

Maker Manual

Overview

This is a Macaw parrot which can flap its wings and make noises. The wing speed can be controlled using a potentiometer, as well as stopping the wings at the open or closed position. The parrot sounds can be activated by pressing a button.

Tools and supplies

Electrical components:

  • 2 arduino unos
  • 2 SG90 servo motors
  • 1 potentiometer
  • 1 button
  • 1 led (red)
  • 1 8O3W-JST-PH2.0 Speaker
  • 1 Micro SD SPI Storage Board
  • 1 micro SD card

Non-electrical components

  • 2 litre plastic bottle
  • 0.5 litre plastic bottle
  • 2 umbrella ribs
  • cardboard box
  • thin paper (for paper mache)
  • thicker paper (for wings and leaves)
  • rectangular wooden dowels
  • screws
  • nails

tools:

  • glue gun
  • hammer
  • screw driver

Build

First, disassemble an old umbrella, leaving 2 ribs. Cut out two ‘feather sections’ out of paper and stick them onto the umbrella ribs.

Next, make the internal skeleton out of some rectangular wooden dowlels. A central thicker piece (a bit longer than length of 2 litre bottle), and three thinner pieces (length is diameter of bottle) arrange two of the dowels near one end of the central dowel, a servo width apart. Secure these dowels to the central dowel with nails and/or wood glue. Attach the third shorter dowel further down the stick at a perpendicular angle to provide more support once inside the bottle. Position the two servos vertically between the wooden dowels, about 4cm apart, and add screws to secure them. Screw servo arms onto the servos.

With the 2 litre plastic bottle, cut two holes, about 1.5cm by 7cm on either side of the bottle, at the position of the wings. Cutting out a panel of the bottle can be useful at this point. Put the wooden skeleton inside the bottle, lining up the servos with the gaps in the bottle. Arrange the wings at the correct position, with the umbrella directly over the center of the servo, and the runner angled to the central dowel. Use hot glue to attach the umbrella rib to the servo arm and at the end of the runner to the central dowel. Do this for both wings. That is the mechanism finished. You may choose to paper mache the bottle and decorate before assembling the mechanism, or after. To make the head, cut a 0.5 litre water bottle in half, cut a triangle from the leftover plastic, and stick it on curved to make a beak.

Layout and circuit diagram

Speaker audio

SD card containing our audio file which is used by our speaker (output) when triggered by the button (input)

Wing’s movement

The 2 servos (outputs) are controlled by the potentiometer (input) which can be monitored by the LED

Code

Our Code consists of two main interactive output components: the speaker and the servos. These are user-controlled using a button and a potentiometer. The LED allows for speed monitoring.

Speaker audio

This code allows the speaker to play an audio file saved on the SD card. At the setup, the connection with the SD card is established. This can be verified through the Monitor. When the button, linked to pin 2, is pressed, the audio file ‘parrot3.wav’ plays at a volume of 5. While the audio is playing, there is a 10-second delay to allow for the audio to complete before it can be played again.

#include <TMRpcm.h>
#include <SD.h>
#include <SPI.h>

TMRpcm audio; // make instance variable
TMRpcm tmrpcm;   // create an object for use in this sketch

const int buttonPin = 2; // the number of the pushbutton pin

int buttonState = 0;  // variable for reading the pushbutton status

#define SD_CSPin 4 // defines the CS pin of the SD card.

void setup() {
  tmrpcm.speakerPin = 9; //11 on Mega, 9 on Uno, Nano, etc
  tmrpcm.setVolume(5); //audio's volume (0-7)

  //initializes the serial connection between the Arduino and any connected serial device
  Serial.begin(9600);
 //initial the SD card connection and verification through the serial monitor
  Serial.println("loading... SD card");
  if (!SD.begin(SD_CSPin)) {
    Serial.println("An Error has occurred while mounting SD");
  }
  while (!SD.begin(SD_CSPin)) {
    Serial.print(".");
    Serial.print("h");
    delay(500);
  }
  audio.CSPin = SD_CSPin;

  // initialize the pushbutton pin as an input
  pinMode(buttonPin, INPUT);

}

void loop() {
  // read the state of the pushbutton value:
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH
  if (buttonState == HIGH) {
//play the audio
    tmrpcm.play("parrot3.wav");
//1 second delay
    delay(10000);
  } 
}

Wing movement

This code adds the wing movement functionality to our parrot. It makes use of the Servo library. It starts by initialising some variables including maxDegree, minDegree (boundary movements of the wings), speed (used to control the speed of the wing movement), and ledPin, sensorPin (potentiometer input), sensorValue (potentiometer value).

In setup, the servos and LED are attached to their respective pins. In the loop, the getSpeed function is called, getting the current potentiometer value and mapping it to a value between 10 and 50, determining the speed of the servo movement. If the potentiometer is all the way to the low end, the wings will stay open. If the potentiometer is turned all the way to the high end, the wings will stay closed. If the potentiometer is not at the highest or lowest values it will flap, with the speed depending on the position of the potentiometer.

The openWing and closeWing functions work by creating two variables lDegree and rDegree (the angle of each wing) they then loop from minDegree to maxDegree (for open wing) with the delay fetched from the getSpeed function. An LED also blinks at a speed relative to the wing speed. If the wings are at a multiple of 20 degrees, the LED turns off, else if they are at a multiple of 10, the LED turns on. This causes the light to blink faster or slower with the movement of the wings.

#include <Servo.h>

Servo Lservo;  // create servo object to control a servo
Servo Rservo;

int maxDegree = 80;
int minDegree = 10;

int sensorPin = A0;    // select the input pin for the potentiometer
int sensorValue = 0;  // variable to store the value coming from the sensor
int speed;
int ledPin=7;

void setup() {
  Lservo.attach(5);  // attaches the servo on pin 9 to the servo object
  Rservo.attach(6);
  pinMode(ledPin, OUTPUT);
}

void loop() {
  int nspeed = getSpeed();

  if(nspeed <=20){
    //wings open
    Lservo.write(minDegree);
    Rservo.write(180-minDegree);
  }else if(nspeed >= 40){
    //wings closed
    Lservo.write(maxDegree);
    Rservo.write(180-maxDegree);
  }else{
    //flap wings
    openWing();
    closeWing();
  }
}

//gets current value from potentiometer and maps it to a suitable speed value
int getSpeed(){
  sensorValue = analogRead(sensorPin);
  speed = map(sensorValue, 0, 1028, 15, 50);
  return speed;
}

//moves the servos from the minimum degree to the maximum degree
void openWing(){
  int lDegree;
  int rDegree;
  for (int i = minDegree; i<=maxDegree; i++){
    lDegree = i;
    rDegree = 180 - lDegree;
    Lservo.write(lDegree); // sets the servo position according to the scaled value
    Rservo.write(rDegree);

    //led bink
    if(i%20==0){ //led turns off every multiple of 20
      digitalWrite(ledPin, LOW);  
    }
    else if(i%10==0){ //if not a multiple of 20, but a multiple of 10, led turns on
      digitalWrite(ledPin, HIGH);
    }
    int nspeed = getSpeed();
    delay(nspeed);   
  } 
}

//moves servos from max degree to minimum degree
void closeWing(){
  int lDegree;
  int rDegree;
  for (int i=maxDegree; i>=minDegree; i--){
    lDegree = i;
    rDegree = 180 - lDegree;
    Lservo.write(lDegree);
    Rservo.write(rDegree);
    if(i%20==0){
	    digitalWrite(ledPin, LOW);  
    }
    else if(i%10==0){
      digitalWrite(ledPin, HIGH);
    }
    int nspeed = getSpeed();
    delay(nspeed);   
  }  
}

Testing and shortcomings

Software testing

The goal of this series of tests is to ensure the program runs smoothly and the logic of the code functions properly. To do so, we eliminate the physical components and use print commands to the monitor to follow the program step by step.

  1. Serial.println(lDegree) and Serial.println(rDegree) – This allows us to see the angles achieved by the servos in the serial monitor to check that the code was working as intended.
  2. Serial.println(nSpeed) and Serial.println(sensorValue) – Used to check that the correct range of values was being passed in by the potentiometer and that they were being mapped correctly into the speed at which the servos would turn.
  3. Serial.println(‘button pushed’) and Serial.println(‘played audio’) – Used to test that the code was going through the correct if statement when the user interacts with the button and used to test that the audio was being played.
  4. Using online tools (tinkercard.com) to test that our software was functional thus allowing us to see that the issue was the hardware.

Hardware testing

The goal of this series of tests is to ensure that every physical component used for our prop is functioning correctly on its own and is connected properly.

  1. Using the example servo code provided by the Arduino IDE to test the servo’s functionality and range as well as the potentiometer.
  2. When faced with issues we changed the wires and breadboard used in the circuit to test if that was the issue.
  3. Voltmeter testing with faulty components.
  4. We used separate breadboard and Arduino for the servo circuit and the speaker circuit at first before adding them together to make sure everything was functional and make testing easier.

Shortcomings

Our recording functionality was not working properly. In order to locate the root issue and fix it, we checked the hardware and the code separately. We tested each hardware component one at a time using a voltmeter to ensure all of the electronic components are fully functional. Unfortunately, we discovered the microphone component was faulty and therefore could not be used. Due to time restraints, we could not order a new microphone and had to give up on this feature.

Furthermore, the time constraints as well as the size of the breadboard made it difficult to add the LEDs for the eyes. Upon evaluating the priorities for the project we decided that the LED would be more suitable for a ‘creepy’ prop and it would be better to not use that idea on the final product.

Using a voltmeter to ensure the electrical components function as intended