Skip to content

nCube:Thyme for Arduino Application : nCube Base (English)

IoTKETI edited this page Feb 25, 2018 · 7 revisions

nCube:Thyme for Arduino - Application : nCube-Base

Development Environment Setup

IDE installation & nCube:Thyme for Arduino Libraries Download

Json & MQTT Libraries for Arduino Download

At first, download ArduinoJson and PubSubClient libraries via github page linked below

Next, move these libraries to your arduino project libraries directory where is nCube:Thyme for Arduino libraries placed, like picture below.

Open PubSubClient.h under pubsubclient/src, edit MQTT_MAX_PACKET_SIZE variable's value to 400.

Hardware

List of Materials

  • One Adafruit Feather M0 WiFi with uFL
  • One 2.4GH Mini Flexible WiFi Antenna with uFL Connector
  • One CM1106 CO2 Sensor
  • One RGB 3Color LED
  • One Bread Board
  • A set of Jumper Cable M/M
  • One USB Type-A to Micro-B Cable
  • One 5V 2A USB Micro-B Power Adaptor

  • Cortex M0 processor
  • Support SPI, I2C, UART communications
  • Atmel WINC1500 WiFi chip that supports 802.11bgn

CM1106 CO2 Sensor

  • Measures the Co2 values from the air
  • Uploads the value to Arduino using the UART port

RGB LED

  • RGB 3-color LED board operates red, green and blue LEDs
  • It's depending on the input of R, G, B pins

nCube-Base Application Development

Hardware Connection

Adafruit Feather M0 and Sensors wired like picture below.
2017-11-04 11 20 14

nCube-Base Arduino sketch

Copy nCube-Base.ino Arduino sketch example code under lib/oneM2MClient/examples/nCube-Base to src directory,
like picture below.

nCube-Base Arduino sketch upload & execution


Connect Adafruit Feather M0 to PC using usb cable.


To compile and upload, click upload button on PlatformIO tool bar.


To check whether nCube-Base application running or not, open serial monitot.
click serial monitor button on PlatformIO tool bar.


Connect to 'wifi101-XXXX' (different name for each Adafruit Feather M0 board) displayed on the serial monitor using the WiFi of smartphone of laptop.


And then, open web browser to connect 'http://wifi101.local'.
Enter the SSID of the AP to be connected under the Network Name, the Password corresponding to the AP below the Passphrase, and connect to the WiFi by clicking the Connect button.


Now nCube-Base create resources and upload sensing value. These sequences are displayed in serial monitor.

nCube-Base Data Query & Control

nCube-Base Sensing Values Query

To query sensing values, open Mobius Resource Monitor.


Type AE_NAME variable's value in Resource Path like picture above.
And click start button.


You can see the resource structure of the nCube-Base application.


In the co2 cnt, sensing values uploaded.

nCube-Base RGB-LED Control

To control RGB-LED, create cin on led cnt.


Move your mouse on led cnt, and click right button, create.


Input number from 0 to 7 in Content(con), and click create button.


Each Red, Green, Blue LED will turn on according to con value.

Clone this wiki locally