The Linux Foundation Projects
Skip to main content
By | February 22, 2018

Simplified IoT Powered by EdgeX Foundry

Guest blog post by Siddharth Tiwari, Chief Architect, Application and Big Data/IoT Transformation for Dell EMC

IoT is not just a buzz word, it’s a new way to make our surroundings and our lives more interactive and responsive. Here at Dell, we interact with customers day in and day out discussing various problems and issues.  Some relate to supply chain, some relate to fraud, some to yard management and then some to just mere optimizing customer interactions. Over time, I realized that many of these issues can be simply resolved by introducing more connectivity across various assets through the Internet of Things.

It’s easier said than done – connecting things together can get quite complex. Imagine having 100 people in a room. They’re all speaking different languages and trying to have a conversation. This is similar to what happens when one tries to connect desperate assets together. For example, some devices may talk SNMP, while some other may communicate over BACNET. It becomes challenging to bring all of them on to a common platform.

But not to worry!! EdgeX Foundry has come to the rescue! First of all, it simplifies the architecture, which can become really complex, by adopting a modular micro-service based approach. Secondly, since it’s highly extensible, it allows one to add and customize it based on needs. Last but not least, its footprint is so small that it can be easily run on something as small as a Raspberry Pi.

In this blog, I am going to demonstrate how EdgeX Foundry is simple to architect. When combined with our top of the line skills around data science and architecture, it becomes one of the most effective tools to solve really complex issues.

So, as a matter of introduction, I have been living in Arizona for a large part of my life. One issue I have had always grappled with has been the balance of Temperature and humidity. According to experts for healthy lifestyle, one must have at least 40 to 50% of humidity maintained at all times, whether winters or summers. But, when you live in a hot and dry place like Arizona, what you get is mostly 1% humidity, and as soon as winter arrives, all the heating from Air-conditioning reduces internal humidity again to 2 to 4%. Then you grapple with a challenge to maintain optimized temperature and humidity, which made me run my thermostat and humidifier constantly.

So that was my problem, and being a data scientist, I knew I can model this correlation out and create some kind of rule for optimizing the same. But, to achieve this, I needed consistent data and a little bit better enterprise grade acquisition mechanism and then resources to model this. After a lot of research, I found EdgeX, which helped me answer a lot of things in a straight forward manner. Finally, I decided to take more of an IoT approach to this problem, similar to how we go about helping our customers, so that I can repurpose some of this at an enterprise level.

What I needed to do were following:

  1. Ability to collect temperature and humidity outside, and at various locations inside.
  2. The collection points should operate at really low energy and must send all the data wirelessly.
  3. A gateway which could collect all this data and route it where I can store the data reliably.
  4. Ability to distribute the same over the internet, and utilize a publically exposable service to access data over an API.
  5. A rule engine, so that I could get a trigger over to take decisions.
  6. Something that can take these rules and convert the same into commands.
  7. Integration between my Thermostat and Humidifier.

Now, it was important to assign bill of material to above, so I chose following:

  1. Low power temperature and humidity sensor:- DHT22
  2. Low power module to broadcast this data: ESP8266 wifi module
  3. Dell 3000 to act as gateway
  4. EdgeXFoundry the brains, which gets all this data and routes it to end points
  5. Raspberry pi zero, which ran SNMP service to broadcast temperature and humidity so that edgeXFoundry’s device-snmp service can walk SNMP messages and distribute to external end points.
  6. Alexa SDK which became my central command center
  7. A Smart thermostat
  8. Humidifier
  9. A GPU based PowerEdge server to perform all the Deep Learning and Machine Learning activity

The Architecture looked something like below:

The first thing to be done was to broadcast the temperature and humidity values over from ESP8266 modules over UDP to Raspberry Pi and then extract the message from the packets and then make them accessible over SNMP.

We created firmware, which got the analog data from the sensor and broadcasted those values over UDP, over to raspberry Pi which was running SNMP service. Once we had the packets arrive, we needed to extend SNMP to broadcast humidity and temperature over two different individual OIDs. Honestly, this was the most difficult part.

Now, came EdgeX and rest of the things were cakewalk. Just three things and we were set:

  • Create an addressable
  • Create a device profile
  • Attach the device to a service – SNMP in our case

Now, all set to distribute data over to cloud hosted MQTT broker. Once we had all the data over to cloud, we created two streams: one where we utilized EdgeX Foundry’s rule engine to trigger certain events using Alexa’s SDK and the other to do all the machine learning in the backend and integrate the same with Alexa SDK to provide a decisioning engine.

We grabbed all the data in Azure to create real-time dashboards and collected data in a PowerEdge machine and ran multiple algorithms every 10 hours to create correlation between Humidity and Temperature and use it to tweak the level of Air conditioning, heating and humidification.

We ran hexplot, robust and KDE to make sure, we are getting best correlations, some of the outputs of the algorithms looked as below:

As it shows while temperature as more distributed pattern, humidity has single collocated pattern and both have a negative correlation coefficient of -0.6 and that is consistent across all three plots.

We used elastic search hosted in Azure to pull all this data and plot it on real-time using kabana.

Real-time Azure Dashboard

 

All events inside Elastic search

 

Visible negative correlation

While this is basic, it gave me a lot more useful and optimized methodology to maintain a balance between temperature and humidity. Not only this, I was able to predict certain level of impact of outside conditions towards the environment inside.

These parameters were exposed via a python based decision module to utilize Alexa SDK to proactively manage when and by how much I should humidify, cool or heat my home.

What was the outcome? Well EdgeX enabled me to simplify this task so much that it takes minutes for me to add more devices and definition to the data I receive or collect. Moreover, I maintain humidity of around 42% consistently around me, and as a byproduct I have ended up saving more than $35 on an average on my electricity bills.

Bottom line is, while IoT is a complex animal to handle, EdgeX makes it quite easy to integrate various different kind of devices and while doing that provides scalable way to distribute all this data to external endpoints. It automatically creates and enables a rules engine, which can take this information and enable one to create various triggers to effectively realize the potential of IoT.

On top of all this, our services enable simplification of complications which inhibit IoT adoption, from Engineering, data science and business perspective. Power of connected things is endless, and our solutions help streamlining and simplifying their adoption on all aspects.

If you have questions or comments, visit the EdgeX Rocket.Chat and share your thoughts in the #community channel.