Ever since finishing school I regularly hear friends saying "I'm sad I didn't take more electronics / programming / web dev classes and really learn how to use it." In the 3 years I've been out of school, I feel I've learned more practical design skills in new domains than I learned in all 6 years of college / grad school combined. After thinking about why some of my friends and I have had different experiences, I realized the hardest part of learning new domains is figuring out where to even begin. Electronics and web development are saturated with a million different development platforms, each with their own particular programming language, programming environment, pros/cons, and weird name. Each set of tools and architectures come with their own learning curves and abstractions. Ideally I'd come up with a witty analogy here, but nothing comes to mind so maybe later :)

I wanted to do a project that someone who wanted to broaden their domain exposure could use as a starting point with a lower barrier to entry. By crafting a project that demonstrates several of the powerful prototyping tools in different fields, then showing how they can be interfaced together to create a working multi-dimensional project, the idea is to inspire people to craft their own projects that utilize their particular depths and interests yet push them out of their comfort zone into new domains in a controlled way using properly-selected tools. Enough talk.


I like to dance. A lot. The second-most common text I get is "are you dancing tonight?", probably right after "when are you gonna get here?" (I'm chronically late, but acknowledgment is one of the steps on the way to recovery). There's a very well-used website in San Francisco for acquiring important and simple information, http://isthereagiantsgametoday.com/. Extremely straightforward, just tells you whether or not there's a game so you can plan your miserable commute accordingly. Inspired me to create a Dance Button that when pressed updates a website www.istripdancing.com (yes I realize that can be is trip dancing or i strip dancing) and communicates to friends that you're dancing.

In order to do this, you need a local device that can detect when a button is pressed, a module that enables the device to communicate the information to the internet, a website that can display the button status, and a web server that can mediate between the device, the website, and any social platforms.

Wanted to use platforms and tools that are extremely flexible (can be used in many different ways), well-documented (so bending them to your will is easier when you run into bugs), and abstract away as many of the technical concepts that contribute to steep learning curves as possible (but allow you to dive into the details if you'd like).

The last diagram shows an outline of all the components needed for this system and the interfaces between them.

Step 1: The Electrical

Generally when doing projects without strong form-driving requirements (it's just a silly button, so weight size, how it fits into your hand, how people feel about the form aren't critical to it being successful), before I do any of the physical/form design, I pick the electrical components and architecture that are going to make my life the easiest. There's a huge variety of options for controllers, batteries, connectors and wiring, but options are normally very different physically, so choose the ones you like the best, then fit them to your box. See the sketch schematic for a general overview of the final system.

Choice of microcontroller wireless module

Arduino is the obvious choice for most people. Provides an electrical platforms that provides most basic functionality makers need, has a relatively intuitive language, cheap, and has TONS of online documentation. Partnering it with a well-documented Wifi module with a powerful online API like the Electric Imp seems like a natural choice (Spark Core is another option that will be released soon). However, what I'm trying to accomplish here is so simple that rather than using the Arduino to do all logic and using the Imp solely as a communication channel, I decided to take advantage of the Imp's onboard processor (which few people realize can do many things the Arduino can do) to eliminate the need for an Arduino from the system. You could just as easily use both together (which might be easier for beginners). The advantage of skipping the Arduino is fewer parts, longer battery life, lower cost. The main disadvantage is that the Imp uses Squirrel, a language that uses a slightly different flow and syntax from the Arduino, and might be harder to learn and slightly less useful (based on the frequency you might use it).

The strategy:

- We're decided on using the Electric Imp, which runs at 3.3V and can consume on the order of 5mA in sleep mode. LiPo batteries come in multiples of 3.7V nominal, and I happened to have some small, lightweight 2000 mAh LiPo batteries from SparkFun lying around that would work perfect, lasting approximately 16ish days. If you're ever looking for a source for cheap, reliable LiPo batteries, go to www.all-battery.com. I love them.

- Next we need to make sure the Imp can control our LEDs that light the button. I'm using the common cathode diffused RGB LED from Sparkfun, which needs to pull 20 mAs for each color. Unfortunately while going through the Electric Imp documentation, I found the Imp's GPIOs can only source/sink up to 4 mAs, which means we can't power the LEDs directly from the Imp. To address this, a common strategy is to use transistors to turn on the LEDs. A great explanation of transistors can be found HERE. Effectively the transistors take a smaller current input from the Imp to close an internal switch that allows the LEDs to be powered from the battery, so our Imp isn't trying to provide more current than it can. The 2N2222 transistor is very common in low-power amplification applications. Because we're using a common cathode LED (meaning positive terminal for each LED is shared) and each LED needs a different applied voltage to work (and therefore a different current-limiting resistor), I setup all of the transistors to share their emitters with ground. See the notebook work for how to size the resistors for the transistors to work.

- After selecting all the auxiliary (non-Electric Imp) components, I like to lay them out nicely and attach them to a protoboard (printed circuit board with through holes you solder components to) that will connect to the Electric Imp with breakaway headers (this way I can easily remove the protoboard from the Imp if I want to use the Imp in another project). Protoboards come with a huge variety of routings between the through holes: the one I chose from Amazon has no routing between holes, giving me more freedom with component layout but more work doing my own routing. I included connectors for the battery (2-pin JST), LED (4-pin breakaway), and button (2-pin JST) so the system could be easily disassembled. The final step is to add a jumper to the Imp to easily switch between battery or USB power.

Now that we have a hold on the electrical side, time to move onto the box that'll bring everything together.
<p>Did you take your site down?</p>
I'll be the first to comment. I'm so happy people are starting to post Imp projects. Even though this seems simple, it really does help others get &quot;into&quot; the world of electronics. There are several examples on the Imp website for using the Agents to send and receive data from websites. This Dance Button is an example of notifying someone of a physical event (the pushing of a button). That event could be anything else, like doors being opened, vehicles that trigger a sensor when entering a driveway, etc. If you have access to WiFi, the imp can connect your physical world to the internet. Great job on this Instructable ... just need to update the instructions by eliminating the &quot;blueprint/planner&quot; Imp IDE (obsoleted in mid December). <br> <br>

About This Instructable




Bio: I tend to have too much energy, so I try to do everything so I can sleep at night.
More by tripish:Outie Headphones Outie Headphones: Parametric Bent Wood Lamination Dance Notification Network 
Add instructable to: