1. Overview

TCW210-TH is a device that registers and stores information for up to 8 sensors (temperature and temperature-humidity). This information is stored in a flash memory and can be visualized in graphics in the web interface.

One of the many services implemented in TCW210-TH allows the user to send sensor information to the already well-developed IoT platform ThingSpeak that allows collecting information in private channels, sharing that information in public channels, analyzing and visualizing the information, as well as other functions.

The present article shows the steps that are needed to be done to allow the connection between TCW210-TH and ThingSpeak servers.

2. Creating an account in Mathworks

In order to have access to the functions of the ThingSpeak platform the user needs to create an account in Mathworks, that will be later linked to ThingSpeak.
The account requires an email, username, password, country of origin and the names of the user.
After being created the account needs to be confirmed using a link sent to the email of the user. Once confirmed, the account is active and linked to the ThingSpeak platform.

3. Creating a new channel

ThingSpeak is based on information channels.
At their creation, they receive a unique identification number and API keys that the user can check after the channel is being created.
Using this information the user can then establish the connection between the end device and ThingSpeak. To create a new channel the user should follow these steps:

3.1. From the web interface of the user account, the menu Channels > My channels is selected. Here the user can also see already existing channels.

collect-data-from-tcw210-th-on-thingspeak-platform-3.1

3.2. The New Channel option is selected.

collect-data-from-tcw210-th-on-thingspeak-platform-3.2

3.3. This is the information that can be set for the new channel:

  • Name
  • Description
  • Name of the Fields (from 1 to 8, where every field represents a different sensor)
  • Metadata – JSON,XML,CSV information for the channel
  • Tags – keywords identifying the channel
  • Longitude
  • Latitude
  • Altitude
  • Link to a website
  • Link to a video
  • Channel status

The minimal information required for the channel to be created, consists of channel name and the name of the fields that are going to be used.

3.4. After the channel is saved, it is visible in the Channels > My Channels menu.

3.5. Every existing channel owns an identification number and API keys. Keys are as follows:

  • Write API key – used to write information to the channel
  • Read API key – allows other users to see channel’s feeds and charts

4. Configuration of TCW210-TH

The following configuration steps are executed in the web interface of TCW210-TH to allow the sensor information to be sent to the channel that was created in ThingSpeak.

4.1. From the menu, the option Services is selected.

collect-data-from-tcw210-th-on-thingspeak-platform-4.1

4.2. From the submenu, the option Cloud is selected.

collect-data-from-tcw210-th-on-thingspeak-platform-4.2

4.3. The following changes are made in the ThingSpeak setup field of the webpage:

  • ThingSpeak service is enabled
  • The refreshing period is set (in seconds)
  • A link to the ThingSpeak server is set – api.thingspeak.com/update

collect-data-from-tcw210-th-on-thingspeak-platform-4.3

4.4. The following changes are made in the Channels 1 field of the webpage.

  • Channel 1 is enabled
  • An API key is set (The Write API key of the created channel is required here. The user can check the key in the menu Channels > My channels and the API keys option of the channel)
  • The identification number is set for the channel (Channel ID)
  • Values(sensors) are set for the fields that are going to be used
  • The changes are saved

collect-data-from-tcw210-th-on-thingspeak-platform-4.4

5. Sample configuration

For the purposes of this article, a channel was created using the steps showed in point 3. Тhe configuration steps shown in point 4 were executed in the web interface of TCW210-TH.
The sensor information is presented in graphics and the current value of the sensor is shown in a gauge.
The information (Identification numbers, API keys, and field values) used in this sample configuration and shown in the images refers only to this configuration.
When configuring, the user should use information that is uniquely referring to his channel in ThingSpeak.

5.1. Creating a channel in ThingSpeak

  • Channel name is set – Teracom TCW210-TH
  • Temperature 1
  • Humidity
  • Dewpoint
  • Temperature 2
  • Channel is saved

collect-data-from-tcw210-th-on-thingspeak-platform-5.1

5.2. API keys are checked

  • Write API key – GQZJ422OX3O2PY0M
  • Read API key – 3N8CTF8VVVOVYHK9

collect-data-from-tcw210-th-on-thingspeak-platform-5.2

5.3. Configuring TCW210-TH

  • ThingSpeak service is enabled
  • The refreshing period is set – 60 seconds
  • Link to ThingSpeak server is set – api.thingspeak.com/update
  • Channel 1 is enabled
  • API key is set (Write API key) – GQZJ422OX3O2PY0M
  • Channel Identification number is set (Channel ID) – 495297
  • Field 1 is set (from the combo box) – sensor 1 – Temperature
  • Field 2 is set (from the combo box) – sensor 1 – Humidity
  • Field 3 is set (from the combo box) – sensor 1 – Dewpoint
  • Field 4 is set (from the combo box) – sensor 3 – Temperature
  • Changes are saved

collect-data-from-tcw210-th-on-thingspeak-platform-5.3

6. Adding addition channels

To add a new channel to the TCW210-TH configuration, the channel needs to be first created in the web interface of ThingSpeak.
Using the channel information (identification number and Write API key) the user can then use the steps shown in point 4.4 to configure a new channel.
TCW210-TH allows 4 channels with up to 8 fields (sensor values) to operate simultaneously.

7. Visualization

collect-data-from-tcw210-th-on-thingspeak-platform-7.1
collect-data-from-tcw210-th-on-thingspeak-platform-7.2
collect-data-from-tcw210-th-on-thingspeak-platform-7.3
collect-data-from-tcw210-th-on-thingspeak-platform-7.4
collect-data-from-tcw210-th-on-thingspeak-platform-7.5