Animated Smart Elf on a Shelf with the Raspberry Pi Servo Controller

Animated Smart Elf on a Shelf with the Raspberry Pi Servo Controller

Animate an elf on the shelf with Raspberry Pi Servo Controller

Animated Smart Elf on a Shelf Using the Raspberry Pi Servo Controller

In this project we show you how to Animate an Elf on a Shelf with the PivotPi, a Raspberry Pi Servo Controller, making it a smart Elf.  We’ll attach a small servo to the Elf’s arm to make it wave, we’ll use a distance sensor to see if anyone is close to the Elf on a Shelf, and we will tie it all together with the Raspberry Pi and GrovePi Zero.

When someone approaches, the Elf will begin enthusiastically waving!  This project will demonstrate how to easily add motion to an otherwise lifeless Elf and other toys.

Materials

Build It!

To build the Elf, we’ll first start by attaching the servo to the arm we want to wave.

We attached a small servo to the back of the Elf using some wires, wrapping around his torso, the servo, and the servo mount holes.

Raspberry Pi Servo Controller

Next, using the small arm that comes with the servo, we attached the Elf arm to the servo arm using some wires.

Elf on a Shelf Raspberry Pi Servo Controller

We prepare the controller by first placing the SD Card in the Raspberry Pi

Raspberry Pi Servo Controller Project

Then attach the PivotPi to the GrovePi Zero.  We use the two supports provided with the PivotPi and a small screw driver.

Raspberry Pi Servo Controller Project  Raspberry Pi Servo Controller Project 

Raspberry Pi Servo Controller  Raspberry Pi Servo Controller Project

Then attach the Grove Ultrasonic Sensor to the GrovPi Zero on port D3.

  Raspberry Pi Servo Controller Project

 

Next, attach the GrovePi Zero and PivotPi to the Raspberry Pi.

Raspberry Pi Servo Controller Project

Finally, attach the battery to the PivotPi board, to power the Servos.

Raspberry Pi Servo Controller

Attach the servo to the PivotPi.  Note the orientation of the colors on the servo wires!

attach-servo-to-pivot-pi

Complete!

elf-on-a-shelf-servo-attached

 

Program the Raspberry Pi Servo Controller

You may want to first put you Raspberry Pi on the local network, so you can control it remotely.  Our code is open-source and you can see it here.

If you’re not using Raspbian for Robots, you need to install the PivotPi first:

sudo git clone https://github.com/DexterInd/PivotPi

cd PivotPi/Install

sudo bash install.sh

If you’re using Raspbian for Robots, PivotPi comes already installed.  You can run the program with the command:

sudo python elf.py

And watch the Elf come to life!

animated-elf-on-a-shelf

 

Do More, Ask a Question

Ask a question on our forums here!

pivotpi-header