Data Storage and Retrieval with ThingSpeak for Electric Imp Connectivity

Electric Imp is a connectivity platform for connecting Wi-Fi devices to cloud services, much like RealTime.io and Iota Wi-Fi modules and Spark.io. Some Electric Imp module’s come in an SD card form factor and adds Wi-Fi connectivity to what’s connected to the Electric Imp module. Access to the Electric Module happens via the Electric Imp cloud and its APIs. While connectivity is simplified with the Electric Imp system, you will need a data service like ThingSpeak to complete the Internet of Things experience. Once data from Electric Imp devices are in ThingSpeak, you can easily build applications and interactivity with other devices and platforms.

Electric Imp to ThingSpeak Overview

Once an Electric Imp module is connected to a local Wi-Fi network, the module can post data to ThingSpeak via an “agent” running on the Electric Imp Cloud. Any data can be sent to ThingSpeak and then retrieved via ThingSpeak APIs.
Electric Imp to ThingSpeak Internet of Things

Stuff You Will Need

Step 1: Create ThingSpeak User Account

In order to get started, you will need to have a free ThingSpeak User Account. If you have a user account, sign in and move to the next step.

Step 2: Create ThingSpeak Channel

ThingSpeak Channels are were data from Electric Imp will be stored. This procedure will create a blank channel ready for data from your Electric Imp Wi-Fi module.

  • Sign into ThingSpeak
  • Select Channels
  • Click “Create New Channel”
  • Enter a name for your channel, “Electric Imp Channel”
  • Enter a name for Field 1, “Analog Input”
  • Click “Update Channel”

Electric Imp Blank ThingSpeak Channel

Step 3: Assemble Electric Imp Breakout Board

  • Solder headers into the Electric Imp Breakout board (SparkFun Tutorial)
  • Jumper the power jumper to the USB side so that the breakout board can be powered with a USB cable
  • Insert the Electric Imp module into the SD slot of the breakout
  • Plug Mini USB cable into a 5v DC power supply and connect it to the breakout board

Step 4: Create Electric Imp User Account

  • Visit ide.electricimp.com/login
  • Sign in with your existing Electric Imp Account or sign up for a new Electric Imp User Account

Step 5: Register the Electric Imp to your User Account with the BlinkUp App

  • Download and install the BlinkUp App (Apple App Store / Google Play)
  • Sign into the BlinkUp with your Electric Imp User Account
  • Enter your Wi-Fi info
  • Select “Send BlinkUp”
  • Hold phone to the edge of the Electric Imp Wi-Fi module

Electric Imp BlinkUp
Note: If the BlinkUp fails, try checking the “Legacy BlinkUp Mode” option.

Step 6: Program Electric Imp via the Planner IDE

In this tutorial, we are going to send the Analog Input value from Pin 9 of the Electric Imp to a ThingSpeak Channel. In order to program the Electric Imp, sign in and copy the Electric Imp sample code into the Electric Imp Web-based IDE.

  • Visit ide.electricimp.com/login
  • Sign in with your existing Electric Imp Account
  • Select the registered Electric Imp device
  • Copy the “send_analog_input/agent.nut” example code into the Agent section
  • Change the “X-THINGSPEAKAPIKEY” from “XXXXXXXXXXXX” to your ThingSpeak Channel’s Write API Key
  • Copy the “send_analog_input/device.nut” example code into the Device section
  • Click “Build and Run”

Electric Imp ThingSpeak Code In IDE
If everything is working correctly, you will see the analog input value from Pin 9 of the Electric Imp in your ThingSpeak Channel chart for Field 1.
Electric Imp ThingSpeak Data Channel
 

Resources

Electric Imp Projects with ThingSpeak

Electric Imp Temperature Logger with ThingSpeak
 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.