In this tutorial we will provide you with a step by step guide to enable and connect to Labeeb IoT platform an Altimeter Sensor using NodeMCU V2.0 - ESP8266 Board.
- NodeMCU V2.0 - ESP8266 Board (http://nodemcu.com/index_en.html#fr_54747661d775ef1a3600009e)
- I2C Barometric Pressure/Altitude/Temperature Sensor (MPL3115A2 - https://www.adafruit.com/product/1893)
- We assume you have already been granted an account on Labeeb IoT platform.
Step by step Guide
Step 1: Configure your device and related device and date models on Labeeb IoT platform
First you have to define a Data Type for your Altimeter sensor: navigate to "Data Type" sub-menu under "Platform Management" and click on + to add all the needed Data types as shown below.
First, you have to create a Data Model for your Altimeter sensor: navigate to "Data Models" sub-menu under "Platform Management" and click on + to add all the needed Data Models as shown below.
Second, attach the three data types (level, pressure and temp) to your Data Model, then set the accuracy profile. For example, if you set the accuracy level to 90, the time period to 1 second and the action Mark Data Model as Malfunctioning then the received data belonging to this Data Model should pass all the filters for 90% of the packets over a period of 1 second. Otherwise, the Data Model will be marked as Malfunctioning.
Finally, click on "Save" to make sure your new data model is created.
Finally, click on "Save" to make sure your new device template is created.
Now, once the new device template "levelDT" has been created with "altimeter" data model, you just need to create a new device: navigate to "Device" menu and click on + to add the new device as shown below:
Finally, click on "Save" to make sure your new device is created. Now your new device is now successfully created and listed in my list of devices.
You will have to use the generated MQTT topic and the login password you have set when creating the Device Template in order to push data from this device over MQTT.
You can check the device status and the data statistics under "My Account" menu as shown below:
Step 2: Prepare the ESP8266 and Connect it to Labeeb IoT
Start by configuring the WIFI and MQTT parameters as shown below:
- Start by collecting the real time values for the Pressure/Altitude/Temperature using the MPL3115A2 sensor.
- Download and install the Adafruit MPL3115A2 sensor library (https://github.com/adafruit/Adafruit_MPL3115A2_Library).
- Connect the wires as shown below:
To double check that the date has been transmitted to Labeeb IoT go back to your account on Labeeb IoT portal and navigate to Data/Data retrieval , Then click on search button: