This holiday season's challenge, build a Project14 present that spreads joy to others and shows heart!
I was inspired to create an entertaining animatronic project to spread holiday cheer for my mum and her neighbors in their assisted living community.
Altho the nurses and staff keep them busy, the residents still need some amusing and unusual holiday stimulation to give them something for them to talk about and look forward to.
The elderly in assisted living all use walkers, a common mobile platform they all share experience with ….. and won’t forget – this becomes my palette to create a holiday masterpiece…..transform an ordinary walker into an animatronic Rudolph the Red Nose Reindeer.
It was installed early Christmas Eve day onto her walker and was a real hit with the residents and staff. The walker has to remain in use while decorated.
Here is a short entertaining video of the animatronic
Rudolph in action. https://youtu.be/yGkfvuKiX1U
The animatronics included 2 eyes made from clear DIY Christmas ornament balls, which I painted from the inside. Each eye has 2 servos, one servo is the left to right motion, the other servo is for the eyeball rotate up/down (blink).
A 5th servo had a candy cane mounted to it. At each end of the candy cane hung sleigh bells. One part of the Arduino routine rotates the candy cane to ring the sleigh bells.
The various routines in software are randomly selected, the Arduino code is posted at the end of this blog.
Rather than mount a power switch on the walker’s hand grip, a TTP223 capacitive touch switch was mounted on the grip. If the animatronics are powered & enabled while walking, an easy touch can pause the action should it become distracting.
Safety was a big concern as well. The LiPO battery powering the animatronics included a series power switch and a 5A fuse wired to a distribution terminal board.
The Arduino code:
#include <Servo.h>
Servo Bells; // create servo object to control a servo
Servo EyesLeftRight; // create servo object to control a servo
Servo EyesUpDown; // create servo object to control a servo
// twelve servo objects can be created on most boards
int TouchSwitch=LOW;
int PwrEnable=LOW;
int pos = 0; // variable to store the servo position
int SelectRoutine=1; // random # variable to select which motion rotine gets run
void setup()
{
Bells.attach(5); // attaches the servo on pin 11 to the servo object
EyesLeftRight.attach(6); // attaches the servo on pin 11 to the servo object
EyesUpDown.attach(11); // attaches the servo on pin 11 to the servo object
pinMode(12, INPUT); //Capacitive touch switch
pinMode(3, OUTPUT); // output relay ENABLE
randomSeed(analogRead(0));
// Serial.begin(9600);
}
void RingBells()
{
for ( int i =1;i<6;i++)
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
Bells.write(60);
delay (500);
Bells.write(120);
delay (500);
}
}
void BlinkEyes()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i =90; i>10; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesUpDown.write(i); // tell servo to go to position in variable 'pos'
delay(30); // waits 30ms for the servo to reach the position
}
for (int i = 10; i<90; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesUpDown.write(i); // tell servo to go to position in variable 'pos'
delay(30); // waits 30ms for the servo to reach the position
}
}
void LookLeft()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i>55; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
for (int i = 55; i <100; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookLeftLess()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i>75; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
for (int i = 75; i <100; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookRight()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i<140; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
for (int i = 140; i >100; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookRightLess()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i<120; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
for (int i = 120; i >100; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookLeftAndBlink()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i>55; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
EyesUpDown.write(i);
delay(70); // waits 15ms for the servo to reach the position
}
for (int i = 55; i <100; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
EyesUpDown.write(i);
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookRightAndRoll()
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
for (int i = 100; i<140; i++) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesUpDown.write(i);
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
for (int i = 140; i >100; i--) // goes from 180 degrees to 0 degrees
{
TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
EyesUpDown.write(i);
EyesLeftRight.write(i); // tell servo to go to position in variable 'pos'
delay(50); // waits 15ms for the servo to reach the position
}
}
void LookFwd()
{ TouchSwitch = digitalRead(12); // HIGH is home switch active, READ so dont have to wait for bells to stop ringing to exit
delay(2000);
}
void loop() {
TouchSwitch = digitalRead(12); // HIGH is home switch active
SelectRoutine = random(0, 13); //selects the motion routine to be run
while (TouchSwitch==LOW)
{
TouchSwitch = digitalRead(12); // HIGH is home switch active
delay(300);
PwrEnable=LOW;
digitalWrite(3,PwrEnable); // turn off relays for servo and lights power
}
while (TouchSwitch==HIGH)
{
SelectRoutine = random(0, 13); //selects the motion routine to be run
PwrEnable=HIGH;
digitalWrite(3,PwrEnable); // turn ON relays for servo and lights power
// get'r done
delay(100);
switch (SelectRoutine) {
case 0: RingBells(); break;
case 1: LookLeft(); break;
case 2: LookRight(); break;
case 3: RingBells(); break;
case 4: BlinkEyes(); break;
case 5: LookLeftAndBlink(); break;
case 6: LookFwd();break;
case 7: LookRightAndRoll(); break;
case 8: RingBells(); break;
case 9: LookFwd();break;
case 10: RingBells(); break;
case 11: BlinkEyes(); break;
case 12: LookLeftLess(); break;
case 13: LookRightLess(); break;
// default: Message("Invalid state!");
} // end of case list
}//end of while statement
}//end of void loop
Top Comments