Hands on with the Electric Imp

A while ago we caught wind of the Electric Imp, a very cool little device that packs an ARM microcontroller and a WiFi adapter into an SD card. We got our hands on an Imp last week, and now it’s time to show off what this little device can do. You can check out the rest of this hands on tutorial with the Electric Imp after the break.

Sorry for filming this with a potato.

In the interests of full disclosure, I paid for my Imp and dev boards out of pocket ($25 USD for the Imp, $25 for the Hannah dev board, and $7 for the April board), but [Kevin Fox] over at Electric Imp was kind enough to bump me to the front of the queue for developer units.

As you can see, it’s fairly easy to connect an Electric Imp to the Internet, but what about doing something useful? For that, Electric Imp has a cloud-based IDE to develop code and push it to Internet connected Imps.

Click to embiggen

When you first connect your Electric Imp to the Internet and log on to the Electric Imp ‘planner,’ as it is called, you’re presented with a blue box representing your Imp and dev board. In the picture above, I have a ‘Hello World’ program running on my Imp that simply passes a text string to the cloud. In this case, my Imp has sent ‘Hello World’ to the cloud.

Displaying a line of text is all well and good, but how about something with a little more I/O? Clicking on the ‘code’ link above the planner allows you to write your own code for the Electric Imp:

I used a piece of example code for the Hannah development board called colorblink. It’s nothing too terribly complex; it uses the I2C port expander on the Hannah to cycle an RGB LED through a few colors. Uploading the code to my Imp is a piece of cake:

Again, sorry for the potato.

So there you have it, folks. A wireless, cloud-based microcontroller platform that fits inside an SD card.

As far as the Electric Imp is concerned, I’m going to go on record and say it’s a neat piece of hardware that functions exactly as advertised. I must point out, though, that even though the Electric Imp comes packaged inside an SD card, it’s not an SD card. There’s currently no way for you to plug Electric Imp into an SD card socket connected to an Arduino (or other microcontroller platform) and have it function like an Eye-Fi.

There’s a good amount of info covering the necessary support hardware over on the Electric Imp dev wiki, and surprisingly the Imp doesn’t need much. The only components necessary to turn an SD card socket into an Electric Imp-able piece of hardware is a small crypto chip connected to pin 6 on the Imp. This chip provides the necessary identification for the Electric Imp IDE/cloud environment. This makes it very easy to add an Electric Imp to whatever project you’ve got in mind.

There’s a lot I haven’t covered with this short tutorial, including pushing data from the Imp’s cloud environment to your server (thus making it possible to use the Imp as a wireless sensor platform), or connecting an Imp to other hardware designed for this ‘Internet of Things’ I’ve been hearing about. I’ll start working on a few demos for later this month.

For me, I only have two issues with the Imp: first, the Electric Imp requires the use of the Electric Imp ‘cloud.’ I’d really like to see another Imp developer come up with a way to either run my own Imp cloud, or simply program an individual Imp to work with a non-Imp server.

Secondly, and I think it’s necessary to reiterate this point, the Electric Imp is not an SD card. The Electric Imp provides no storage; it just happens to be a small microcontroller platform with a WiFi adapter stuffed into the shell of an SD card.

I’ve looked through the documentation for the Electric Imp and found that all the pins required to write to an SD card are available as GPIO pins. This leads me to believe it might be possible to write a bit of code to emulate an SD card and make the Imp serve as an invisible bridge between a microcontroller and a server. Yes, it might just be possible to turn the Electric Imp into an Eye-Fi, but don’t quote me on that.

In short, the Electric Imp is really cool, does everything it’s advertised to, and shows a lot of potential for WiFi-enabled builds. I’ll play around with this a little more and keep Hackaday readers updated.

Comments

  1. gabriel says:

    the SD format is very weird.

    i’d love it if i could:

    – transfer code to it via usb mass storage

    – power it via standard SD card interfaces available everywhere.

    • tlalexander says:

      Well, there isn’t much point in transferring code to it over USB, as the code won’t be useful until the imp card is in an imp device, and at that point you can just transfer code over wifi. I have successfully connected to them over my phone’s wifi hotspot, so you definitely can do it even out of the range of wifi.

  2. DanJ says:

    How are imps provisioned in the field? Let’s say someone designs an imp-based product to be used by non-technical people. Do these people have to run some app on a smart phone or computer pointed at the imp to put it on a local network? Does that app also somehow associate the imp with whatever service account would be associated with the device?

    • The app associates my Imp with my Electric Imp account and the WiFi credentials.

      • DanJ says:

        Thanks. I figured that much out. I’m thinking in terms of deploying an end-user product (not a dev system/acct). How do the end customers get the product (they don’t know there’s an “imp” in there) on a network. And how is the product associated with the service account the device manufacturer/service provider has to maintain (which I would think is different than an acct with the imp people). IMHO, this kind of stuff is really important and has to be drop-dead easy.

        I guess I have to go dig in further on their website.

      • SilentDirge says:

        The imp must first be configured by the end-user for internet connectivity (via blinkup) and that’s it on their end. That cryoto chip is what identifies your device to the electric imp service. Your code is then downloaded to the imp which allows it to execute the function associated with the host device.

  3. 8r13n says:

    This needs AdHoc support, I didn’t see that mentioned but WiFly has it and that makes setup a breeze for applications with no UI. I can simply have my users aim at the WiFly’s AdHoc out of the box, select a WiFi to join. Without that option, setup of any WiFi device (with no screen) is complicated for “most users”

    • tlalexander says:

      setup is already a breeze. You log into the app on your phone, pick a wifi network, and hold your phone up to the imp. Its super easy. (I’ve got some imps already)

  4. Greenaum says:

    Perhaps, if the Imp company don’t mind, they could let out the protocol they use for optically programming the network details. Or at least, give out the bytes / sequence of flashes needed to set it up for your application. So you could put an LED next to it, and program it while it’s inside the case of whatever you’ve put it in.

    Does the “cloud” mean you need to be in range of Imp’s own wifi, or can it connect thru any wifi onto the Internet? Cos implementing a “cloud” like this throughout the USA / world is a bit of a gigantic enterprise, if I understand it right.

  5. Galane says:

    So it’s not SDIO? Isn’t pin compatible with any SD card standard?

    Well, there goes any plan of buying up cheap Palm Tungsten E2* PDAs to do stuff with this device.

    *Or any other sort of PDA with SDIO support.

    • tlalexander says:

      Yeah, but why would you want to do that?

      if you want a wifi-capable palm tungsten, just buy an old android phone off ebay for $30 instead. It will be way more capable. That’s not what Electric Imp is trying to do. They’re trying to make a cloud-connected device that is as easy to use as an arduino, and it’s awesome. I know because I’ve got some and they’re really cool.

  6. tedmeyers says:

    So, it is not SD compatibly, and you have to add some freakin crypto chip (probably expensive) to use it outside of their dev board?!? Eh, let me know when these issues are resolved, until then — PASS!!!

    • The crypto chip is only used to get a unique ID for every Imp-compatible device. It’s not an expensive chip (either in cost or implementation), either. It’s less than a dollar for a quantity of one, and it only requires three connections: power, ground, and the data line to the imp.

      Hell, you could probably put the Imp in any Arduino project by emulating the crypto chip on an ATMega.

      I’m not going to write off the Imp until it’s in the hands of the hardware hacker gods for a few months.

    • tlalexander says:

      Yeah, the crypto chip is actually what makes it awesome. Its a unique device identifier that tells the imp what its plugged into, so you can pull it out of your garage door opener, plug it into a washing machine, and it instantly knows its in a washing machine and begins running the appropriate code.

      The crypto chip is made by Atmel and its just an identifier. Its not some secret lockout scam, its just how the imp determines what code to run. It boots up, reads the ID chip, connects to wifi, and then downloads the appropriate code for that device. It makes swapping the imp between devices super easy.

  7. Az says:

    Here’s another voice to proclaim it’s a fantastically neato idea, but for the lack of actual SD intercompatability and need for the crypto chip/custom adaption of the SD footprint.
    And here I was with dreams that I could shoehorn one of these into an MP3 player with rockbox…

    • tlalexander says:

      Actually, its significantly *better* than if it was SD compatible. If you want an SD-compatible wifi adapter, they sell those. This is meant to be basically a wifi-arduino. By not being SD compatible they can use all the pins for whatever they want.

      I’ve been to their office, met their CEO, been to an Imp hackathon, I’ve got several imps and dev boards, and I’ve already got a neat android app on the market to do neat things with an imp – I know more about them than most people.

      These things are superpowered, and if they’d stuck with SD compatibility, they’d be significantly less powerful.

      Think about how it would be if you wanted to use an imp to toggle an LED via the internet (for example).

      Currently, you need a PCB with a voltage regulator, an SD slot, the sub $1 3 pin ID chip (power, ground, ID), and an LED (possibly with a resistor).

      That’s 4 or 5 components. Then there’s the code – it’s a couple of lines (i’ve done it and I have an example on my app on the Android Market).

      Now imagine if they just made it an SDIO compatible wifi card – your board would need a whole host microcontroller and that microcontroller would need to be programmed to understand the whole SDIO stack, whatever the hell that is.

      That’s countless more board real estate, components, cost, and code. And why? So that it would also work with the *few* devices on the market that are already SD compatible?

      Someone actually mentioned that they should have just invented a proprietary connector rather than just used SD. BUT WHY WOULD THAT BE BETTER? There is zero advantage to that and it would have just wasted their time. SD slots already exist, SD card housings already exist, and factories already produce tens of million of SD cards a year. Why would they invent a new format?

      You guys are all upset because you see SD form factor, but see that it isn’t SD compatible, and it makes you think of all the things it could have been capable of but isn’t. That’s not the right way to think. Think of all the things it CAN do because it ISN’T sd compatible. Its much, much more.

      • John Beurbe says:

        Exactly. I just got my hands on one of these things. At 30 ish bucks for imp and chip that is a great deal for the potential of this thing. Im having a lot of fun working with it. i just replaced the beagleboard that ran my led sign with this thing. Think of it as a wifi arduino on steroids that just happens to have a dam small forum factor.

  8. From what I can tell, the Imp itself is a WiFi adapter with some sort of read/write memory and a controller. the controller receives info over WiFi and stores it on the RW memory to be read back when the ID Chip is recognized to whatever MCU you attach it to.

    in lame-mans terms its basically a wireless usb drive you cant get into. (slow clap)

    it would be more useful if there was no lockout chip and used a clean footprint (a footprint of their own) or followed the SDIO format.

    in the end, it was a great idea, just poorly executed.

    • tlalexander says:

      Actually that’s not what it is. Think of it more like an Arduino you can hook up to the internet with essential zero effort.

      Its a programmable microcontroller than can read sensors and control things like motors, lights, etc.

      The ID chip is a simple 3 pin device (power, ground, ID) that hooks up to the imp to tell it what it’s plugged into. Every ID chip has a unique number, so when the imp is plugged into a device, it powers up, reads the ID chip, connects to wifi, asks Amazon’s servers what code belongs to that ID number, and then downloads the code for that device.

      The ID chip allows you to pull the imp out of your coffee maker, plug it into your light switch, and it will instantly know its in a light switch and download the appropriate code. So lets say you’re going on vacation. You won’t need coffee but you may want to be able to toggle the lights occasionally to make it look like you’re home (or you may have code that automatically does this when its in the light socket).

      You’ve programmed it for the coffee maker before, and you’ve programmed it for the lightswitch before. Since the code is associated with the ID chip in each device, you can just yank it from the coffee maker, put it in the switch, and now the imp knows its in a switch. When you get home, pull it out of the socket, put it back in the coffee maker, and it’s back to running the code for the coffee maker.

      Its actually a beautiful implementation, its just hard to wrap your head around because its so different from anything we’ve seen.

      • TheAtheistLucario says:

        Then as a developer i see use for this that cant be done without needing cloud or even internet connection. Cheep displays are abound and so are MCUs that can do any job this can, at a lower price, on a platfourm that is end-user friendly.

        Ultimately the Imp is nothing more than a 1-trick Pony for custom-made home automation and even then home automation isnt exactly a widely available convience at this point due to the fact that it generally is not user friendly in the slightest, and when it is its so expensive its obscene. (Sorry for any misspellings, atempting to type on touchscreen)

  9. Tien Gow says:

    If you check out the website, [http://electricimp.com/] you will see that this device is intended as an embed-able controller for appliances. The picture shows a wall outlet with a build-in SD card slot holding an Electric Imp that provides control of the outlet over wifi, but the concept is that the socket can be built into any appliance. The processor is a Cortex-M3, so fairly sophisticated control logic is possible.

    Think of the Electric Imp as a wireless remote that operates over wifi and connects through the internet. The wifi link is two-way, so the Imp can also be connected to sensors. $7 for a wifi link is cheaper than zigbee or even X-10(ugh). However, I suspect the range may be limited by the antenna.

    The SD format was chosen because it is a standard and sockets are cheap and easily-obtained. It has no other connection with SD cards.

    (all info from website — I have no connection with Electric Imp)

  10. Drone says:

    That configure WiFi via the Android screen thing is “Patent Pending” and available for licensing by them.

    Man, if they get a patent for that, then the Patent system is really and truly either corrupt or broken (probably both). But then again they’ll probably find out Apple owns the patent to the technology because they filed five minutes before they did.

    I’ve seen screen programmed devices before, loooong ago.

    • tlalexander says:

      Well, I think it more relates to the specific problems they’ve had to solve with bit-slip due to the huge variety of android devices and hardware. Apparently its been a tough problem for them to solve (though it works great for me). Its probably not so much the protocol that is patented, but the methods for dealing with such a broad variety of hardware.

  11. tlalexander says:

    See my free and open source app on the Android Market:

    https://play.google.com/store/apps/details?id=com.tlalexander.imptoggle&hl=en

    And on github (linked on the market page) for a simple app that lets you turn something on or off through an imp.

  12. slashsplat says:

    Love it. Once you can appreciate the “Internet of Things”, this makes TOTAL sense. Appliances do not need Eye-Fi or SD Storage, they need cheap, remotely programmable micro-computers to interface to. This does that VERY WELL. Impressive concept. The idea of a “local” LED to drive the config would be the icing on the cake. Everyone should STOP calling it a “crypto” chip – it is an “ID” chip. Crypto is misleading.

  13. slashsplat says:

    My first thought was that it would do what I wanted the Eye-Fi to do – send REAL TIME video being written (as a file) to the SD over the WiFi. While this still may be possible here, the Eye-Fi does not seem to be able to do that, and uses a bulk upload method. According to the crappy Eye-Fi broken web site.

  14. time says:

    What I don’t understand is why I would want to move it from my coffee maker to my light socket and back again?! At $25/each, why not just put one in each?

  15. Terry says:

    I wanna control 433MHZ sockets over the web using a smartphone. somehow the local transmitter needs to be patched into the imp dev board – whether this just emulates the button presses or sends real data i’m not fussed!

  16. Terry says:

    It would be great to parse google calendar events as micro-controller instructions. e.g turn on coffee maker at 8am for 30 minutes. turn on porch light at 6pm. Yeah the Electric Imp has the potential to be a huge home automation disruptor, and not without good cause – home auto is a relatively small industry right now with large profit margins for installers and manufacturers. somebody is going to disrupt them.

  17. Nik says:

    One thing I’m really wondering about: Does the imp only need a connection to the impservers on startup, or only for the first setup, or constantly. Let’s say I build a garage door opener with an IMP and suppose my home internet connection gets interrupted, yet I still have power on my router to which the imp and my smartphone is connected. Will I be able to park my car in the garage or will it stay outside until my internet works again?

  18. nohacks says:

    Why would you let anthing in your house connect to a CIA front cloud server to Spy on you.
    If I could run this thing from my own web server fine.
    No data is too unimportant to keep from bigbro.
    I am suprised at the level of trust from a site with hack in its name.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 94,439 other followers