RSS
 

Archive for the ‘arduino’ Category

How I do it: Dropbox

14 Jan

DB_Header1

If you don’t have Dropbox installed stop what you’re doing and install it.

Go ahead.

I’ll wait.

For those not “in the know”, Dropbox is free a cloud based backup/psedo-versioning system. And it’s awesome, oh, and it’s free. Note: I really like Dropbox but Google Drive, SpiderOak, box.com, Microsoft SkyDrive, and BitTorrent Sync are all good alternatives. The important thing here is to backup your files! I also use Dropbox to keep my 3D modeling software in sync, here’s how I do it.

Read the rest of this entry »

 

Am I doing this right? (Reddit Upvote Button)

27 Jul


 

Update! My project has been entered in the Instructables “USB Contest” if you like it please vote here: http://www.instructables.com/id/Reddit-Controller-USB-UpvoteDownvote-button/

Not too long ago I saw the “Awesome Button” video on the Make Magazine podcast. In the video Matt Richardson shows how you can take a Teensy development board and turn it into a simple USB keyboard. In his example everytime a button is pressed a synonym for the word “awesome” is sent to the computer. While this is a pretty neat project the idea of creating a simplified keyboard out of a few buttons is what stuck with me. This lead me to start creating my “Reddit Upvote/Downvote button”.

Reddit is a website that has in the past few months taken over my life. Not unlike Digg it aggregates all the best stuff on the internet and makes it easy to consume. The way posts are sorted or brought to the front page on Reddit has to do with the number of Upvotes and Downvotes a post gets over time. Now while these voting options are usually toggled by clicking arrow icons on the webpage they can also be controlled using keystrokes after installing the Reddit Enhancement Suite. After I found this, all the stars aligned for my project.

I started by sketching out a basic design enclosure and making some measurements for the parts I planned on including. The Teensy development board really is teensy so my project box ended up being pretty tiny. In the gallery below you can see the evolution of the project box. I started off with a pretty large box and scaled down to just big enough to fit what I needed. It’s pretty amazing to be able to print a box that fits your exact project dimensions in about 30 minutes. I also printed up and down arrows, the upvote arrow using red plastic and downvote colored blue with a Sharpie. As usual I’ve uploaded my most recent model to Thingiverse as STLs and Sketchup files. These can be downloaded and printed in the comfort of your own home (assuming you own a 3D printer of course).


 
Programming the keyboard functions on the Teensy is surprisingly simple. There are great instructions on the Teensy development board page for sending keystrokes to your computer and because the board identifies itself as a USB keyboard it works when plugged into a PC or Mac with no additional software! One note: to use the USB keyboard mode you must use the “Teensyduino” software which allows you to program the Teensy using the Arduino programming language and IDE rather than the native Teensy language. I’ve included the code in full at the bottom of the post, but to give a brief overview, when the upvote button is pressed the key combination “CTRL + SHIFT + A” is sent to the computer over USB, likewise if downvote is pressed “CTRL + SHIFT + Z” is sent to the computer. I defined these keystrokes in the Reddit Enhancement Suite manually because they seemed like a key combination that wouldn’t conflict with other programs (default is “a” and “z”).

Above is a drawing of the circuit I put together for the buttons. As you can see it’s really simple and basically an exact copy of the “Button” example on the Arduino website. I moved the circuit from my breadboard to a scrap of circuit board I had left over from my Arc Reactor project and soldered everything down. Since I was looking to fit this into a pretty small space my tolerances (wire length, etc) were also small. Much to my surprise everything worked on my first attempt to move it to a finished board. The only thing left to do was reconnect the USB cord I snipped in half to fit into my project box and put a couple dabs of hot glue on the lid to keep it closed.


 
Below is a collection of video clips I took while putting this project together. I think it turned out pretty nice and is a great example of the different ways to change a previous project (yours or in this case, someone else’s the “Awesome Button”) into something to fit your needs.


 

[thingiverse thing=10423]

 
 

Motion activated “Attack Creeper”!

28 Mar

That's a nice everything you have...

 

Update! I’ve been entered in the Instructables game.life challenge contest. If you like my project please vote for it. Here’s the link to my instructable: http://www.instructables.com/id/Motion-activated-Attack-Creeper/

In January I decided that I needed to upgrade my in-home security. Unfortunately for me my building does not allow dogs so a big scary animal was not an option. Then suddenly, inspiration struck or I guess you could say exploded.

The most logical option was obviously to create a near life size Arduino powered, motion activated, audio playing, remote controllable Minecraft Creeper. Obviously.

As always this started with a fairly lengthy list of relatively inexpensive supplies. Here’s the most complete list I can compile from memory.

The electronics

  • Arduino UNO (all good projects start with an Arduino)
  • Ada Fruit Wave Shield (for audio playback with the Arduino)
  • Electric Sumo CMoy Amp (I wanted to build one of these anyway so I picked it up for the project)
  • Cheap RC Car (I picked mine up for $15 at the drug store)
  • PIR Sensor
  • Speaker (mine came with my Wave Shield kit)
  • Various bits of wire
  • Batteries, lots and lots of batteries
  • Something to power the Arduino (I used a Minty Boost also from Adafruit)

 

And the crafty bits

  • Cardboard boxes
  • Paint
  • Hot glue (I used the normal stuff to hold the electronics in place and some heavy duty pull-the-skin-off-your-hands industrial stuff to hold the boxes together
  • Masking or painters tape
  • zip ties/cable ties

 

OK So first lets build a cardboard creeper. I sketched out the basic idea to help me find boxes that fit the correct proportions. I wouldn’t want a disproportionate in-home “Attack Creeper” because that would be ridiculous.

My first step was cutting holes to allow me to run cables internally from box to box and opening up some access doors on the back of each box. I also cut holes in the bottom box to allow me to thread cable ties through the bottom and around the RC car and opened holes for the PIR sensor and speaker. After this was done I connected the three cardboard boxes that make up the body using some heavy duty hot glue. This stuff will pull the laminate off your desk before it pulls off, serious stuff. Everything got a coat of “Creeper Green” paint and I masked off the eyes and mouth for a coat of “Soul-less Killing Machine Black”.

Next step electronics!

My program basically works like this

  1. Detect motion with the PIR sensor
  2. Play fuse.wav (aka Tsssssssss…) via the Wave Shield
  3. Trigger the “Forward” button on the RC car remote for 2 seconds
  4. Play explode.wave via the Wave Shield
  5. Wait 10 seconds and reset

Here’s a wiring diagram which explains how this monster is hooked up.

The PIR sensor was really easy to hook up using the instructions available on Adafruit’s website. I imagine any sensor that measures distance or detects motion could be used in place of this. I will say (for better or worse) using the example code for the PIR sensor made it very sensitive, maybe too sensitive.

The RC car came with a simple remote that contained four momentary micro push buttons. I just wired into one side of the “forward” button and used the Arduino to turn the button. I also removed most of the body of the RC car leaving just the wheels, motors and frame.

I copied the in game sound effects from Minecraft to the SD card in the wave shield for playback. The output volume of the Wave Shield on it’s own is pretty quiet so I ran it through the CMoy Amp to boost it’s volume to a appropriately scary level.

After I was sure I had everything working I used some standard craft hot glue to glue the speaker and PIR sensor inside of the Creeper body. I also glued the back of the body closed because as I learned it’s nearly impossible to get tape to stick to acrylic paint.

Here’s a montage of the little guy working. He’s just so adorable I could explode.

Now if you make your own motion activated “Attack Creeper” you’ll find the real fun is hiding in places around the house your roommates and/or significant other would not expect it.

And since someone might be interested in my terribly mashed up code here’s the code I used to run the thing. I used the example code for the PIR sensor and Wave Shield both available on adafruit.com to create this mostly functional code. Use at your own risk!

 
 

Arduino powered Haunted Mansion Halloween

21 Dec

As I posted previously I wanted to put together a Halloween display emulating my favorite Disneyland/world ride of all time. Originally this was just going to be four heads on a table with the Haunted Mansion’s “Grim Grinning Ghosts” playing on a loop.

After I started learning to program my Ardunio this evolved into a photocell actuated video on demand Halloween display. I used an example I found on Arkadian.eu to control a Dell Mini 9 laptop using AutoHotKey. When the photocell switch it tripped the Arduino sends a serial signal to the Dell laptop which is converted to a keystroke by AAC Keys which in turn triggers the below AutoHotKey Script and finally plays back using VLC.

I had access to a industrial photocell switch (just like at Disneyworld!) which required an additional 12v power supply but I imagine this could be modified to work with a cheap ultrasonic or IR range finder.

This AutoHotKey script is running on the PC waiting for the “a” key to be pressed. When the key is pressed VLC launches full screen and ignores input for the duration of the video (60 seconds). It then closes VLC and waits to be triggered again.

This Arduino sketch waits until the Photocell switch on pin 2 is tripped, then sends a serial character to the Dell laptop it’s connected to. It also ignores any input during video playback to avoid confusing the computer.

Here are the installation photos and video compilation (note: the audio is a little out of sync after uploading to youtube).

While we didn’t get too many trick-or-treaters this year the ones that stopped by after dark really enjoyed it. I’m really happy with the way this turned out and I recommend anyone new to Arduino give it a shot. It really wasn’t hard to put together and they payoff was great.

 

Arduino Powered Arc Reactor Part 2/2

19 Nov

So now that the hard part was over (writing the animation sketch for my Arduino) I started on the fun part, making the Arc Reactor a wearable Halloween prop.

About halfway through my build I found a great post on building a prop Arc Reactor on Instructables by msraynsford which used most of the same materials I had picked for my own. Great minds think alike I guess…

I picked up a rectangular PCB at Radioshack to mount my LEDs to. It seemed like a secure way to keep everything in place while wearing it, plus an excuse to brush up on my soldering skills. I used a scroll saw to cut the PCB into a 4 inch round. Then mounted the LEDs on the board spaced in an even ring (note: the extra LEDs pictured on the PCB would have resulted in my Arduino turned into a pile of slag and were removed). I also used this time to drill a couple of holes in my Altoids tins for holding my 9v battery and Arduino board.

Cutting PCB to size

4 inch round PCB

LEDs mounted in a ring

After cutting the PCB to size I soldered the LEDs and resistors to the board and some lengths of hookup wire so I could feed them directly into the board for testing.

I had my fingers crossed the whole time and as you can see from the video everything worked just as expected. Somehow I managed to do it all without soldering my fingers together.

Now that I had a working board I cut off the ends of an old serial cable and used the 8 conductor wire to extend the hookup wire. I added about 2 feet of wire or enough to reach the battery pack I planned on keeping in my pocket and wired a 9 volt battery to the Arduino board for power. I also hot glued the hookup wires into the outputs on the Arduino board. From what I’ve seen online this is the best semi-permanent way to make connections on the board and comes off with a little rubbing alcohol. Then fit everything snugly into my two Altoids tins so I could easily fit the battery and Arduino around in my pocket.

Ready for soldering

Just enough wires for the job

The modeling plastic I used comes in a container as small white plastic beads. When heated with hot water they turn transparent and mailable like a firm clay. As it cools it returns to a very hard white plastic. Since this happens fairly fast I wasn’t able to take any pictures of the molding process. I used items I had around the house with shapes similar to what I wanted to see on the faceplate and pressed the plastic around them. Then while the plastic was still warm I stretched it around the sides of the PCB and allowed it to cool. After cooling it held on really firmly to the board. I also velcro’ed a pocket on the inside of a t-shirt to hold the arc reactor while I was wearing it. The Arc Reactor and Arduino ran for over 8 hours on one 9 volt battery (I left it on over night so I’m not sure of the exact time).

Below are pictures of the finished Arc Reactor.

And the final video

Overall I’m pretty happy with how it turned out. I’m planning on taking what I learned and trying to get my hands on some laser cut metal parts for next year. I’d like the Arc Reactor to look as cool outside of the shirt as it did inside.