Friday, June 05, 2015

Bluemix, the Internet of Things and Node-RED


RTP Internet of Things Design Challenge

The Internet of Things (IoT) is all the rage these days. I have a basic understanding of the concept but wanted to learn more about the development of IoT devices. So I was excited when I heard about the RTP Internet of Things Design Challenge because it seemed like a great way to learn about IBM's Bluemix cloud tools. The link below has information about the challenge (links for information about the sponsors are at the end of this article). 

IoT Design Challenge - sponsored by The Research Triangle Park, IBM, TiE Carolinas, BKon.

Kickoff 

The first event in the Design Challenge provided an overview of IBM's Bluemix platform and how the IBM Internet of Things Foundation let's you interact with the real-world devices that make up the Internet of Things. Several hardware devices and services were demonstrated. The Bluemix platform has a free tier of service that allows you build entire IoT applications at no charge. But you do have to enter a credit card after you complete a 30 day free trail.


The IoT Foundation Service acts as the gateway for data flowing between the Bluemix cloud and your device. There are examples for several common devices (Arduino, Raspberry Pi, etc.) and instructions on how to set up a generic device if you are using another kind of device. The system also offers a device simulator that runs in a browser tab and sends information to the cloud like a real device.

Workshop 

The second event was a workshop showing the nuts and bolts of how the devices communicate with the Bluemix cloud introduced Node-RED and how it is used to process and respond to the data coming form the devices. 

Node-RED runs on Linix/OS X and allows drag-and-drop elements to provide processing functions without requiring text based programming. Node-RED lowers the barrier of entry to provide access to programming to people who come from non-programming backgrounds. Node-RED runs not only in the cloud but also directly on hardware platforms like the Raspberry Pi.

Node-RED opened with an example program (or flow) that received temperature from your device and sends a message to the debug tab of the IDE indicating if the temperature exceeds a preset threshold. This is basically the "Hello World!" of the Internet of Things, or should that be "Blink"?

This workshop is also where information was provided about project submission for the Challenge. They told us that you needed a team to submit and application for the challenge.  I went to the event solo with the goal of just learning the tools, so I had no team and no project to implement. A few of us in the same situation coalesced after the session and joined efforts. Our team became "The Observers" as a tongue in cheek reference to our initial intend to just watch and not enter a project in the competition. 

The Observers

Our team (LaVern Witherspoon, Gunes Yucel, Mike Liu and me) had a great range of backrounds. Interestingly there was very little overlap between our specific skills. LaVern (@LaVernOWithersp on Twitter) is a software engineer with experience in IP telephony, data networking, protocols and database applications for embedded platforms. Gunes (www.linkedin.com/in/gunesyucel/ on LinkedIn) is a cognitive neuroscientist with interest in UX research and mobile development. Mike is a software engineer and science researcher with a decade of experience in teaching, research and design.  Which leaves me, the hardware and microcontroller guy. We had a great set of skills and tools at our disposal and looked forward to building... something.

Finding a project to do was a little daunting. Staring at a blank canvas of unlimited possibilities is daunting. We finally settled on an actual real-word problem, an internet connected door lock control for the Raleigh MakerSpace that can be controlled from your smart-phone.

The Challenge

The problem to solve is how to provide convenient electronic lock control for members of the Raleigh MakerSpaceThe Raleigh MakerSpace has a work-space with a CNC milling machine and Laser Cutter that can be used by members on an as needed basis. The most convenient access is via an industrial overhead door with an electronic solenoid lock currently access via individual RF key-fob transmitters.

The current RF key-fob approach has many limitations including, requiring a new fob for each member, the lock must be trained to recognize each fob, the lock supports a limited number of fobs requiring operating the fob while lifting the door and extended operation of the fob can and has burned out the solenoid.


The Solution


The proposed solution requires the inter-operation of three components, a smartphone to send an unlock request, a cloud service to receive and process the request and network connected hardware controller that can control the lock. The rapid prototyping tools in Bluemix allowed us to quickly build a proof-of-concept solution that allows members to unlock the door using any smartphone that can send e-mail. This project was built by modifying existing IBM example flows in Node-RED and existing source code examples on the Arduino Yun. A member can unlock the door by sending an e-mail containing their Access Code to a gmail address. A Node-RED flow on Bluemix monitors the incoming e-mail address for the presence of the Access Code. Once a valid Access Code is received, the Node-RED flow uses the IBM IoT Service to send a message to an Arduino Yun to unlock the door. This solution is superior to the previous RF key fobs because new members do not need a RF key fob, only an Access Code. The lock does not need to be trained to recognize each RF Key-fob. Access is no longer limited by the number of RF key fobs that can be remembered by the lock. In addition, the new system allows the facility to disable a user’s Access Code without requiring keys to be track down and returned.


Results


The final date of the event was presentation of the projects at The Frontier in RTP (a great facility with frequent events for local entrepreneurs, check them out). Below is photo of The Observers team holding our our check after we placed 2nd in the competition!

I had a great time, thank you LaVern, Gunes and Mike! I am the one rocking the Maker Faire North Carolina shirt.


Lessons Learned


There were several factors that played a roll in our success. First, we focused on an existing problem that allowed us to narrow the scope of our effort. Although stalked by feature creep, we were diligent in dropping features if it became clear we were not  going to be able to have it working to our satisfaction by the submission deadline. We focused on optimizing and explaining the benefits of the features we were able to implement. Finally, our presentation provided the information listed in the judging criteria in the order listed in the judging criteria. (This last one is like a secret super power. Do not surprise the people reviewing your project or proposal. Give them what they ask for in the order they specified. This makes it easier for them to like your product.)

Preparation also paid off in our presentation. We presented 2nd and our demo did not work because we were unable to get our Arduino Yun connected to the guest WiFi. Fortunately our next slide was Risk Factors and the first risk listed was "Adding device to WiFi network". So we demonstrated to the judges (including two IBM Fellows!) that we understood the real-world risk factors involved in rolling out an IoT device and service. It turns out most of the team demos failed due to WiFi connection issues but few if any other teams list this as a risk factor.

Given IBM's planned huge investment in the Internet of Things, it looks like Bluemix will be a player in shaping the future of IoT. I recommend checking out Bluemix and it's every growing roster of resources. I had a great time. Thank you to Research Triangle Park and the other event sponsors!Shane



Files

Here are links to the slides from our presentation and the source code on GitHub.




RTP Internet of Things Design Challenge Sponsors

The Research Triangle Park - a not for profit that is committed to supporting education, serving our partner universities, creating knowledge-based jobs across the state and improving the quality of life for all North Carolinian's.

IBM - Bluemix is an open-standards, cloud-based platform for building, managing, and running apps of all types, such as web, mobile, big data, and smart devices. 

TiE Carolinas - a not-for-profit organization with a mission to foster and support entrepreneurship in the Carolinas.

BKON - We make beacons and the software that makes them smarter.


No comments:

Post a Comment