loading

In this project, we will hide a foam disc shooter and a small speaker connected to an arduino wifi board inside an old speaker box. The foam disc gun and speaker audio sequence will be activated through the IFTTT.com service. The IFTTT.com service has a wide array of options that can pull information from the internet to send a trigger to your arduino board. I have chosen to use Twitter as my activation method, but there are many options out there for customization.

And.. for this project, we have setup the sequence to pull the trigger of the gun..... then, shout "HEADS UP!".

Step 1: Materials Needed

Electronic Components:

Material:

  • Old speaker box (thrift store is great option)
  • Foam Disc Guns
  • Structural wire (XX gauge)
  • Double sided tape
  • Sandpaper

Tools:

  • Soldering Iron
  • Screwdrivers
  • X-acto blade
  • Drill
  • Saw
  • Sandpaper / sand drum
  • Forstner drill bit (for large hole)
  • Hot glue gun
  • Pneumatic nail gun

Step 2: Solder Our Boards

Lets get our boards ready for wiring.

For my setup, a few initial soldering steps were required to get things going with the male feed wires because these were brand new boards.

Wifi Huzzah Board:

  1. Solder header pins onto the board so can accept male wires

Sound board and amp:

  1. Solder pins onto both the amp and soundboard so can mount onto a breadboard
  2. Connect speaker to circuit
    1. Strip 2 wires
    2. Solder 1 end of the wires onto the speaker
    3. Screw down other end of wires into amp board

Step 3: Setup Huzzah Board

Follow below tutorial links to setup your wifi board:

  1. Review Adafruit Huzzah Board setup
  2. Setup IO account
  3. Add IO Package to Arduino
  4. Add Boards to Arduino:

Below was my primary resource to setup board, library, and accounts:

Step 4: Setup Audio Board

Now lets setup the audio board to play sound when triggered.

I used a recording of my voice saying "Heads up", so I'll walk through my process

  1. Open quicktime, select File < New Audio Recording
  2. Record your audio clip
  3. Convert the audio clip to a .WAV
  4. Change the name of the audio file to "T03.WAV"
    • Note - the file is name T03 because we are using pin3 on the audio board.
  5. Upload the file onto the board:
    1. Plug board into computer
    2. Drag T03.WAV file into the board folder
  6. Test that the file plays!

Primary resource:

https://learn.adafruit.com/adafruit-audio-fx-sound...

Step 5: Setup IO Feeds and Dashboard

  1. Login to your IO account
  2. Create a feed called msg
  3. Create a dashboard called messages with an on/off switch

Primary resource:

Step 6: Setup IFTTT Adafruit Connection

Send "ON" to the arduino wifi board through a trigger on IFTTT

  1. Create IFTTT account
  2. Select 'create new applet'
  3. Select '+' sign
  4. Select Twitter
  5. Select "New Tweet by You with a Hashtag"
  6. Fill in the hashtag you'd like to use for arduino triggers (mine is #headsupPOD)
  7. Select '+ that'
  8. Search for 'Adafruit'
  9. Select 'Send data to Adafruit IO'
  10. Select 'msg' feed and write "ON" as data to save
    • Note - capitalize "ON" as that is how the arduino code reads the incoming characters
  11. Finish!

Side note - the message that is sent to the feed in this step is customizable. We can setup multiple triggers with different "Data to save" which the arduino code can read and react to. In the code I have provided, we trigger action when "ON" is sent to the feed.

Step 7: Setup Full Circuit

Construct your circuit using the image and diagram illustrated. This initial setup will be used to prototype and confirm all connections work with the code.

Note - in my case, I was able to fit everything into the final enclosure in this layout. It would be possible to shrink some of this wiring down if required, but my box was large enough to fit everything.

Step 8: Test Code

Download the sketch code provided.

  1. Edit the Wifi credentials & change to your AIO key
  2. Compile and upload sketch to test
    • Note - make sure port is correct
      • Tools > Port > SLAB_USBtoUART
  3. View the status of Adafruit data on the 'message' dashboard
  4. Test the wifi connection by toggling the button on/off to confirm reacting
    • Note - the code provided will turn the on-board light on/off as this button is toggled
    • Suggestion - if having issues, disconnect speaker and servo from the circuit and first confirm the light toggles on/off, then add on the components accordingly. Feel free to comment out code for the servo and audio board until the wifi connection is working.
  5. Test the Twitter functionality by sending a tweet with the determined hashtag
    • Note - both the light and the dashboard should toggle with the appropriate tweet

Step 9: Fix Foam Gun + Servo Together

In this step we will build a platform to mount the foam disc gun and the servo together to pull the trigger when the servo motor is activated.

  1. Drill hole in trigger of gun (pic attached)
  2. Drill hole in servo arm to enlarge to fit metal wire
  3. Find/buy piece of wood to use for platform
    • Note - I found a piece of scrap MDF board in the shop, which is why the odd, oblong shape.
  4. Map out region for foam disc gun and servo to sit into
    • Map out a distance of the servo from the trigger by at least 3 inches.
  5. Cut and widen the openings to fit the gun and servo into
    1. Drill large hole at center
    2. Sand and/or file to outline
  6. Drill mounting holes for the servo
  7. Drill mounting holes for the foam disc gun
    • Note - this was particularly tricky because you need to drill from underneath the gun
    • Suggestion = drill holes into the gun first, then map out where to drill pilot holes on the board
  8. Mount both gun and servo onto the board with screws
    1. Note - mount the servo motor such that the resting location from arduino code is where you want it to be and that it is rotating in the right direction to pull the trigger
    2. Also - don't forget to pop off the top piece cap of the loading magazine (orange cap in pic attached). You will need to have access to the magazine chamber once mounted in the box.
  9. Line the metal wire through the trigger of the gun
  10. Bend metal wire around gun and into the servo opening, without dramatically rotating the servo motor
    1. See pic attached of my final wiring
  11. Plug in and test it out!!

NOTE - to get the servo to pull the trigger took LOTS of trial and error: multiple wires and repositioning. Be careful not to torque the motor too much and strip the internal gears (I did this!). Best tip is to run the servo without it connected to the gun to be certain that the direction and rotation is right and can see how far need to rotate- then place the metal wire into the servo from the gun trigger.

Step 10: Hack Into a Speaker Enclosure

First, fit the guts into the box:

  1. Disassemble speaker box
    • Note - backside on my box was glued shut, so I had to saw + hammer it out (sorry didn't take pics of this)
  2. Map out and drill pilot holes for mounting our standalone speaker into the box
  3. Measure width of speaker box to determine width of gun + servo platform
  4. Saw platform to width
  5. Establish height and location of platform in box to determine top down loading hole
  6. Using the Forstner drill bit, drill a slightly oversized hole in the top for loading disc bullets
    • Note - the extra piece of wood between cutting bit and work piece is to create a nicer edge finish on the top
  7. Screw speaker into place
  8. Tack down electronics boards into place: double sided tape or hot glue, depending on preference
  9. Fix gun + servo platform in place with hot glue for temporary hold
    • Note - ensure the loading chamber and the opening hole are aligned in this step
  10. Using pneumatic nail gun, fix the platform in place permanently

Next, cover the box to hide everything:

  1. Determine the location of the foam disc shooter and the cover screen: mark with sharpie
  2. Cut out a piece of cardboard to mount on the backside of the cover screen
  3. After identifying location on cardboard, draw out a slot for cutting
  4. Cut the slot using an X-acto knife
  5. With double sided tape, mount the cardboard on the back of the screen + outside plastic enclosure
    • Note - you want the double sided tape to contact the screen so when we cut the screen in the middle it stays in place
  6. Place double sided tape on the backside of the cardboard
  7. Slit the screen down the middle of the cardboard slot
  8. Fold the screen onto the double sided tape to create a clean opening
  9. Using double sided tape, fix the entire screen back component on the box at the top
    • Note - do not permanently fix the screen on the box without testing that the discs fly through!
    • I fixed it only on the top so I can still open it up in case discs don't fly through
  10. Test it out!!

Step 11: Start Firing!!

Place your "Heads up" in interesting places and see what happens.

Please share your stories if you go forward with this project!

Thanks for reading!! Hope you enjoyed it!

awesome! i recently use ifttt for one of my projects, it works great.
<p>Haha, I'd love to set this up in the entryway to surprise my husband when he comes come! XD</p>

About This Instructable

1,142views

5favorites

License:

More by aschlesinger2:Heads Up 
Add instructable to: