RSS:
Publications
Comments

Silly String Shooting Spider (Build It)

Silly String Spider

Silly String Spider

Contest Entry by Todd Harrison

I had great fun this Halloween with a silly string shooting spider!  My plan was to use an Arduino micro-controller developer board to control my son’s “Teenage Mutant Ninja Turtle” RC car that already shoots silly string.  I didn’t get the spider to actually squirt the silly string but when you’re looking at a big black spider and something shoots silly string at you from the same direction it scares you just the same.

I was inspired to do this 4 hour marathon build by a blog posting by Eric on www.Instructables.com. Eric created a silly string shooting pumpkin which was so incredible I just had to build a spider for Halloween that did the same.

My major problem was that once I heard about Eric’s pumpkin I only had a day to get the supplies and about 4 hours of free time to wire-up something, code it and get it out in the front yard before the kids started coming for tricks or treats.

Here is a component breakdown of the final prop.

  • The red dot and arrow point to the RC car hiding under a bush.
  • 2) RC car remote control.
  • 3) Relay used by pin 2 on the Arduino to fire the remote control’s silly string button.
  • 4) Arduino board: Duemilanove with ATmega328 Purchased from adafruit.com
  • 5) Small blue servo to yank on the spiders leg: TowerPro SG-50.
  • 6) Two red LEDs for spider eyes. Not on the spider I know, I ran out of dev time
  • 7) Parallax Ping))) sonar sensor, held up with helping hands.
  • 8 ) Big black spider
Silly String Spider Parts

Silly String Spider Parts

I originally wanted the string to shoot from the spider’s behind but I really didn’t have time for that so I hid the RC car in the bushes behind the spider and loaded it with a fresh can of silly string.  All I really had to do was get the Arduino to sense somebody getting to close to the spider’s face and then “POW!” fire the silly string using the car’s remote control.

Just for extra effect I wanted the spider to move using a servo and have red LED eyes that blinked.  I also wanted the blinking and servo movement to ramp up faster and faster as a person got closer. To get this effect I used a Parallax Ping))) sonar sensor to track the approaching prey as well as to calculate an agitation delay.  The agitation delay was used to make the spider look more and more upset as the person got closer. If somebody was at a great distance the LED eyes flashed slow and the spider made slow jerking motions, but as the distance delay multiplier shortened the eyes flash furiously fast and the spider would jerk like mad!  If the trick-or-treater dared get closer the Arduino would fire a relay connected to the remote control and they would get a face full of silly string.

Silly String Spider Board Control

Silly String Spider Board Control

A lot of people did have the nerve to walk up on the spider but in the dark it took them a second to even realize they had just been doused in the face with silly string, but then they would laugh and do it again just for fun.  It only really scared a few that didn’t expect anything or were just standing behind the intended victim who was fortunately to short to get hit.

I didn’t get time to mount the eyes in the spider’s head but the red flashing LEDs on the control board seemed to have the same effect as they would have had if they were on the spider.  They were only needed to get the kids attention in the dark.

Arduino Sketch:

  1. #include
  2. Servo myservo;  // create servo object to control a servo
  3.  
  4. int pingPin = 7; // pin for ping sensor
  5. int stringPin = 2; // pin that will fire the silly string remote
  6. int LED_Eyes_Pin = 11; // pin for the two eyes
  7. int multiplier; // multiplier for delay
  8. int delay_time; // time to delay before next step
  9.  
  10. void setup() {
  11.   pinMode(LED_Eyes_Pin, OUTPUT);
  12.   pinMode(stringPin, OUTPUT);
  13.   myservo.attach(9);  // attaches the servo on pin 9 to the servo object
  14.   Serial.begin(9600);
  15.   digitalWrite(stringPin, LOW);    //make sure this is off so we don’t shoot string
  16. }
  17.  
  18. void loop() {
  19.   ping();
  20.   eyes_and_servo(0,0);
  21.   delay(delay_time);
  22.  
  23.   ping();
  24.   eyes_and_servo(100,255);
  25.   delay(delay_time);
  26. }
  27.  
  28. void eyes_and_servo(int servo_pos, int eye_pulse)
  29. {
  30.   analogWrite(LED_Eyes_Pin, eye_pulse);
  31.   myservo.write(servo_pos);
  32. }
  33.  
  34. void ping()
  35. {  long duration, inches;
  36.  
  37.   // The PING))) is triggered by a HIGH pulse of 2 or more microseconds.
  38.   // We give a short LOW pulse beforehand to ensure a clean HIGH pulse.
  39.   pinMode(pingPin, OUTPUT);
  40.   digitalWrite(pingPin, LOW);
  41.   delayMicroseconds(2);
  42.   digitalWrite(pingPin, HIGH);
  43.   delayMicroseconds(5);
  44.   digitalWrite(pingPin, LOW);
  45.  
  46.   // The same pin is used to read the signal from the PING))): a HIGH
  47.   // pulse whose duration is the time (in microseconds) from the sending
  48.   // of the ping to the reception of its echo off of an object.
  49.   pinMode(pingPin, INPUT);
  50.   duration = pulseIn(pingPin, HIGH);
  51.   // convert the time into a distance
  52.   inches = microsecondsToInches(duration);
  53.   multiplier = inches/10;
  54.  
  55.   delay_time = inches * multiplier;
  56.  
  57.   if (delay_time > 1000) {delay_time = 500;};
  58.  
  59.   if (delay_time < 300) {
  60.      digitalWrite(stringPin, HIGH);
  61.      delay(500);
  62.      digitalWrite(stringPin, LOW);
  63.      delay(2000);
  64.    };
  65.  
  66.   Serial.print(delay_time);
  67.   Serial.print(” delay time; inches are= “);
  68.   Serial.print(inches);
  69.   Serial.println();
  70. }
  71.  
  72. long microsecondsToInches(long microseconds)
  73. {
  74.   return microseconds / 74 / 2;
  75. }

Project Videos

  • Share/Bookmark

Leave a Reply

You must be logged in to post a comment.