For our project, we made a robotic dog that reacted to children petting its head and back. If the dog has not been pet for a while, it tilts its head and then walk forward until the child pets it. When it is pet on the head, it moves its head and wags its tail. When it is pet on the back, the dog sits down and wags its tail. Once the kid is done petting the dog’s back, the dog stands back up. We wanted to create a project that conveyed affection towards the children and that the children could relate to. Through our robot’s reactions to children’s pets, we believe we achieved such. Below is a video of the children interacting with the robot:

Most of our engagement time was either between 0 – 30 seconds or over 2 minutes. There weren’t many children who used the toy for 30 seconds – 2 minutes. Almost all of the interactions were slightly facilitated, however, as most of the children were unsure of what to do at first. In terms of reactions to our project, most children were either excited or neutral, with a few children reacting in an exploratory or curious way.

Notable interactions include:
– Several children tried to push or force the dog
– One child tried to scratch its chin
– One child asked how it works
– Two children worked together to try and keep it sitting
– One child suggested to add claws

Solidwork Files:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#include <Servo.h&gt;
 
#define MOT_A1_PIN 10
#define MOT_A2_PIN 9
 
const int SERVO1_PIN = 8;
const int SERVO2_PIN = 7;
const int SERVO3_PIN = 4;
const int SENSOR1_PIN = A1;
const int SENSOR2_PIN = A0;
 
const int SENSOR1_THRESH = 500;
const int SENSOR2_THRESH = 200;
 
const int wag_time = 10000;
const int wag_interval = 1000;
const int wag_start_angle = 90;
const int wag_left_angle = 45;
const int wag_right_angle = 135;
 
const int sitting_time = 20000;
const int sit_time = 10000;
 
const int head_time = 10000;
const int head_speed = 25;
const int head_interval = 2500;
 
const int left_leg_start_angle = 90;
const int left_leg_end_angle = 45;
const int right_leg_start_angle = 70;
const int right_leg_end_angle = 115;
const int leg_intervals = 5;
 
const int left_walk_angle = 120;
const int right_walk_angle = 40;
 
Servo s1;
Servo s2;
Servo s3;
 
int sit_count;
int wag_count;
int head_count;
int leg_interval_count;
int wait_time;
int walk_count;
 
bool sit_loop;
bool wag_loop;
bool head_loop;
bool head_right;
bool head_left;
bool walk_loop;
bool move_head_right;
 
void setup() {
  sit_count = 0;
  wag_count = 0;
  leg_interval_count = 0;
  head_count = 0;
  wait_time = 0;
  walk_count = 0;
   
  sit_loop = false;
  wag_loop = false;
  head_loop = false;
  head_right = false;
  head_left = false;
  walk_loop = false;
  move_head_right = false;
   
  s1.attach(SERVO1_PIN);
  s2.attach(SERVO2_PIN);
  s3.attach(SERVO3_PIN);
   
  s1.write(left_leg_start_angle);
  s2.write(right_leg_start_angle);
  s3.write(wag_start_angle);
 
  pinMode(MOT_A1_PIN, OUTPUT);
  pinMode(MOT_A2_PIN, OUTPUT);
 
  digitalWrite(MOT_A1_PIN, LOW);
  digitalWrite(MOT_A2_PIN, LOW);
 
   
}
 
void loop() {
  if (wait_time < 25000)
  {
    wait_time++;
  }
   
  if (analogRead(SENSOR1_PIN) <= SENSOR1_THRESH){
    sit_loop = true;
    sit_count = 0;
    wag_loop = true;
    wait_time = 0;
    walk_loop = false;
    walk_count = 0;
  }
   
  if (analogRead(SENSOR2_PIN) <= SENSOR2_THRESH){
    wag_loop = true;
    head_loop = true;
    wait_time = 0;
    walk_loop = false;
    walk_count = 0;
    if(!sit_loop)
    {
      s1.write(left_leg_start_angle);
      s2.write(right_leg_start_angle);
    }
  }
 
  if (wait_time &gt;= 25000 &amp;&amp; !walk_loop)
  {
    walk_loop = true;
    move_head_right = true;
  }
   
  if(sit_loop)
  {
    sit_count++;
    s1.write(left_leg_end_angle);
    s2.write(right_leg_end_angle);
    /*if(sit_count <= sitting_time)
    {
      if(sit_count % (sitting_time / leg_intervals) == 0)
      {
        leg_interval_count++;
        s1.write((left_leg_end_angle / leg_intervals) * leg_interval_count);
        s2.write((right_leg_end_angle / leg_intervals) * leg_interval_count);
      }
    }*/
    if(sit_count &gt;= sit_time)
    {
      sit_count = 0;
      sit_loop = false;
      s1.write(left_leg_start_angle);
      s2.write(right_leg_start_angle);
    }
  }
   
  if(wag_loop)
  {
    wait_time = 0;
    wag_count++;
    if(wag_count % (2 * wag_interval) == 0)
    {
      s3.write(wag_right_angle);
    }
    else if(wag_count % wag_interval == 0)
    {
      s3.write(wag_left_angle);
    }
    if(wag_count &gt;= wag_time)
    {
      wag_count = 0;
      wag_loop = false;
      s3.write(wag_start_angle);
    }
  }
 
  if(head_loop)
  {
    head_count++;
    if(head_count % (2 * head_interval) == 0)
    {
      head_right = true;
      head_left = false;
    }
    else if(head_count % head_interval == 0)
    {
      head_left = true;
      head_right = false;
    }
    if(head_right)
    {
      digitalWrite(MOT_A1_PIN, LOW);
      analogWrite(MOT_A2_PIN, 255);
    }
    else if(head_left)
    {
      digitalWrite(MOT_A2_PIN, LOW);
      analogWrite(MOT_A1_PIN, 255);
    }
    if(head_count &gt;= head_time)
    {
      head_count = 0;
      head_right = false;
      head_left = false;
      head_loop = false;
    }
  }
  else
  {
    digitalWrite(MOT_A1_PIN, LOW);
    digitalWrite(MOT_A2_PIN, LOW);
  }
 
  if (walk_loop)
  {
    walk_count++;
     
    if(move_head_right)
    {
      digitalWrite(MOT_A1_PIN, LOW);
      analogWrite(MOT_A2_PIN, 255);
    }
    if(walk_count &gt; 500)
    {
      move_head_right = false;
    }
 
    if(walk_count % 5000 == 0)
    {
      s1.write(left_walk_angle);
      s2.write(right_leg_start_angle);
    }
    else if(walk_count % 2500 == 0)
    {
      s2.write(right_walk_angle);
      s1.write(left_leg_start_angle);
    }
  }
}