AWS Partner Network (APN) Blog

How to Connect Legacy Machines and Devices to AWS Using the ConnectSense Smart Power Cord

By Gary Marrs, Sales Solutions Architect – Grid Connect
By Carlos Lemus, Principal IoT Architect – Trek10
By Dylan Owen, Solutions Architect – AWS
By Irshad A Buchh, Sr. Solutions Architect – AWS

AWS IoT Partners

The ConnectSense Smart Power Cord allows users to easily connect their legacy edge devices and machines to an Internet of Things (IoT) solution by simply plugging in.

The Smart Power Cord will quickly enable any device that needs 110 or 240 Vac to securely connect directly to an application supported by AWS IoT Core. It can monitor power, provide remote power on/off/reboot, sense customer usage, and provide data that leads to better maintenance schedules.

The Smart Power Cord can be used with motors, pumps, compressors, electric cars, and IT equipment. Ideal applications are monitoring/controlling pumps, commercial appliances, electric vehicle chargers, electric metering, and load shedding.

The ConnectSense Smart Power Cord on AWS Quick Start was developed by GridConnect in collaboration with Trek10, an AWS Premier Consulting Partner with the IoT Competency and a service delivery designation for AWS IoT Core.

Grid Connect is an Amazon Web Services (AWS) ISV Partner and ISO9000 design services and product manufacturing company that provides IoT edge solutions that help companies get their data to the cloud.

The Smart Power Cord Quick Start allows users to deploy secure environments on AWS for a variety of solutions, including mining IoT data and artificial intelligence (AI) tools to help analyze the data and gather insights. The Quick Start allows you to add IoT capabilities into your account in just 10 minutes by creating a serverless IoT backend for your Smart Power Cord application.

Background

The ConnectSense Smart Power Cord Quick Start allows Original Equipment Manufacturers (OEMs) to quickly deploy and scale the Smart Power Cord within their AWS account.

AWS IoT Core provides services for connectivity and device management, as well as all layers of security, including preventive security mechanisms like encryption and access control to the device data.

By using AWS IoT Core Device Management and the Smart Power Cord’s Microchip 608A secure element, the Smart Power Cord can be preloaded with the necessary security credentials that allow for fast, secure provisioning to your cloud application.

Architecture Details

The diagram below shows the Smart Power Cord Quick Start architecture.

Trek10-Smart-Power-Cord-1

Figure 1 – Smart Power Cord Quick Start architecture.

There are two primary components to this Quick Start: the device registration component, and the backend infrastructure.

The device registration component creates an API Gateway Deployment that can be used by the device to self-provision using its on-board certificate. More precisely, after deploying the infrastructure, the developer retrieves the API’s endpoint and passes it down to the device via the utility script available in the ConnectSense Github repository.

The device then uses this endpoint to post its device certificate, which gets used by an AWS Lambda function to register the device and certificate as an AWS IoT Thing.

Once the device is registered, it can connect and publish messages directly to AWS IoT Core.

Messages published by a registered device get processed by rules brokering the message to AWS IoT Analytics and an alerting Lambda function.

The API Gateway Lambda function serves as a proxy to process POST requests from the device to the API at <endpoint_url>/devices/new, and to create a new AWS IoT Thing with the certificate provided in the body of the request.

The posted body contains a Microchip 608B “manifest object” in the following format:

[ { "payload": <b64_string> , "protected": <b64_string>, "header": <Object>, "signature": <b64_string> } ]

The payload is decoded by the Lambda function to retrieve the certificate of the device and create a Thing in AWS IoT for the active account. Microchip Certificates are compatible with AWS IoT out of the box; there is no need to register a new Certificate Authority (CA).

A 200 is returned upon successful creation of an IoT Thing, at which point the device can start publishing messages to the AWS IoT Endpoint.

The SNS Lambda function provides an example of triggering alerts when a threshold excess of five watts is detected in a published message. The threshold excess is detected through an AWS IoT SQL rule:

Select *, topic(2) AS thing_name FROM 'iot8020/+/metrics' WHERE watts > 5.0

In this case, topic(2) corresponds to the unique device identifier. Because rule evaluation happens in AWS IoT, the Lambda function simply sends a message to the configured SNS endpoint.

AWS IoT Analytics is a service that facilitates the process of ingesting, processing, and storing data from IoT devices. It can be used to perform analysis on the data—such as anomaly detection—whose insights can be used to make better and more accurate operational decisions.

The alerting Lambda function is configured with a wattage threshold which, when exceeded, sends a message to an Amazon Simple Notification Service (Amazon SNS) topic. This topic can be configured with an email address or mobile number so that any threshold excesses result in an email or text alert.

Finally, the deployment guide provides a step-by-step guide on how to create an Amazon QuickSight dashboard that helps users to visualize the data.

Conclusion

The ConnectSense Smart Power Cord Quick Start’s deployment guide provides step-by-step instructions for building and deploying a serverless IoT backend on AWS for use with the ConnectSense Smart Power Cord Development Kit.

The Quick Start is for users who want to get started building serverless applications to support their Smart Power Cord application.

At a high level, the following three steps are performed to deploy the Quick Start:

  1. Deploy the provided CloudFormation templates.
  2. Retrieve the API endpoint and use it to configure and connect the Smart Power Cord Kit.
  3. Create an Amazon QuickSight dashboard to visualize the data.

To get started, visit the AWS Quick Start page >>