Arduino Wireless Communication via the Electric Imp

Pages
Contributors: jimblom
Favorited Favorite 8

The Plan

Let's quickly discuss the components involved in our Arduino-to-Arduino data pipeline, from the Imp to the Impee to the Arduino.

The Electric Imp

The Electric Imp is a powerful WiFi-enabled development module disguised as an SD card. It's incredibly easy to get up-and-running, and equally easy to code and use. It works perfectly as an intermediary between the hardware world and the world-wide-web.

Electric Imp Card ISO

The devious Electric Imp module.

Among the many features packed into the tiny Electric Imp module is a trio of UARTs, which handle asynchronous serial communication. Serial communication just happens to be one of the more popular Arduino-to-machine communication methods. So, the goal is to setup a serial-based portal of communication between the Imp and Arduino.

The Electric Imp Agent

Using the Electric Imp IDE, Imps can be programmed to communicate with an agent. An Electric Imp agent is a server-side piece of Squirrel code that can pass data to-and-from the Imp, and also deal with Internet traffic.

Imp IDE

The Electric Imp IDE. It's here that we'll write code for both the electric imp module, and its agent that interacts with the Internet.

In this tutorial we'll need to write separate pieces of code for the Imp and the agent. They'll work hand-in-hand to transmit data between Arduinos.

The Impee

To use any Electric Imp, you'll need an Impee - the host board or socket that is designed to interface with the Imp. For this tutorial, our Impees are going to be the Imp Shield, but you could also make do with the Imp Breakout, or an Impee of your own design.

The Electric Imp Shield (left) and the Breakout (right).

Either board will work, but the breakout will require an extra bit of wiring that the shield already takes care of. Read about that on the next page.

The Arduino.

Finally, you'll need an Arduino. Just about any Arduino should do, all you really need is a UART, which they should all have. If Arduino isn't your thing, feel free to adapt the Arduino code and hardware to your favorite microcontroller platform! We'll make use of our friend, the RedBoard.

alt text

On top of writing code for the imp and its agent, we'll also need to write a short Arduino Sketch. Just a simple example that can send data serially to the imp.