Animated Spider Trap With Sound

by eighteen18 in Circuits > Arduino

562 Views, 8 Favorites, 0 Comments

Animated Spider Trap With Sound

Presentation1.png
Halloween Spider Trap Demonstration
F0GBB4AM34GNKMV.jpg
FEPXPJVM34GNL4Y.jpg
FQFME0WM34GNKPC.jpg
FO2VX17M34GNL2D.jpg
FTBAMEJM34GNL7K.jpg
FOI1ZFSM34GNKX0.jpg

This Halloween, bring your decorations to life with an Arduino-powered spider trap!

Once someone walks underneath the trap and sets off the motion sensor, a realistic-looking spider will drop down, and a spooky sound effect will play to frighten your victim!

This guide covers each step, from 3D printing to wiring, to help you create a heart-attack-inducing Halloween decor!

Supplies

IMG_6207.JPG
IMG_6209.JPG
IMG_6210.JPG

To begin, you'll need the following things:

Electronics:

  1. Arduino UNO (or similar board, I used an Arduino Mega)
  2. 5V Stepper Motor with ULN2003 Driver
  3. DFPlayer Mini MP3 Module
  4. PIR Motion Sensor
  5. Speakers (2 small speakers)
  6. Amplifiers (2 small amplifiers that are compatible with the speakers)
  7. Small Breadboard and Jumper Wires
  8. 1kΩ Resistor (for the RX pin on the DFPlayer Mini)
  9. 1000μF Capacitor (to stabilize power to the DFPlayer)

Other Parts:

  1. Realistic Toy Spider
  2. Fishing Wire
  3. 3D Printer

Power:

  1. 3*AAA Batteries + Holder
  2. 9V Battery + Holder

Fasteners:

  1. Screws:
  2. 8 M3x12 screws for securing speakers to the lid
  3. 2 M3x12 screws for mounting the stepper motor
  4. 4 M4x8 screws for securing the lid to the housing
  5. Hot Glue

3D Printing

IMG_6199.JPG
IMG_6201.JPG
IMG_6200.JPG
IMG_6202.JPG
IMG_6203.JPG
IMG_6212.JPG


To begin the project, first print out the attached 3D files!


Print Settings and Tips:

I would recommend having an infill of around 15-30% for most of the pieces and 100% for the Locking Piece in order to ensure it's strength. You won't need to print supports for most of models except for the Main Housing which requires some support under the screw mounts.

I also decided to print the models out in white PLA but I believe black PLA would match the aesthetic better.


Once you've printed it out, make sure everything fits and you'll be good to go!

Loading the Reel

IMG_6232.JPG
IMG_6234.JPG
IMG_6236.JPG
IMG_6238.JPG
IMG_6239.JPG
IMG_6241.JPG
IMG_6242.JPG

Once you've printed out the Reel, you can load it up with your fishing wire!

To begin, feed the fishing wire through the small central hole in the reel while leaving a long enough tail to reach your target drop length for your spider.

Then, wrap the fishing wire around the reel once and tie a knot.

Afterwards, grab the end of the fishing wire and tie your fake spider to it. Make sure it's well-tied and also balanced properly!

Finally, wrap the reel a few times with the fishing wire until there is only a few centimeters left between the spider and the reel.

Uploading the Code

Screenshot 2024-11-06 185824.png
MEGA.png

The code of this Halloween decoration is quite simple!


To begin, it initialises all of the modules, stepper motors and sensors.

The PIR sensor then constantly checks for motion and when motion is detected, it sets off the sequence by lowering the spider via the stepper motor.

The stepper motor then spins for 10 seconds, lowering the spider. Afterwards, the motor pauses while a random sound is chosen and played using the DFPlayer Mini. Then the motor spins back in reverse to retract the spider and the sensor begins scanning for movement once more!


To upload the code, first plug in your Arduino board into your computer using a USB cable and then upload it through the Arduino IDE software. Make sure that the correct board and port is selected before pressing on 'Upload' to transfer the code to your Arduino.


Downloads

Preparing SD Card

Screenshot 2024-10-27 114827.png
Screenshot 2024-10-27 114616.png
IMG_6211.JPG

In order for the DFPlayer to be able to read our SD Card, we need to make sure it is prepared properly.

To begin, first, insert your microSD card (Maximum of 32GB) into your computer and format it as FAT32.

This is essential for the DFPlayer Mini to read the files.

Then, copy your spider sound effect files to your SD card. I've also attached the audio files that I used in case you wanted to have the same ones! You can then also optionally name them in a simple, format like “0001.mp3”, “0002.mp3”, etc. for easy playback.

Finally, place the formatted SD card with the sound effects into the DFPlayer Mini. Double-check that it clicks into place!


Gluing Components

IMG_6215.JPG
IMG_6214.JPG
IMG_6218.JPG
IMG_6220.JPG
IMG_6286.JPG

Once you've done that, you can begin to glue all your components to the housing in order to make sure everything stays secure.

You can follow the attached images in order to place each component in its respective space!

Stepper Motor Assembly

IMG_6247.JPG
IMG_6246.JPG
IMG_6248.JPG
IMG_6245.JPG
IMG_6249.JPG
IMG_6250.JPG
IMG_6251.JPG
IMG_6252.JPG
IMG_6261.JPG
IMG_6260.JPG
IMG_6253.JPG
IMG_6285.JPG
IMG_6255.JPG
IMG_6256.JPG
IMG_6257.JPG
IMG_6258.JPG
IMG_6259.JPG

Once you've done that, you can then install your stepper motor!


First, insert the two M3x12 screws through the stepper motor mounting holes.

Then position the reel in its designated spot inside the housing, with the fishing wire facing outward.

From the inside of the housing, carefully insert the motor, aligning its shaft with the reel and then push it through until the shaft sits snugly in the reel, making sure they are both aligned and move smoothly.

Then, fasten the two M3 nuts onto the screws from the inside of the housing to secure the motor. You might want to add some extra hot glue (Like I did later!) to stop vibrations and ensure the motor stays snugly on.

Finally, push the 3D-printed locking piece into place on the opposite side of the reel. This locking piece helps reduce the load on the motor and also stops the reel from moving horizontally.


Wiring

IMG_6268.JPG
IMG_6262.JPG
IMG_6263.JPG
IMG_6264.JPG
IMG_6265.JPG
IMG_6266.JPG
IMG_6267.JPG
IMG_6279.JPG

Once you've done that, bring your breadboard, resistor, capacitor and jumper cables in order to wire everything together!

Wiring Connections:


Stepper Motor Wiring:

  1. Connect the motor to the ULN2003 driver board, then wire the driver’s input pins to the Arduino’s digital pins (D2, D3, D4, and D5).

PIR Sensor:

  1. Connect the PIR’s VCC to the power rails on the breadboard, GND to the ground rails on the breadboard, and OUT to digital pin D7 on the Arduino.

DFPlayer Mini:

  1. Connect the DFPlayer’s VCC and GND pins to the power and ground rails on the breadboard respectively.
  2. Attach a 1kΩ resistor between the DFPlayer’s RX pin and digital pin D10 on the Arduino.
  3. Connect the TX pin directly to digital pin D11 on the Arduino.

Speakers and Amplifiers:

  1. Connect one of the amplifier's 5V pin to the power rails of the breadboard.
  2. Connect one of the amplifier's Audio + pin on the amplifier to either DAC_L or DAC_R on the DFPlayer Mini.
  3. Connect one of the amplifier's Audio - (GND) pin on the amplifier to the ground rail on the breadboard.
  4. Connect one of the amplifier's Speaker + pin on the amplifier to the + terminal of the speaker.
  5. Connect one of the amplifier's Speaker - pin on the amplifier to the - terminal of the speaker.
  6. Repeat the same connections for the other amplifier but use DAC_L if you connected to DAC_R and vice versa!


Finally, place the 1000μF capacitor between the positive and ground pins of the breadboard to avoid audio distortion when the DFPlayer begins!

Screwing on Lid + Power

IMG_6221.JPG
IMG_6226.JPG
IMG_6223.JPG
IMG_6222.JPG
IMG_6230.JPG
IMG_6228.JPG
IMG_6269.JPG
IMG_6270.JPG
IMG_6277.JPG
IMG_6273.JPG
IMG_6274.JPG
IMG_6275.JPG
IMG_6276.JPG
IMG_6272.JPG
IMG_6278.JPG

Now we're almost done!


1. Securing the Speakers

  1. Place each speaker over its mount on the 3D-printed lid and align the holes.
  2. Then screw in each speaker with 4 M3x12 screws (8 total) and their respective bolt while tightening gently to hold them in place.

1. Power:

Afterwards, connect your 3xAAA battery pack to the breadboard's power and ground rails in order to power everything.

Then use a 9V battery connected to the ULN2003 driver to power the motor, with the negative terminal also connected to the Arduino’s GND to make sure there is a common ground.


3. Attaching the Lid

Finally, position the lid over the main body of the prop and secure it with 4 M4x8 screws. This will fully enclose the components and keep everything sealed and stable during operation.

With power connected, speakers secured, and the lid attached, your spider trap is now complete and ready for testing!

Complete and Test!

Halloween Spider Trap Demonstration
IMG_6283.JPG
IMG_6284.JPG
IMG_6289.JPG
IMG_6287.JPG
IMG_6281.JPG
IMG_6296.JPG
IMG_6282.JPG
IMG_6297.JPG
IMG_6298.JPG
IMG_6299.JPG
IMG_6300.JPG
IMG_6301.JPG
IMG_6288.JPG

Your spider trap is now complete!

Walk in front of the PIR sensor to check if the spider drops down and the sound plays. If the spider doesn’t drop far enough, adjust the fishing wire length or motor steps in the code!

For a temporary setup, I used hot glue to mount the prop to a table edge. For outdoor installation, drill a few holes in the inside housing and securely attach it to a wall or mount!

Now, enjoy your creepy Halloween addition and watch as it gives your guests a fright and heart attack!