Ok, so I'm a little ahead of myself: if you aren't yet familiar with the Electric Imp, it's time to check it out. The imp is a tiny, powerful, wifi-connected processor that looks like an SD card. It connects easily to any wireless network, phones home to the Electric Imp service, and lets you connect all sorts of things to the internet and each other. You program it in your web browser using the electric imp planner. Check out the overview at http://electricimp.com/.
Right now I have my copy of this demo hooked up to a fun little board I use to control some in-ceiling RGB lighting. We've got more instructables coming along soon for that - for now you can check out the video we posted here. Check out the pictures - the kicker is that this method of controlling that light:
- is totally wireless and was installed in about the time it took to get the light in the ceiling in the first place
- works from anywhere in the world
- can be connected, disconnected, or changed (pre-program light shows or interpret inputs differently) from anywhere in the world, without tools, just by opening my browser.
When you're ready, check out the next page and see the (short) list of things you need to connect a knob to the internet!
Step 1: What you'll need
In order to connect and program your imp, you'll need a computer, a wireless network for the imp to connect to, and an iOS or Android device with the Electric Imp app (free in the App Store and Google Play store). You'll need to create a free Electric Imp developer account, which is pretty quick to do. You can view all your connected imps at plan.electricimp.com.
You'll need a few other pieces as well, but the list is pretty short:
- An enclosure. Should be big enough to hold an imp+breakout board and battery (1.25" x 2.25") and deep enough to hold the aforementioned contents and leave room for the base of a potentiometer. I used a Serpac RB33-1TC1BC enclosure, which is about 1.9" deep, but you can get away with about 1.6" of depth.
- A potentiometer, 1k ohms or 5k ohms. Get a linear potentiometer, not a logarithmic one. Mine includes a switch (it clicks nicely when you turn it all the way counter-clockwise), and I incorporated that into my firmware. I recommend finding one with a switch, but it's not essential. Just useful.
- A knob for your potentiometer! The pot I used had a 6mm outer diameter on the shaft, so size the knob to fit. I like the kind with the set screw to hold it in place.
- A battery pack or clip. It's not a good idea to run the Imp off of two alkaline AA batteries because they only give you 3V DC, and the imp needs 3.3V. The imp has an on-board regulator, but it won't even turn on until above 3.3V. You can use a 2-AA clip and a couple of UltraFire lithium ion batteries, though, because they're 3.6 V each. A 9V works too. Pick the appropriate battery clip.
- Optional: a toggle switch. I used an single-pole-double-throw (SPDT) or "changeover" switch, and I use it to switch between USB and Battery power. Since I usually don't have USB power available, this turns the power selector switch into a simple power switch. This lets me turn the box off and save battery when I'm not using it.
- A decent soldering iron and some good solder.
- Some spare wire. Solid-core is a bit easier to work with.
- Some heat-shrink tubing is very useful. You can do without if you need to.
- If you're using heat-shrink, you'll need a heat gun to shrink it. A good hair dryer will do in a pinch.
- Wire cutters / wire strippers
- A ruler for measuring out dimensions to drill holes in the enclosure lid
A drill and a few drill bits:
- A center punch and a hammer to mark the center of the holes you're going to drill. This keeps the drill from "walking"
- A small drill for drilling starter holes. A 1/8" drill will do nicely. You'll start all your holes with this drill, then step up to the appropriate size drill bit for the hole.
- The switch I used required a 3/16" drill bit for the final hole.
- The potentiometer I used needed a 5/16" drill for the final hole.
- The potentiometer I used also had a small tab to prevent the pot from turning when you turn the knob. This is pretty typical. The 1/8" drill should be enough to take care of this.
- You might need to trim some length off the potentiometer shaft to make everything fit nicely. I used a dremel with a cut-off wheel for this. A hack saw works just fine, too. You'll have more success with the hack saw if you have a vice to hold the part still.
When you've gathered the things you need, check out the next step to see how to connect the potentiometer to your breakout board!