Project tutorial
Dropping Spider on Doorbell - Halloween Scare Prank

Dropping Spider on Doorbell - Halloween Scare Prank © GPL3+

A quick halloween scare prank using an Arduino, HC-SR04 ping sensor, and a servo. A spider drops on anyone trying to ring the bell.

  • 2,989 views
  • 1 comment
  • 11 respects

Components and supplies

51gzz5eu9pl. sx425
Ultrasonic Sensor - HC-SR04 (Generic)
Any cheap HC-SR04 from ebay or similar will work.
×1
Rg cont a
RobotGeek Continuous Rotation Servo
Any servo will work.
×1
A000066 iso both
Arduino UNO & Genuino UNO
Any model of Arduino will work. Doesnt have to be UNO.
×1

About this project

My son Max came up with the idea to drop a spider on anyone who rang our doorbell this Halloween. I was ofcourse quick to "jump" on the idea, and we started to work on it as soon as we could. It is a really simple build, using an Arduino and a small sketch we put a ultrasonic distance sensor (HC-SR04) to sense when someone came close to the doorbell, and then a servo quickly "dropped" a spider in a string on the visitors hand. Letting it dangle for a bit before it was retracted again. It was great fun to build and took short enough time to keep a kid interested through the build ;)

All the instructions is in this short video tutorial:

Enjoy, and hope you scare someone this Halloween! >:)

Code

The code for the dropping spider halloween prankArduino
Code from Anything Arduino episode 31. Dropping spider on doorbell Halloween scare prank.
#include <Servo.h>

//Ping sensor
const int pingPin = 7;
long pingSendTime = 0;

Servo myservo;  // create servo object to control a servo
// twelve servo objects can be created on most boards

int pos = 0;    // variable to store the servo position



void setup()
{
  myservo.attach(9);  // attaches the servo on pin 9 to the servo object

}

void loop()
{
//Ping sensor code:
  if (millis()>pingSendTime+100) {
    long duration;
    pingSendTime=millis();
    pinMode(pingPin, OUTPUT);
    digitalWrite(pingPin, LOW);
    delayMicroseconds(2);
    digitalWrite(pingPin, HIGH);
    delayMicroseconds(5);
    digitalWrite(pingPin, LOW);
  
    // The same pin is used to read the signal from the PING))): a HIGH
    // pulse whose duration is the time (in microseconds) from the sending
    // of the ping to the reception of its echo off of an object.
    pinMode(pingPin, INPUT);
    duration = pulseIn(pingPin, HIGH);
    if (duration<380 and duration>100) {
        for (pos = 0; pos <= 60; 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(1);                       // waits 15ms for the servo to reach the position
        }
      delay(2500);
      for (pos = 60; 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
      }
    }
  }  
//End ping sensor code.
 
} //void loop

Schematics

Schematics for ep.31 Spider dropping on doorbell.
A simple schematics on how to connect the HC-SR04 and Servo to the Arduino.

Comments

Similar projects you might like

PIR Sensor Activated Halloween Scare Prank

Project tutorial by Kristian Blåsol

  • 6,979 views
  • 8 comments
  • 18 respects

Halloween PIR Proximity Scare Speaker with Lighting Effects

Project tutorial by syn

  • 2,716 views
  • 5 comments
  • 11 respects

Arduino Mp3 player + Distance sensor = FUN

Project tutorial by javier muñoz sáez

  • 34,785 views
  • 32 comments
  • 59 respects

2016 Halloween Laser Maze

Project showcase by Sam Horne

  • 13,259 views
  • 8 comments
  • 31 respects

How to Build a DIY Animatronic Halloween Prop Using Arduino

Project tutorial by amrmostaafaa

  • 3,141 views
  • 1 comment
  • 11 respects
Add projectSign up / Login