Weather Station tutorial
Introduction
Weather Station is an example IoT prototype that utilizes the LinkIt ONE development board to acquire temperature, humidity and pressure data from sensors. The data is then visualized on the MediaTek Cloud Sandbox (MCS).
By the end of this tutorial you’ll have a fully functioning IoT prototype, which gathers data from the sensors attached to the LinkIt ONE development board, transmits the data through a wireless communication channel, and provides control and visualization using cloud services on any Wi-Fi enabled device.
This tutorial guides you through:
- Building the prototype, with details of the hardware requirements and how to put them together to create the Weather Station.
- Adding your Weather Station to the MCS, creating the data channels to collect the sensor data and obtaining the information to use in the software to send data to MCS.
- Creating the software to provide the interfaces with the sensors to collect their data and implement data communications to send that data to the MCS.
- Using the MCS to view that data collected on the Weather Station, including using the MCS app on a Wi-Fi enabled Android smartphone or tablet (running Android v. 4.0 or above) to view data while away from your PC.
At the end of the tutorial there are details on where to go for additional information on the LinkIt ONE development board and how to create software for it.
You can complete this project on a Microsoft Windows or Apple Mac.
Before you start
If you haven’t built a LinkIt ONE project before, this section describes the steps you need to follow before commencing this project.
Arduino software
Download and install Arduino software version supported by the LinkIt ONE development board as described in the LinkIt ONE get started guide. In addition to providing your coding environment, the software is used for monitoring the development board.
LinkIt ONE SDK installation and configuration
Follow the instructions in the LinkIt ONE get started guide to install and configure the SDK. In addition to providing the API and tools to use Arduino, the SDK provides a tool to upgrade the development board firmware and reset it to the factory default settings.
Create your MediaTek Cloud Sandbox account
Register on MediaTek Labs and activate a MCS account to prototype your own devices and applications. Your MediaTek Labs registration also provides access to the hardware reference designs and the ability to interact in the developer support forum with other members of the Labs community.
A Wi-Fi enabled Android device
The MCS app supports Wi-Fi enabled Android smartphones and tablets. In this particular scenario Android (v. 4.0 or above) smartphone is used with a Wi-Fi hotspot enabled (preferred method for network connectivity).
Building the Weather Station hardware
This section describes the hardware and electronics needed to build Weather Station and provides details on how to put them together.
What you need
To build the Weather Station hardware, in addition to a LinkIt ONE development board, you need the following components:
Component | Description | Source |
---|---|---|
Display | Serial LCD | Grove – LCD RGB backlight |
Sensors | Temperature, pressure, and humidity (TPH) sensor board. | Grove Starter Kit for LinkIt ONE |
Relay | Relay v1.2 jump-wired with a USB socket. | Grove Starter Kit for LinkIt ONE |
Antenna | Basic Wi-Fi antenna supporting 802.11 b/g/n standards. GSM antenna is optional for this tutorial. | LinkIt ONE development board kit |
Connector Cables | Grove Universal four pin buckled cable (2). Grove four pin male jumper to Grove four pin conversion cable. Basic micro-USB cable. | Grove Starter Kit for LinkIt ONE |
Fan (optional) | USB–powered fan |
Schematics
The components of the Weather Station are assembled according to the following schematic diagram:
The components used in the Weather Station are as follows:
- Wi-Fi/Bluetooth antenna connected to Wi-Fi + BT Antenna Port. The antenna is provided in the LinkIt ONE development board’s kit and supports 802.11 b/g/n Wi-Fi standards.
- TPH board connected to the voltage (3v3), ground (GND), A4/SDA and A5/SCL pins. The TPH board measures temperature, humidity and pressure. This board includes the Sensirion SHT21 digital humidity sensor and the Bosch Sensortec BMP180 pressure sensor (both capable of measuring temperature). Note that the board is only compatible with 3.3 volt sensors and peripheral.
- The Grove LCD Backlight v 2.0 connected to the SCL, SDA, VCC and GND pins of the LinkIt ONE development board. The temperature unit provides Celsius data and has an operating range of -40ºC to +85 ºC. Humidity is measured in percentage and the relative humidity (RH) with an operating range of 0 to 100% RH. The pressure unit measures in Pascals, with a range from 300 to 1100 hectopascal (hPa).
- The Weather Station has an optional USB–powered fan control, which could be connected to the LinkIt ONE development board using a relay with a hardwired USB socket. In this tutorial Grove Relay v1.2 is used attached to the RX, TX and voltage (5V and ground (GND)) pins, as shown in the schematic above.
Putting the components together
This section provides step-by-step instructions on putting the Weather Station hardware together. At the end you’ll have a Weather Station similar to the one shown below:
Step 1 — Antennas
Attach the dual purpose Wi-Fi/Bluetooth (1) and GSM (2) (optional) antennas to their corresponding pins on the LinkIt ONE development board as follows:
Step 2 — TPH board
Attach the TPH board to the LinkIt ONE development board using a Grove connector cable (Grove four pin male jumper to Grove four pin conversion cable) as shown below. Take care to connect the sensor to the 3.3V supply pin.
The next steps use the Grove sockets on the LinkIt ONE development board.
Step 3 — Relay
Attach a relay hardwired with a USB socket to LinkIt ONE development board, using one of the Grove universal four pin buckled cables.
Step 4 — Grove-LCD RGB backlight
Attach the Grove – LCD RGB backlight v 2.0 to the second Grove socket on the LinkIt ONE development board using the second Grove universal four pin buckled cable, as shown below:
Note: Refer to the LinkIt ONE development board’s pin-out diagram for more details.
Setup the MCS
In this project you’ll be using MCS to collect and visualize the data recorded by the Weather Station hardware. The setup is described in two parts:
- Creating a prototype, with data channels to control and monitor data.
- Creating a test device to support the hardware connectivity and data transfer.
If you haven’t done so already, sign in or register on MediaTek Labs. From the main navigation toolbar select Dev Tools & Resources, then Cloud Sandbox and Open the Sandbox. Authorization request page is opened where you can sign into MCS with your Labs@mediatek.com account credentials as shown below.
Create a new prototype for Weather Station
Setting up your device in MCS requires the creation of a prototype that serves as a blueprint for the actual hardware interface configuration. A prototype consists of one or more data channels of type display, controller and hybrid. The data channels are defined with a Data channel name, Data channel id and data type. The variety of data types and overall structure of the prototype in general is shown below.
Create data channels
You can now create and configure a Weather Station prototype with data channels as follows:
- Click Development in the navigation toolbar, and then under Prototype list click Create to create a new prototype.
- Provide the information, as shown below to define the Weather Station prototype.
Save the information and proceed to the next step.
Note: Fields marked by a red asterisk ( * ) are required fields.
Click Detail to view the prototype information, as shown below.
- Click Exit to bypass initiation instructions.
- On the Data channel toolbar click Add, to provide data channels for the Weather Station prototype. Controller and Display are data channel types available to use. Create a Display data channel for temperature data visualization on MCS by clicking Add.
Controller and Display are data channel types available to use. Create a Display data channel for temperature data visualization on MCS by clicking Add .
Enter the information for Data channel name , Data channel id , Description , Data type and unitTypes for temperature data channel and click Save . The Data channel name and Data Channel id are a name and an identifier that define the data channel and will be used in an Arduino sketch to communicate with the corresponding sensor. The temperature unitTypes is degree Celsius and the Data type is a floating point number that has a range determined by the output range of the connected device. For more details on the information you need to provide when setting up a data channel, please refer to Key concept in the MCS documentation.
humidity
and pressure
respectively.Create a controller channel
To add the optional USB-powered fan or similar device to the Weather Station prototype, define a Controller data channel as follows:
- Add a Controller Data channel.
- Click Add under the Controller data channel, as shown below:
- Fill in the details, as indicated in the figure below, to create a fan_control controller.
You should now have a complete definition of the Weather Station prototype, as shown below:
Create a new device from the Weather Station prototype
Each prototype on MCS is defined on a specific hardware platform. The hardware platform used in this tutorial is the LinkIt ONE development board. The Weather Station prototype is mapped to the physical device as follows.
- Click Development from the MCS toolbar, and then click the Weather Station’s Prototype detail.
- Click Create test device to configure a new device, as shown below.
- Provide Device name , an example device name shown below, click OK to continue.
- Click Go to detail, as shown below to view the device information.
- It’s essential to store the DeviceID and DeviceKey values to enable API calls in the Arduino sketch for device connectivity. Store the values in the
device.txt
file on the LinkIt ONE development board’s memory. See Configure Wi-Fi settings for details on creating and loading this file to your board.
You’ve now created a test device in MCS matching the Weather Station prototype with three display data channels for temperature, humidity and pressure and a controller data channel for the USB-powered fan. The next section describes the Weather Station’s software implementation.
Create your Weather Station’s software
Your Weather Station needs an Arduino Sketch to share data from the sensors with MCS. This section describes the software required as follows:
- Overview of the Arduino sketch.
- Configuring device and Wi-Fi settings.
- Transmitting sensor data to the MCS.
- Integrating with MediaTek Cloud Sandbox on a PC and a mobile device.
Overview of the Arduino Sketch
The Arduino project source code is provided in a GitHub repository. The following driver support is required for its successful operation:
- Adafruit Unified Sensor driver
- Adafruit Unified BMP085/BMP180 Driver (Barometric Pressure Sensor).
- Grove LCD RGB Backlight driver.
The HTTP communication is supported by an HTTPClient driver.
An Arduino sketch is implemented, verified and uploaded to the LinkIt ONE development board. A sketch is a source code file representing the core controlling logic for the LinkIt ONE development board. It consists of two main structures: setup and loop.
- A
setup()
structure initializes resources, such as the Wi-Fi module. - A
loop()
structure continuously listens to and processes events from hardware sensors and software modules. The loop() structure runs forever — until the device is shutdown.
The setup()
structure is called only once at the beginning of the program and provides for initialization of the functions, as shown below.
The key functions with their descriptions are given below.
Function | Description |
---|---|
void setup() | Main program to provide TCP connection and sensor data communication. Executes only once when the device first starts and MCS communication is initiated. |
void bmp085Calibration() | Initialize sensor pins to specific memory locations. |
void readDeviceSetting() | Read the content of a device.txt file to determine the device ID connected to Wi-Fi network. |
void readWiFiSetting() | Read the content of a wifi.txt file to determine the SSID and key values of Wi-Fi connection. |
void getconnectInfo() | Call RESTful API to get TCP socket connection. |
void connectTCP() | TCP socket connection. |
The loop()
structure executes continuously and provides continuous updates of the sensor data on the LCD display and on MCS by calling senddata()
function. Functionfatal_error()
is called to output an error message and reset the Weather Station device.
Function | Description |
---|---|
void loop() | Continuous communication with an Access Point (AP) to send the sensor data and check the status of the fan. |
void senddata() | Sends sensor data. |
void fatal_error(const char* str) | Determines the source of errors, clears the device state and outputs an error message. |
The following sections step through some of the functions to identify the process of device connectivity, Wi-Fi configuration and the sensor data communication.
Configure the device settings
The function readDeviceSetting()
extracts device ID and device key information from the device.txt file stored in the flash memory of the LinkIt ONE development board, see Configure Wi-Fi settings for details on creating and loading this file to your board. The device ID and device key were generated when the test device for Weather station prototype was created, see Create a new device from the Weather Station prototype. The device ID and device key are used to identify the Weather Station hardware.
Initialize flash memory
In functionreadDeviceSetting()
initialize the flash memory communication by calling thebegin()
method ofLFlash
class using theDrv.begin()
statement where Drv is defined as an LFlash object.void readDeviceSetting() { Drv.begin();
Opening the file to read
Declare an objectf
of typeLFile
to read the content of a filedevice.txt
located on the flash memory of the LinkIt ONE development board. UseDrv.open
("device.txt"
,FILE_READ
), which defines the file path and operation mode, to open thedevice.txt
file and prepare to read its content. If the file doesn’t exist printout a message to the serial output callingfatal_error()
function.LFile f = Drv.open("device.txt", FILE_READ); if(!f) fatal_error("Fail to open device.txt");
Reading the data into a character array
Declare a character array and read the information from the file into the array. Close the file to reallocate the resources and assign the character array length to 0.char buf[100]; int len = f.size(); f.read(buf, len); f.close(); buf[len] = '\0';
Extract device ID and device key information from an array
Declare two loops to extract device ID and device key information frombuf
array and store the information indeviceid
anddevicekey
arrays, respectively. The device ID and device key should be comma “,” separated. The bytes before “,” are allocated for device ID and the bytes after are for the device key. Thewhile
loop iterates from the beginning of the array and reads the bytes until it reaches “,” sign, if the “,” isn’t found in thebuf
character array an error message is sent to the serial output using thefatal_error()
function.int i = 0, j = 0; while(buf[i] && buf[i] != ',') { deviceid[j++]=buf[i++]; } deviceid[j] = 0; if(buf[i] != ',') fatal_error("Fail to parse wifi.txt"); i++; j=0; while(buf[i]) { devicekey[j++]=buf[i++]; } devicekey[j]=0; }
Handling errors
When an error occurs, details are passed to the functionfatal_error()
to print error messages on the serial output, clear the display and set the cursor and LED to default settings.The full code for the
readDeviceSetting()
function is given below.void readDeviceSetting() { Drv.begin(); LFile f = Drv.open("device.txt", FILE_READ); if(!f) fatal_error("Fail to open device.txt"); char buf[100]; int len = f.size(); f.read(buf, len); f.close(); buf[len] = '\0'; int i = 0, j = 0; while(buf[i] && buf[i] != ',') { deviceid[j++]=buf[i++]; } deviceid[j] = 0; if(buf[i] != ',') fatal_error("Fail to parse wifi.txt"); i++; j=0; while(buf[i]) { devicekey[j++]=buf[i++]; } devicekey[j]=0; }
Configure Wi-Fi settings
The function readWiFiSetting()
is similar to the readDeviceSetting()
function. Here the ssid
and key for Wi-Fi configuration are extracted from wifi.txt
file located on the flash memory of the LinkIt ONE development board.
Sending sensor data to the MCS
The setup()
function is called only once to initialize the Wi-Fi and device settings, LCD display, fan control and sensors. The loop()
function runs continuously and communicates the sensor data from the Weather Station hardware to the MCS. The details of the loop function are described below:
Connecting to an AP.
Check the status of the Wi-Fi connectivity by calling thestatus()
function of theLWiFi
class. If the Wi-Fi is disconnected (LWIFI_STATUS_DISCONNECTED
) then a warning message is printed to the serial output. If Wi-Fi is available the device ssid and key information are used to connect to the AP usingLWiFi.connect(ssid, LWiFiLoginInfo(WIFI_AUTH, key)
. There is a delay of one second (1000 ms) to wait for the connection to be established.void loop() { if (LWiFi.status() == LWIFI_STATUS_DISCONNECTED) { Serial.println("Disconnected from AP"); while (0 == LWiFi.connect(ssid, LWiFiLoginInfo(WIFI_AUTH, key))){ Serial.println("Connecting to AP"); delay(1000); } }
Sending the sensor data.
Sending the sensor data is synchronized with the real time clock of the LinkIt ONE development board. The data from the TPH sensor board is sent periodically. The current and last timestamps are compared to the value ofper
variable, which is initialized to five seconds, to indicate the time interval at which the sensor data is uploaded to the MCS.LDateTime.getRtc(&rtc); if ((rtc - lrtc) >= per) { Serial.println("Senddata"); senddata(); lrtc = rtc; }
Let’s explore the
senddata()
function for temperature sensor data communication only.Reading the data from the temperature sensor.
A variabletemp
of data typefloat
is first declared and assigned to the output of thereadsht1temp()
function.readsht1temp()
function initiates a wire transfer usingWire
library and its functionality and converts the received bytes into floating point number. TheWire
library supports inter integrated circuit (I2C) or two wire interface (TWI) device communication from a specified memory address.void senddata() { Serial.println("Begin of senddata"); float temp = readsht21temp();
Displaying the converted temperature on the Grove LCD Backlight.
Send the formatted floating point number to a string pointed to, bybuffert
using functionsprintf()
.lcd.print(buffert)
function then send the value ofbuffert
to the LCD display of the Weather Station.Serial.println("1"); char buffert[5]; sprintf(buffert, "%.2f", temp); Serial.println("2"); // display status lcd.clear(); lcd.setCursor(0, 0); lcd.print("T:"); lcd.print(buffert);
Prepare the data for POST request.
Combine a header with the data recorded from the Weather Station’s temperature sensor and package them into a string to send it in your POST request. The string is also sent to the serial output by callingprintln()
method of theSerial
class.String data = "temperature,," + String(buffert); Serial.println(data);
Sending the temperature sensor data to the MCS server.
Establish a successful connection with MCS server and send the HTTP POST request to transfer data.length()
function returns the length of thedata
string which is stored in variablethisLength
. An objectc2
of classLWiFiClient
is then declared. A timer is initialized usingmillis()
function which returns the number of milliseconds since the LinkIt ONE development board began running the program. The while loop checks the connectivity to the site URL calling the connect(SITE_URL, 80) method of c2 Wi-Fi client object providing one second waiting time to reconnect to the website usingdelay(1000)
function.connect(SITE_URL, 80)
method makes an HTTP connection to the server and POSTs data.int thisLength = data.length(); LWiFiClient c2; while (0 == c2.connect(SITE_URL, 80)) { Serial.println("Re-Connecting to WebSite"); delay(1000); }
Edit the POST URL.
Update the POST URL to the location of yourdatapoints.csv
on your web-host using the statements below:delay(500); Serial.println("send POST request"); c2.print("POST /mcs/v2/devices/"); c2.print(deviceid); c2.println("/datapoints.csv HTTP/1.1");
Edit the Host information.
Update the Host to match your domain and send the data usingc2.println(data) statement
.c2.print("Host: "); c2.println(SITE_URL); c2.print("deviceKey: "); c2.println(devicekey); c2.print("Content-Length: "); c2.println(thisLength); c2.println("Content-Type: text/csv"); c2.println("Connection: close"); c2.println(); c2.println(data);
Handling errors.
Allow data to fully upload to the MCS server and disconnect after successful completion. If there is an error during the transmission a variableerrorcount
is incremented and the Wi-Fi client is disconnected if the value oferrorcount
is greater than ten.String dataget = ""; Serial.println("waiting HTTP response:"); int errorcount = 0; while (!c2.available()) { Serial.println("waiting HTTP response:"); errorcount += 1; if (errorcount > 10) { c2.stop(); return; } delay(100); } while (c2) { int v = c2.read(); if (v != -1) { Serial.print(char(v)); delay(1); } else { Serial.println("no more content, disconnect"); c2.stop(); } }
Upload the data to MCS
The display and cursor values are cleared and reinitialized. A message on successful data upload is printed on the LCD display and a new timer is set to the output of themillis()
function.lcd.clear(); lcd.setCursor(0, 0); lcd.print("Data uploaded"); lcd.setCursor(0, 1); lcd.print("to MCS"); delay(300); }
The full code for the
senddata()
function is provided below.void senddata() { Serial.println("Begin of senddata"); float temp = readsht21temp(); Serial.println("1"); char buffert[5]; sprintf(buffert, "%.2f", temp); Serial.println("2"); // display status lcd.clear(); lcd.setCursor(0, 0); lcd.print("T:"); lcd.print(buffert); String data = "temperature,," + String(buffert); Serial.println(data); int thisLength = data.length(); LWiFiClient c2; while (0 == c2.connect(SITE_URL, 80)) { Serial.println("Re-Connecting to WebSite"); delay(1000); } delay(500); Serial.println("send POST request"); c2.print("POST /mcs/v2/devices/"); c2.print(deviceid); c2.println("/datapoints.csv HTTP/1.1"); c2.print("Host: "); c2.println(SITE_URL); c2.print("deviceKey: "); c2.println(devicekey); c2.print("Content-Length: "); c2.println(thisLength); c2.println("Content-Type: text/csv"); c2.println("Connection: close"); c2.println(); c2.println(data); String dataget = ""; Serial.println("waiting HTTP response:"); int errorcount = 0; while (!c2.available()) { Serial.println("waiting HTTP response:"); errorcount += 1; if (errorcount > 10) { c2.stop(); return; } delay(100); } while (c2) { int v = c2.read(); if (v != -1) { Serial.print(char(v)); delay(1); } else { Serial.println("no more content, disconnect"); c2.stop(); } } lcd.clear(); lcd.setCursor(0, 0); lcd.print("Data uploaded"); lcd.setCursor(0, 1); lcd.print("to MCS"); delay(300); }
Turning the fan ON or OFF.
An optional USB-powered fan can be turned on or off using a TCP socket command from the MCS server. Thewhile
loop checks if the object c ofLWiFiClient
class is available and then anif
statement compares its value to either 0 or 1. If the value equals to one then the voltage is turned to High on the fan output pin and the fan turns on, otherwise it turns off. A message is printed on the LCD display indicating the status of the fan.//Check for TCP socket command from MCS Server String tcpcmd=""; while (c.available()) { int v = c.read(); if (v != -1) { Serial.print((char)v); tcpcmd += (char)v; if (tcpcmd.substring(52).equals("1")){ digitalWrite(FAN_PIN, HIGH); lcd.clear(); lcd.print("Switch FAN ON "); tcpcmd=""; }else if(tcpcmd.substring(52).equals("0")){ digitalWrite(FAN_PIN, LOW); lcd.clear(); lcd.print("Switch FAN OFF"); tcpcmd=""; } } }
Keeping track of time.
As the sensor data is sent to the MCS periodically the time is also updated periodically in order to synchronize message transmission through the TCP socket communication.//Check for heartbeat interval LDateTime.getRtc(&rtc2); if ((rtc2 - lrtc2) >= per1) { heartBeat(); lrtc2 = rtc2; } }
The full implementation of the
loop()
function is provided below:void loop() { if (LWiFi.status() == LWIFI_STATUS_DISCONNECTED) { Serial.println("Disconnected from AP"); while (0 == LWiFi.connect(ssid, LWiFiLoginInfo(WIFI_AUTH, key))){ Serial.println("Connecting to AP"); delay(1000); } } LDateTime.getRtc(&rtc); if ((rtc - lrtc) >= per) { Serial.println("Senddata"); senddata(); lrtc = rtc; } //Check for TCP socket command from MCS Server String tcpcmd=""; while (c.available()) { int v = c.read(); if (v != -1) { Serial.print((char)v); tcpcmd += (char)v; if (tcpcmd.substring(52).equals("1")){ digitalWrite(FAN_PIN, HIGH); lcd.clear(); lcd.print("Switch FAN ON "); tcpcmd=""; }else if(tcpcmd.substring(52).equals("0")){ digitalWrite(FAN_PIN, LOW); lcd.clear(); lcd.print("Switch FAN OFF"); tcpcmd=""; } } } //Check for hearbeat interval LDateTime.getRtc(&rtc2); if ((rtc2 - lrtc2) >= per1) { heartBeat(); lrtc2 = rtc2; } }
The humidity and pressure sensor data are communicated similarly. Next section describes the Wi-Fi configuration on the LinkIt ONE development board.
Configure Wi-Fi settings on the LinkIt ONE development board
The Weather Station application utilizes wireless communication between a LinkIt ONE development board and MCS. The method of communication used in this tutorial is through a Wi-Fi hotspot. The following steps will enable IP configuration on the LinkIt ONE development board. For more details on switches on the LinkIt ONE development board refer to the pin-out diagram.
- Connect LinkIt ONE development board to your computer using Micro-USB port.
- Turn the USB Power Source/Li Battery Power Source switch to USB Power Source mode.
- Set the Mass Storage Bootup/Normal Bootup switch to Mass Storage Bootup mode.
- Press the reset button.
- Once the LinkIt ONE development board is connected to your computer an external device drive will be detected, as shown in the figure below.
Open the Removable Disk drive and observe the content of
wifi.txt
, as shown below. The Arduino sketch will read the content of wifi.txt file to detect the SSID and key values for Wi-Fi hotspot in order to enable Weather Station application’s wireless connectivity. Replace and save the content of this file with actual SSID and key values of your Wi-Fi hotspot.Note: WEP and WPA are currently supported.
Once the Wi-Fi hotspot is available follow these steps to provide wireless connectivity to LinkIt ONE development board. Refer to the figure in step 4 for the switch names and options.
- Disconnect the Micro-USB cable.
- Set the Mass Storage Bootup/Normal Bootup switch to Normal Bootup mode.
- Set the USB Power Source/Li Battery Power Source switch to Li Battery Power Source mode.
- Connect the battery pack to the power jack.
Reset the LinkIt ONE development board.
After successful connection the LCD panel on the Weather Station will display the following messages:
Congratulations, the Weather Station is now connected to the MCS using Wi-Fi hotspot and LinkIt ONE development board equipped with sensors.
Remote access to the Weather Station prototype
Once the device and the prototype are defined click My Devices on the MCS toolbar to view existing devices or add one.
Click Detail on Weather Station test device from the Device list menu. The values of temperature, humidity and pressure will be on the display along with the fan control option.
Each of those controls has a shortcut menu. Open the shortcut menu for data channel to view the available options.
The History option provides all the past and present values of the data channel, in this case temperature.
The fan control has two options – ON and OFF. The Weather Station demo kit has a micro – USB port to attach a small fan and view it running when the switch is ON.
Congratulations, you have now completed the Weather Station prototype setup.
MCS provides mobile app to remotely control the existing prototypes connected to the LinkIt ONE development board. Download and install the app on an Android Wi-Fi hotspot enabled smartphone or tablet device to get started with the Weather Station tutorial on a mobile device.
Conclusion
In this tutorial you have implemented a remote controlled Weather Station application using LinkIt ONE development board, TPH sensors, MediaTek Cloud Sandbox and Arduino programming environment.
For more information on MediaTek LinkIt ONE development and prototyping board and cloud services refer to LinkIt ONE developer’s guide and MediaTek Cloud Sandbox.