element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Animatronics
  • Challenges & Projects
  • Project14
  • Animatronics
  • More
  • Cancel
Animatronics
Blog Creepy Clown's Best Friend Skelly
  • Blog
  • Forum
  • Documents
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Animatronics to participate - click to join for free!
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: rsc
  • Date Created: 30 Oct 2019 3:35 PM Date Created
  • Views 1952 views
  • Likes 10 likes
  • Comments 7 comments
  • animatronics
  • sharethescare
  • project14
  • animatronicsch
  • animatronicch
  • share the scare
Related
Recommended

Creepy Clown's Best Friend Skelly

rsc
rsc
30 Oct 2019

Man's best friend, the humble dog.

Creepy clown's best friend, the $8 skeleton dog from dollar general.

https://www.dollargeneral.com/skeleton-dog-halloween-decor-1-count.html#

 

 

 

image

Let's see what we can do to make this pup a bit more scary for halloween.........

I'll be using an Arduino Micro for this project to control head movement and eye color.

A motion sensor will detect a visitor, and animate the scary puppy.

First cut it's head off and add a RC servo.

image

 

image

Then epoxy the servo horn into the neck of the beast.

image

Then we'll add some programmable RGB LEDS for eyes.

These are cut from a strip of 48 with LPD8806 control ICs.

image

Here's the schematic:  The power is from a 5VDC wall supply.

image

image

Then hot-glue some ping-pong ball half spheres to cover up the RGB LEDS

image

There's a RGB control library for this IC on the Adafruit Github site:

https://github.com/adafruit/LPD8806

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

//Skelly the animatronics dog
//October 2019 R. Scott Coppersmith


#include "LPD8806.h"
#include "SPI.h" 
#ifdef __AVR_ATtiny85__
 #include <avr/power.h>
#endif


// Based on Adafruit Example to control LPD8806-based RGB LED Modules in a strip
/*****************************************************************************/
// Number of RGB LEDs in strand:
int nLEDs = 4;
// Choose pins for output:
int dataPin  = 2;
int clockPin = 3;
const int MotionPin = 4; // Motion detect circuit 
const int ServoPin = 5;  // PWM servo pin
int MotionState = 1;     // Motion detect active low


#include <Servo.h>


Servo myservo;  // create servo object to control a servo
int pos = 0;    // variable to store the servo position


// First parameter is the number of LEDs in the strand.  The LED strips
// are 32 LEDs per meter but you can extend or cut the strip.  Next two
// parameters are SPI data and clock pins:
LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin);


void setup() {
#if defined(__AVR_ATtiny85__) && (F_CPU == 16000000L)
  clock_prescale_set(clock_div_1); // Enable 16 MHz on Trinket
#endif
pinMode(MotionPin, INPUT);
myservo.attach(5);  // attaches the servo on pin 5 to the servo object
  // Start up the LED strip
  strip.begin();
  // Update the strip, to start they are all 'off'
  strip.show();
}




void loop() {
   colorWipe(strip.Color(0,   0,   0), 50);  // off
  // read the input pin:
  // print out the state of the button:
  Serial.println("Waiting for Motion Trigger");
  while (MotionState == 1){
  MotionState = digitalRead(MotionPin);
  }
  // print out the state of the button:
  Serial.println("Motion Detected");
  MotionState = 1;
  theaterChase(strip.Color(127,   0, 127), 50); // Violet
  // Fill the entire strip with...
  colorWipe(strip.Color(127,   0,   0), 50);  // Red
  colorWipe(strip.Color(  0, 127,   0), 50);  // Green
  colorWipe(strip.Color(  0,   0, 127), 50);  // Blue
  rainbow(10);
  // Move the dogs head back and forth using the servo
    for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  rainbowCycle(0);  // make it go through the cycle fairly fast
}


void rainbow(uint8_t wait) {
  int i, j;
   
  for (j=0; j < 384; j++) {     // 3 cycles of all 384 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, Wheel( (i + j) % 384));
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}


// Slightly different, this one makes the rainbow wheel equally distributed 
// along the chain
void rainbowCycle(uint8_t wait) {
  uint16_t i, j;
  
  for (j=0; j < 384 * 5; j++) {     // 5 cycles of all 384 colors in the wheel
    for (i=0; i < strip.numPixels(); i++) {
      // tricky math! we use each pixel as a fraction of the full 384-color wheel
      // (thats the i / strip.numPixels() part)
      // Then add in j which makes the colors go around per pixel
      // the % 384 is to make the wheel cycle around
      strip.setPixelColor(i, Wheel( ((i * 384 / strip.numPixels()) + j) % 384) );
    }  
    strip.show();   // write all the pixels out
    delay(wait);
  }
}


// Fill the dots progressively along the strip.
void colorWipe(uint32_t c, uint8_t wait) {
  int i;


  for (i=0; i < strip.numPixels(); i++) {
      strip.setPixelColor(i, c);
      strip.show();
      delay(wait);
  }
}


// Chase one dot down the full strip.
void colorChase(uint32_t c, uint8_t wait) {
  int i;


  // Start by turning all pixels off:
  for(i=0; i<strip.numPixels(); i++) strip.setPixelColor(i, 0);


  // Then display one pixel at a time:
  for(i=0; i<strip.numPixels(); i++) {
    strip.setPixelColor(i, c); // Set new pixel 'on'
    strip.show();              // Refresh LED states
    strip.setPixelColor(i, 0); // Erase pixel, but don't refresh!
    delay(wait);
  }


  strip.show(); // Refresh to turn off last pixel
}


//Theatre-style crawling lights.
void theaterChase(uint32_t c, uint8_t wait) {
  for (int j=0; j<10; j++) {  //do 10 cycles of chasing
    for (int q=0; q < 3; q++) {
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, c);    //turn every third pixel on
      }
      strip.show();
     
      delay(wait);
     
      for (int i=0; i < strip.numPixels(); i=i+3) {
        strip.setPixelColor(i+q, 0);        //turn every third pixel off
      }
    }
  }
}


//Theatre-style crawling lights with rainbow effect
void theaterChaseRainbow(uint8_t wait) {
  for (int j=0; j < 384; j++) {     // cycle all 384 colors in the wheel
    for (int q=0; q < 3; q++) {
        for (int i=0; i < strip.numPixels(); i=i+3) {
          strip.setPixelColor(i+q, Wheel( (i+j) % 384));    //turn every third pixel on
        }
        strip.show();
       
        delay(wait);
       
        for (int i=0; i < strip.numPixels(); i=i+3) {
          strip.setPixelColor(i+q, 0);        //turn every third pixel off
        }
    }
  }
}
/* Helper functions */


//Input a value 0 to 384 to get a color value.
//The colours are a transition r - g -b - back to r


uint32_t Wheel(uint16_t WheelPos)
{
  byte r, g, b;
  switch(WheelPos / 128)
  {
    case 0:
      r = 127 - WheelPos % 128;   //Red down
      g = WheelPos % 128;      // Green up
      b = 0;                  //blue off
      break; 
    case 1:
      g = 127 - WheelPos % 128;  //green down
      b = WheelPos % 128;      //blue up
      r = 0;                  //red off
      break; 
    case 2:
      b = 127 - WheelPos % 128;  //blue down 
      r = WheelPos % 128;      //red up
      g = 0;                  //green off
      break; 
  }
  return(strip.Color(r,g,b));
}

  • Sign in to reply

Top Comments

  • rsc
    rsc over 5 years ago +2
    Thanks everyone, it was a last minute project for Halloween and it wasn’t easy to find a servo strong enough to hold that head up without stripping gears. Scott
  • clem57
    clem57 over 5 years ago +1
    So cool! Great job rsc Clem
  • three-phase
    three-phase over 5 years ago +1
    Great project - works very well. Kind regards.
  • robogary
    robogary over 5 years ago in reply to rsc

    I hear you on the servos.

    The one pictured uses plastic gears. Servos can be ordered with metal gears , start with prefix MG-xxxx, that dont strip so easy.

    Another thing you can do for the design is to use a 6.6V or 7.4V power supply or battery, direct wire to the servo power pins.  

    (Arduinos can handle up to 12V on Vin.)  You can also find servos with higher torque and voltages.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • rsc
    rsc over 5 years ago

    Thanks everyone, it was a last minute project for Halloween and it wasn’t easy to find a servo strong enough to hold that head up without stripping gears.

    Scott

    • Cancel
    • Vote Up +2 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • luislabmo
    luislabmo over 5 years ago

    It looks awesome.

     

    Luis

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • three-phase
    three-phase over 5 years ago

    Great project - works very well.

     

    Kind regards.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 5 years ago

    Cool project.

     

    DAB

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube