For the first iteration of our final demo of the semester, our team deciding to create a dinosaur. The premise was a conglomeration of multiple successful projects in Demo 4, at the Children’s School. Many children were captivated by the snapping crocodile, and the game of stealing coins from its mouth. Children also took coins and tried to play with them in other projects. The notable recipient of all these coins was the very fluffy dog. Merely, the fact that it already had a hole for a mouth meant that the kids wanted to feed coins to the dog as well. Many found the idea of it eating coins and pooping them out to be hilarious and fun. So, for this project, we chose to expand on these concepts and create an exciting, holistic experience.

The goal for this project was to have a dinosaur react to wooden balls that the children would feed to it. First, a child would place a ball in its mouth (hoping not to be chomped) and then the Dino would chew on it. Afterwards, the dinosaur would spit out the food and urge the children to put in more.

Initial Prototyping
Functionality

Due to technical difficulties, our project did not perform as expected during the demo. We ran the toy many times to ensure that it would work by the day of the demo, however, this preemptive work could have been our very downfall.

Unfortunately, at the museum, we encountered a variety of electrical issues that impeded the performance of the project. We believe our power supply was broken or our Arduino was overloaded and that this caused our servos to freak out. Whenever we ran the Arduino through power, the servos behaved very strangely. This prevented the children from using our project.

However, many children still seemed every interested in the concept and really wanted to see it work. This showed us that the concept of our idea was engaging, and that even when they don’t work, dinosaurs are still eye catching.

While our user feedback was limited due to such an early failure, we could see that we still had a solid design to go forward with. Apart from fixing the glaring technical problems, our goal moving forward is still to improve off of our first iteration. We think it would be more engaging to add more complexity to the base code. Currently, until the Dino is fed, it is stationary, waiting for something to enter it’s mouth. Adding a slow yawning motion would be more enticing for the children to see it is alive and active. We are also considering a speaker to add noise into certain actions and potentially give the toy more personality.

The play by play moving forward really relies on how we can resolve our technical issues. Since it is uncertain why we encountered this issue, the amount of time it will take to solve it is highly variable. Randomly, while at least one power source is connected to power, the servos will start jittering and the machine becomes completely unresponsive. Unplugging both power sources and starting with plugging back in the shield board would often reset it but by the time the second child had shown up, the machine couldn’t do anything else. We will have to test the power sources, the shield and the Arduino.

Next, or even during problem resolution, we’ve decided to make a slightly larger Dino. This will include scaling the CAD and adding laser cut holes so they are a bit more precise than drilling by hand. The four bar linkage will need to be upgraded so it is more robust. Instead of using stray wires, we can use actual twine or aluminum wire or even a solid laser cut linkage so that the system is more sturdy.

If time permits, we will need to do some research into the speakers, playing around with them to find our desired frequencies. Before this, adding tweaks into the code to create more engaging behaviors will be a simple change to improve behavior. We have also decided to shift from our between state of decoration that is part minimalist and part covered to something that is fully covered and decorated.

Overall our challenges are manageable and our next steps for a further developed project are attainable. This time the Dinos fight extinction.

Code:

#include <Servo.h&gt;

const int SEN_PIN1 = A0;
const int SEN_PIN2 = A1;

const int MOUTH_SVO_PIN1 = 7;
const int MOUTH_SVO_PIN2 = 8;
const int LEFT_LEG_SVO_PIN = 4;
const int RGHT_LEG_SVO_PIN = 2;

Servo mouth_svo1, mouth_svo2, l_leg_svo, r_leg_svo;

const int SVO1_OPEN = 80;
const int SVO2_OPEN = 100;
const int SVO1_CLOSE = 130;
const int SVO2_CLOSE = 50;

const int SEN1_THRES = 650;
const int SEN2_THRES = 650;

long chew_t = 0;
long chew_start = 0;

void setup() {
  Serial.begin(9600);

  mouth_svo1.attach(MOUTH_SVO_PIN1);
  mouth_svo2.attach(MOUTH_SVO_PIN2);
  l_leg_svo.attach(LEFT_LEG_SVO_PIN);
  r_leg_svo.attach(RGHT_LEG_SVO_PIN);

  open_mouth();
  l_leg_svo.write(70);
  r_leg_svo.write(110);
}

long start_t = millis();
void loop() {
  long curr_t = millis();

  int sen1_val = analogRead(SEN_PIN1);
  int sen2_val = analogRead(SEN_PIN2);
//  lean_forward();

  if (sen1_val < SEN1_THRES || sen2_val < SEN2_THRES) {
    if (!chew_t) {
      chew_t = millis();
      chew_start = chew_t;
      close_mouth();
    }
  }

  if (chew_t) {
    chew(curr_t);
    chew_t = millis();
    if (chew_t - chew_start &gt; 5000) {
      chew_t = 0;
      open_mouth();
      delay(500);
      lean_forward();
    }
  }

  Serial.print(chew_t);
  Serial.print("\t");
  Serial.print("");
  Serial.print("\t");
  Serial.print(sen1_val);
  Serial.print("\t");
  Serial.println(sen2_val);
}

void chew(long curr_t) {
  int a = 5;
  mouth_svo2.write(a*sinf((float)curr_t/150) + 20);
  mouth_svo1.write(-a*sinf((float)curr_t/150) + (180-20));
}

void open_mouth() {
  mouth_svo1.write(SVO1_OPEN);
  mouth_svo2.write(SVO2_OPEN);
}

void close_mouth() {
  mouth_svo1.write(SVO1_CLOSE);
  mouth_svo2.write(SVO2_CLOSE);
}

void lean_forward() {
  l_leg_svo.write(120);
  r_leg_svo.write(60);
  delay(5000);
  l_leg_svo.write(70);
  r_leg_svo.write(110);
  delay(2000);
}