• Connecting Devices to NEQTO

Key Points

Receiving data from a variety of sensors all at once usually requires an equally varied set of controllers.

NEQTO devices can control a multitude of different devices and sensors all at once.

The NEQTO Console allows users to see and manipulate their sensor data in one convenient place.

This blog will demonstrate how to set up a number of different sensors and devices to any NEQTO device, and control them from the cloud.



1. Protocols and connections: an overview

Often the intended use case for a sensor and the quantity of sensor data sent dictate the ways in which a sensor communicates with other devices. Sensors can communicate information with host devices in a variety of ways — ranging from simply notifying an "on" or "off" state, to complex series of signals that communicate what the device is, the device's condition, various measurements, and many more. Some sensors can even communicate over local networks or the Internet, so a host controller may need to handle a multitude of different protocols.

Of the many common protocols that complex sensors can use, three stand out: Universal Asynchronous Reception and Transmission (UART), Inter-integrated Circuit (I2C), and Serial Peripheral Interface (SPI). Despite the diversity in their names, they're all serial communications protocols — that is, data is sent and received sequentially on a transmission line one bit at a time.

UART is the only one of these three that doesn't use an independent clock line to send or receive data, so it is used most commonly with simpler devices that send data at slower rates.

I2C is used for slightly more complex devices, so it requires a clock to ensure that both sides know when they're sending/receiving data, and how much of it. I2C allows for up to 128 devices to communicate with a host controller even if all connected devices are plugged into a single port.

SPI is the fastest of the three, because it combines a functionality similar to that of I2C which allows multiple devices on the same line with some hardware guarantees, which makes it the best for communicating with other microcontrollers. While it is theoretically possible to have an unlimited number of devices on the same line, it's functionally limited by what is available on the hardware.

As you can see, it may seem as simple as plugging a wire into a socket on a board, but what goes on under the hood can be very complex!

2. Connecting sensors to NEQTO-compatible devices

We have covered connecting sensors to NEQTO devices in previous blogs (See Updating Deployed Systems with JavaScript ), but this time we will demonstrate in depth! NEQTO devices were designed with connections in mind, with much of the NEQTO Bridge and the other NEQTO-compatible devices1 being dedicated to these different protocols!

There are too many connections to list here, but configuring sensors to work with NEQTO-compatible controllers is simple.

Once a NEQTO device has been set up with the NEQTO Console (See Getting Started ), it can be controlled via JavaScript. Every protocol and every port on a NEQTO device can be controlled via its script, so setting up a sensor is as simple as plugging it into the device, configuring it with the script, and registering it as a Component under the device's Template on the Console.

1 NEQTO-compatible devices:
SPRESENSE
STM32 Discovery Kit

3. Connecting sensors to the NEQTO Console

Components are the metaphorical representation of any sensor or sub-device connected to a NEQTO device on the NEQTO Console. They can be created on a Template's page:

Figure 1: A Template's page on the NEQTO Console

Figure 1: A Template's page on the NEQTO

NEQTO uses the LwM2M registry2 standard to uniquely identify each Component attached to a Template.

Having created a Component to link a sensor and the NEQTO Console, the JavaScript 'nqMqtt.publish' method can then be used to send data to the cloud from the NEQTO device (if NEQTO Infinitypool is enabled for the group).

If the NEQTO Insights service is enabled, then Judges can be created as part of that Component. Judges trigger Actions when a Component sends data that activates their condition. This can be used to closely monitor sensitive equipment, quickly react to failure modes and alert the relevant authorities.

Figure 2: A Judge underneath a Component. It activates the Send Slack Message Action when the Grove Light Sensor Component sends a value over 1500.

Figure 2: A Judge underneath a Component. It activates the Send Slack Message Action when the Grove Light Sensor Component sends a value over 1500.

Furthermore, the received data can be viewed in a chart or graph from the NEQTO Console. The selected Resource ID determines the type of graph it is given in the NEQTO Console. This data can be downloaded for further manipulation. Graphs can be accessed from a Node's page.

Figure 3: A shaded line graph showing the data received by the DFR0026 Component.

Figure 3: A shaded line graph showing the data received by the DFR0026 Component.

2 LwM2M registry

4. Benefits of controlling devices with NEQTO

NEQTO devices are easily configurable and offer users a wide range of available connections through which they connect their devices. This allows users to connect their devices to NEQTO and its cloud to receive analytics data and send alerts from one convenient console. By entrusting their sensor connections to a NEQTO device and the NEQTO Console, users can eliminate the administrative load of managing data-handling servers and responding to abnormal activity.

Furthermore, NEQTO Components are available to be used with Machine Driver, which allows users to control their devices to an even greater degree. We will write more about Machine Driver in a later blog, so please keep an eye out for it!

5. Summary

In this blog, we discussed the simplicity of connecting devices to NEQTO. Connecting a sensor to a NEQTO-compatible device is as easy as creating a space for it in the NEQTO Console and adding a short snippet of code telling the NEQTO device to publish that data. While there are a large variety of communication standards, NEQTO makes it possible to flexibly support those standards even in running systems.