Skip to main content
All CollectionsConnect your Devices
Connect NCD IoT sensors to Ubidots
Connect NCD IoT sensors to Ubidots

Learn how to connect the entire ecosystem of NCD IoT sensors to Ubidots.

Sergio M avatar
Written by Sergio M
Updated over a week ago


Connect the entire ecosystem of NCD IoT sensors to Ubidots in just a few minutes! 

NCD (National Control Devices) is an electronics manufacturer on the cutting edge of the IoT industry focusing on interfacing the analog world with digital electronics. NCD products unite the digital with the analog enabling you to monitor and control your environment.  

Today, you'll learn how to connect the entire ecosystem of NCD IoT sensors to Ubidots in just a few minutes, but first, before proceeding through this article we would highly recommend referencing the WiFi Micro Gateway Setup for MQTT article, which explains the MQTT Gateway in greater detail.

In this setup guide, NCD Long Range wireless sensors will send data to a Gateway located up to 2 miles away from the sensors in your installation. The Gateway will forward the IoT sensor data to Ubidots using the MQTT Protocol. Data about the gateway and all associated sensors will be visible on the Ubidots dashboard.

Requirements

IMPORTANT NOTE: A WiFi network with internet connectivity for connecting the MQTT Gateway.  Please note that only 2.4GHz connections are currently supported. For more detailed information about the MQTT Gateway Setup refer to this guide.

1. Get an Ubidots TOKEN

The first step is getting a token for connecting an MQTT client to Ubidots.  

Sign into your Ubidots account, then click on your user icon in the top right corner and then copy the token available there. We use this token for the username on the MQTT connection.

NOTE: This guide covers basic authentication on the MQTT connection.  While Ubidots and the NCD MQTT Gateway both support TLS connectivity, we will not be using TLS in this example.

2. Open the Gateway Setup page 

If your gateway is not already in setup mode (Flashing Blue LED) then open the lid by removing the 4 screws, then press and hold the Red CFG until the LED begins flashing Blue. Once the LED is flashing Blue then it is in setup mode.

On your computer, smart phone or tablet scan for WiFi networks, then once it appears connect to WiFi Micro Gateway. Many devices will automatically pop up a window for configuration of the Gateway as soon as you connect, if this does not happen simply open your web browser and enter 172.217.28.1. Either way you should see the configuration page for the Gateway.

For more detailed setup directions, please refer to the MQTT Gateway Setup Guide.

3. Configure the Gateway for Ubidots

The screen shot to the right is an example of how to configure the MQTT Gateway for connection to a Ubidots account.

  1. Select the WiFi network to associate the MQTT Gateway to a local router with internet connectivity.

  2. Enter the password for your WiFi network.

  3. Ubidots has a couple of possible MQTT broker host end points.  This tutorial is using the Industrial end point. Enter industrial.api.ubidots.com into the Domain field.

  4. Since TLS will not be used in this tutorial, Set the Port value to 1883 .  Use a port value of 8883  for TLS.

  5. For Client ID, enter a unique name for the Gateway.  Do not use multiple MQTT clients with the same Client ID.

  6. In the User Name field, paste in the Token you previously copied from Ubidots (Step 1 Above).

  7. Set the Gateway Message Format to ::Gateway_Data::  This is a token that indicates the formatting method for gateway communications.  More information on supported gateway message formats may be found in the WiFi Micro Gateway Setup for MQTT article.

  8. Ubidots documents the topic structure, which requires topics to be prepended with /1.6/devices/device_id  so for Gateway Topic format.  Enter /v1.6/devices/::Gateway_ID::   This is the topic the Gateway will use to report information about itself.

  9. For Sensor Message format, enter ::Sensor_Data::  this will simply post the sensor’s transmitted information as a JSON formatted packet.

  10. For Sensor Topic format, Ubidot’s documentation suggests prepending the topic with /v1.6/devices/ , be sure to enter /v1.6/devices/::Sensor_ID:: 

  11. Finally, click the “Save Settings” button.  The MQTT Gateway will now store your settings, reboot, connect to WiFi, then try to establish a connection to the Ubidots broker utilizing the indicated settings.  The LED on the gateway should begin flashing Green, which indicates the gateway is fully functional and has an established connection to Ubidots.

Compare the changes made with the following image to make sure everything was set up properly:

IMPORTANT NOTE: Make sure to have the DHCP enabled in the advanced settings.

4. Display Ubidots Devices

Reconnect your computer to your regular network with internet connectivity. 

From the Ubidots dashboard, go to your Ubidots account. Click on the “Devices” drop-down menu, then click “Devices” to view the list of devices.  You should see NCD sensors and your MQTT gateway in this list.  The name of the Gateway will never begin with 00: , as this is reserved for the sensors.  If you have any sensors powered up, they will automatically appear here as well.

Click on a sensor to view sensor readings and other information.

Now it's time to create Ubidots Dashboards to visualize and understand your data to make the best decisions, simply and coherently.

5. Summary

In just a few minutes you've integrated NCD sensors with Ubidots, sent some data from the sensors and reported your work to Ubidots for data retention, visualization and calculation.

The NCD sensors offer long-range, price, accuracy, battery life and security features, being an affordable choice which exceeds the requirements for most industrial, as well as consumer market applications.

To deploy your Industrial solutions for monitoring or management, check out the full lineup of NCD sensors that can be connected to Ubidots to enrich data to make decisions and improve processes.

Did this answer your question?