Building my Cognitive Box with IBM Watson and a raspberry PI

Building my Cognitive Box with IBM Watson and a raspberry PI

What happens when virtually every thing is an Internet device? The result is the "Internet of Things"—a vast, invisible, global network in which nearly every product and physical object, including toasters, trees, milk cartons, mall parking spaces, cars, roads, smartwatches, and medical equipment have been tagged with sensors that gather and transmit data about people's consumption, usage patterns, location, and more to the cloud.

Over the last few years the Internet of Things has come to the forefront, with sensors and actuators becoming more common. Elevators, cars, trains, planes, floors, pipelines – they can all be connected – sharing crucial information on their condition or use.

There’s already over 29 billion things connected, and recording, and processing data. Which is why the IoT is well on its way to generating $11 trillion in economic activity by 2025.

IoT is already changing the way we interact with the world. The IoT is enhancing interactions with the things we rely on in our daily lives and it's present in nearly every aspect of our lives and work.

I have a dream: living in a connected world. I'm doing my small part at home, connecting almost everything I can in my apartment, from the Smart TV to my robotic vacuum cleaner... but now I am going to a new level... I am taking them to the cloud by myself with a sweet taste of Artificial Intelligence... or as we call it here: Cognitive.

I've been learning and working in background with IoT since I start to working in IBM and I'm always amazed by the world of Watson and the Internet of Things, now I decided to put it together having fun with IBM Watson IoT Services and a Raspberry PI.

I bought a Raspberry last month but I did not have so much time to work on it.. but everyday during my commuting to work I had time to have some very interesting training on Watson IoT and programming so I feel ready to start start my greatest IoT projects now.

As usual I have some very high expectations so my plan is to build a complete CognitiveBox integrating on it as many IBM Watson services I can like Watson Conversation, Tone Analyzer, Discovery, Text2Speech, Speech2Text and of course Watson IoT.

At the end I expect to be able to perform several actions, connect and control many of my home devices and of course to talk with Watson using natural language with my CognitiveBox. At the end of this... i will learn a lot about Internet of Things.

So, after assembling my Canakit Raspberry PI 3 in a very fancy and ecologic Laser-cutted wood case by C4Labs and applied a beautiful IBM Watson stick on it... I was ready to start.

First step was to install the OS following the very clear instruction on the official Raspberry PI Web site. The OS installation is very smooth and easy and in some minutes I could login on a Raspbian (a Raspberry dedicated Linux Debian version).

With a very stable and fast clean Linuxbox connected to internet via wifi and a lot of ideas on my mind the first steps to do was connect my CognitiveBox to Watson IoT platform. My plan consists in control this Raspberry PI using Watson IoT services, Node-Red and a lot of scripts.

The procedure to Register the Raspberry PI on Watson IoT platform is very easy. The IBM Watson IoT Platform is a fully managed, cloud-hosted service that makes it simple to derive value from Internet of Things (IoT) devices. When combined with the IBM Bluemix platform, Watson IoT provides simple, but powerful application access to IoT devices and data.

I will use some analytics and some very nice visualization dashboards with the data I will collect from my CognitiveBox. I found an article on IBM DeveloperWorks' website that shows exactly what I had to do to setup my Watson IoT Organization and register devices in it and at the end it took less than 10 minutes to complete. Now my Raspberry is ready to become a CognitiveBox!

Just to make some programming exercises, I've deployed a pair of scripts to connecting my CognitiveBox to the IBM Watson IoT Platform. I'm using Node-RED, a programming tool for wiring together hardware devices, APIs and online services like Watson in new and interesting ways.

Node- RED provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.

As first exercise, all I did is to connect my CognitiveBox to Watson IoT to collect in real time my CPU temperature following this article here. Actually I do not install a fun on my CognitiveBox and I am planning to Overclock it.. so keep one eye on my CPU temperature is something useful... next week I will have a fun installed, anyway. In some minutes I could see my CognitiveBox sending data to Watson. But I want more...

The next step was a little more complicated. I had three smart Playbulb lamps by MiPow that I wanted to control using Node-RED and Watson IoT. The Playbulb can be controlled via bluetooth so the control flow consist in pair it with my CognitiveBox's bluetooth system, send the bluetooth inputs and outputs to the Node-RED flow and from there... sent it to Watson IoT for analytics, reporting and control through simple commands.

All the procedure is covered by this article here and the whole code is available on Github. Basically, after pairing the bluetooth candle and setting up the environment and the scripts I'd proceed to point the CognitiveBox to Watson IoT Platform, setting the credentials in the .js scripts in order to publish events and receive device commands to control the Candle using Node-RED.

Connecting the lamp on the cloud with Watson IoT allow me to perform a lot of interesting actions based on thresholds, states and conditions. For example, I can use the weather company service available in Bluemix and added it to an IoT/Node-Red instance. Basicaly I can build a visual representation of the temperature like blue = cold , red=warm and blink blue = very cold and set the lamp color based on this states. Or I can use IBM Watson Tone Analyzer and Twitter to change the Candle Color according to my Twitter mood based on hashtags. Like #Winter (White) , #IBM (Blue) or #Hot (Red) for example. The possibilities are infinite.

This is the first part.. next week I will complete the integration with IBM Watson Conversation and Speech services... so my CognitiveBox will start to speak!!! I am very excited and I can't wait for that!

If you want to know more about IBM Watson IoT Platform.. let's talk about it!

thanks!

Jair Ribeiro


Sabyasachi Dey

Data & AI Architect | Data analytics delivery @ Deloitte

7 年

Fun ARticle!

回复
Christophe Lucas

Solutions Engineer at IBM Australia

7 年

Great, fun article. Thanks Jair Ribeiro. For your second part (with the Watson Conversation service), this might help: https://developer.ibm.com/recipes/tutorials/talk-to-your-sensor-using-the-watson-iot-platform-and-conversation-services/

要查看或添加评论,请登录

Jair Ribeiro的更多文章

社区洞察

其他会员也浏览了