Toxic gas alert using IBM Watson IoT and nucleo node | Insat's Lab

Document created by HAMDI Mustapha on Nov 27, 2017Last modified by HAMDI Mustapha on Nov 27, 2017
Version 3Show Document
  • View in full screen mode

In this Lab you will learn how to send an email alert from Gas Sensor node " STM32 Nucleo" which is connected to the Watson IOT Platform using Rules and Actions with Cloud Analytics.

Levels: RT5 and IIA5


Received notification by email;



For this Lab you will require:

Watson IoT Platform (registered version)

MBED Compiler account 

Hardware :

STM32 Microcontroller: Nucleo-F401RE
Sensors board: X-NUCLEO-IKS01A2

Gas sensor (you can use low cost Carbon Monoxide Gas sensor sensor such as MQ6). 



step 1 : 

As stm32 nucleo sensor node integrates a combination of hardware boards and pre-built software to enable the fast prototyping of Internet of Things (IoT) applications. you can use  The ST software with ARM MBED ecosystem's here:

 IDW01M1_Cloud_IBM - a mercurial repository | Mbed 

Import the project to your MBED compiler; to connect to the IBM watson IOT in Registered mode you should :

1. Comment : "define ORG_QUICKSTART"

2. Define the node ID , type name and the token which can be generated by Watson IoT during  node registration (step 4.) 

3.  Define SSID and Pass

4. Compile and upload the .bin onto the nucleo, required informations about program execution is printed in serial terminal,  you can use Tera Term tools.  


4. Note : If you choose to connect via non secured mode (port 1883) you should go to the security rules in your Watson IoT Platform and add the following rule "TLS optional": 


Step 2:  

You should connect the sensor node to IBM Watson IOT in Registered mode , please follow instructions here: 

            1.Log in to or register for Bluemix at

            2. In the Bluemix console Select the Watson IoT Platform.

            3. region, organization and space , then create and start : 


         4.  To register the nucleo sensor node and set up rules for notification,  please follow next steps :

      Using Rules and Actions with IBM Watson IoT Platform Cloud Analytics - developerWorks Recipes