TI @ Embedded World: Energy harvesting for home automation

Other Parts Discussed in Post: ENERGIA

 At electronica in November, we highlighted our latest solution for energy harvesting. We saw tremendous interest, but knew there was a critical piece we could add to make it just a little-bit more exciting. Have you figured it out yet?

At the embedded world this week in Germany, we will be showcasing this demo again, now complete with cloud connectivity! The last post on this topic (linked above) highlighted the hardware:

This time, we leveraged the SimpleLink Wi-FI CC3200 LaunchPad as a central hub and wanted to share the code we used to connect to the cloud. To do this, we leveraged Energia, the rapid prototyping development environment for LaunchPads. We used it to send all of our sensor data to Exosite, a cloud service which was leveraged to monitor a home or building automation focused sensor network.

As you can see in the portal above, our Exosite dashboard monitored 4 key things over the internet:

  • Motion - could be used to control lights as people enter or exit different rooms, to minimize electricity used for lighting
  • Ambient Light - could be used to open your bedroom blinds in the morning or to control light coming into a house or building to manage decrease the use of air conditioning
  • Temperature - could be used to communicate with a thermostat, essentially extending understanding of the home/building environment to better control the air conditioning or heating from its single remote location
  • Moisture - could be used to notify you in the event of a flood, or could be used to control a valve for watering your favorite plant

This implementation was created using the Wi-Fi Exosite Client example C code, as well as the simple Wi-Fi applications in Energia. The software really consists of three components:

  • Connecting to the network
  • Communicating with Exosite
  • Code for debugging

Connecting to the network is pretty straightforward (given you have the SSID and password) using the available Energia code:

  WiFi.begin(ssid, password);
  while ( WiFi.status() != WL_CONNECTED) {
    // print dots while we wait to connect
    Serial.print(".");
    delay(300);
  }

The next piece was getting all of the content together and in order to connect with Exosite. This cloud provider uses an HTTP connection for receiving data.

// this method makes a HTTP connection to the server:
void sendData(String thisData) {
  // if there's a successful connection:
  if (client.connected()) { 
//    Serial.println("connecting...");
    // send the HTTP POST request:
    client.println("POST /onep:v1/stack/alias HTTP/1.1");
    client.println("Host: m2.exosite.com");
    client.print("X-Exosite-CIK: ");
    client.println(CIKKEY);
    client.println("Content-Type: application/x-www-form-urlencoded; charset=utf-8");
    client.println("Accept: application/xhtml+xml");
    client.print("Content-Length: ");
    client.println(thisData.length());
    client.println();

    // here's the actual content of the POST request:
    client.println(thisData);
   
    // last pieces of the HTTP POST request:
    client.println();

  }
  else {
    // if you couldn't make a connection:
    Serial.println("connection failed");
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
  }
  // note the time that the connection was made or attempted:
  lastConnectionTime = millis();
}

Armed with the lowest-power microcontrollers on the planet, built to run on nothing but ambient energy, you could add intelligent information to any system. Now, by connecting data from the network to the cloud, the possibilities for a better life are only limited by your imagination. Are you using MSP430 microcontrollers in a system with Wi-Fi connectivity? Share with us in the comments and you may be featured in the next edition of Community Highlights!

Anonymous