Skip to Content
Author's profile photo balaji bodagala

Gas Sensor using Hana Cloud Platform

I have taken business case as, if there is any gas leakage or smoke in room, we will send the data to Hana Cloud Platform, from the mobile device or desktop to view the report and initiate the appropriate action.

Here is the below devices to be used to implement this,

  • MQ-135 Sensor.
  • Bread Board.
  • ESP8266 wifi.
  • Audrino Uno to get the 5V.
  • Few Wires to connect the sensor.
  • HANA trail Account to store the data.


I have considered three sections to finish this application

  • We have to burn the code into ESP8266 to get connect with your wifi, I have downloaded the code from Audrio( and burn into ESP8266 chip.
    • We have to connect the AO and D0 Pin’s into AO and D0 of ESP8266 micro controller.
    • We will Audrio code we have to make sure that signal will get it A0 pin and read the output of A0 pin.
    • After this step from WIFI has to connect and ready to pump the sensor data to HANA cloud system.

Below diagram will show the detail, pump the data to HANA and read the data from HANA system.

2) I have used HANA trail account to create this solution, we have create the Database to store the data from sensor.

2.1) once it done go back to IOT service cockpit to register the devices, Register the devices Message Types, Device Types and Devices.

2.2) After the registration, you can check the HANA tables that got created. Here is the data can able to check what are tables that got created and it’s data.

2.3 Table name can be identified to store the data.

3) Login in HANA studio or Eclipse to connect Cloud Hana system.

3.1) created the HANA XS project using the Eclipse, Write the Query to get the table from the HANA base and create Odata Services,

3.1) One Service has to pump the sensor data to into HANA cloud tables (Create OData Service)

3.2 ) One Serivice has to pull the data from HANA cloud to view as chart.

4) Created SAP UI5 project and added into above HANA project, Just to check if there is any errors, activate the changes and share the project in HANA repository.

Here is the video of the application how to execute the sensor to view the reading in mobile browser.

Assigned Tags

      You must be Logged on to comment or reply to a post.
      Author's profile photo Former Member
      Former Member

      Good One,

      Nice that the records get exposed into OData service directly.

      A thought, In this case UI is mounted on HCP itself so it served good. What if we would need to consume the exposed OData service from UI mounted on non-cloud server (on-premise)?

      Any suggestions?


      Author's profile photo balaji bodagala
      balaji bodagala
      Blog Post Author

      Hi Sachin,

      Use the cloud connector to make it available on-premise



      Author's profile photo Former Member
      Former Member


      Very Good one

      If you could build this on the PCB and make a product that will be very good.






      Author's profile photo Former Member
      Former Member

      Hi Balaji,

      Could you please post the Arduino code used to connect to ESP8266. I have tried to do that in past but not much of success.




      Author's profile photo K P
      K P

      Hi Yogendra,

      By any chance were u able to program ESP8266-01 with  Arduino Uno board ?

      I am getting an espcomm error when trying to load code to the ESP8266 board from Uno.

      Author's profile photo Venkata Ramana Byreddy
      Venkata Ramana Byreddy

      Really helpful blog to get basic understanding on IOT.

      Author's profile photo DURGA PRASAD

      Awesome blog Balaji 🙂 keep it up ... waiting for your next blog 🙂