Please select an option to see content specific to your location and shop online.

Project

Connect Your OKDO Air Quality Kit To The Cloud

Scroll down

So you got yourself one of our new air quality monitoring kits and you are ready to do your part as a citizen scientist by contributing your data to the cloud. This guide will help you get your new kit online and connected to our cloud service to join all the other devices around the world. We tried to make this process easy so let’s get started!

What’s in the box:

  • A Wio Link Board
  • Grove Temperature & Humidity Sensor (DHT22)
  • Grove VOC and eCO2 Gas Sensor (SGP30)
  • Micro USB Cable
  • Grove Cables

Other things you will need:

  • Your WiFi access credentials
  • Arduino IDE installed
  • Wio Link board support in your Arduino IDE
  • OKdo IoT kit libraries installed
  • OKdo Cloud Account

Creating a OKDO Cloud account

Sign up at https://okdo.allthingstalk.com with your email address and a chosen username and password.

Note: The OKdo Cloud organizes members and devices into “Grounds”, a better way to manage things and data access. OKdo Cloud automatically creates a first Ground, called “Playground” after signing up.

To connect your Kit in your “Playground”, select the Ground and click “Connect a device”.

Select the Air Quality IoT Starter Kit to continue the device creation, a software defined representative of your physical Air Quality device will be created when this is done.

Connect your hardware

Connect the Grove sensors with the Wio Link board as indicated on the indicated the image below:

  • Connect the Grove Temperature & Humidity sensor (DHT22) with “Digital2” on the Wio Link board.
  • Connect the Grove VOC and eCO2 Gas sensor (SGP30) with “I2C” on the Wio Link board.

  • Connect the Wio Link board to your computer over USB.

Installing the Wio Link hardware profile

The next step is to install the hardware profile for the Wio Link board. The Wio Link board profile is available through the Arduino Boards Manager.

In the Arduino IDE, Go to File > Preferences for Windows and Arduino > Preferences on MacOS and add the following URL to Additional Board Manager URLs:

https://arduino.esp8266.com/stable/package_esp8266com_index.json

Open the Board Manager via Tools > Board > Board Manager. You can then search for and install the Wio Link board. Select and install the esp8266 by the ESP8266 Community.

Selecting the Wio Link hardware profile

The Arduino IDE will now have the Wio Link board added to the list found in the menu under Tools >Board: “Seeed Wio Link”. You simply need to select that hardware profile as the board that the Arduino IDE will use.

Configuring the serial port

If your system does not automatically find the correct driver then it is advisable to download additional drivers from here.

The driver adds a communication port. In Windows this is COMx (so COM1, COM6, etc.). On Linux and Mac the port name starts with /dev/tty. You can find the list of available serial ports in the menu under Tools->Port:

You must select the communication port associated with the Wio Link board. The associated communication port is only visible in that list when the Wio Link board is connected.

Install the Air Quality Measurement Kit libraries

Download the OKdo_AQ_IoT_starter_Kit-master.zip file.

To install, open your Arduino IDE

Under Sketch > Include library > Add .ZIP library and select the previously downloaded .zip file

Alternatively, you can unzip the file and copy the contents directly to the libraries folder of your Arduino IDE.

By default this can be found in

  • Mydocuments/Arduino/Libraries/ for Windows,
  • or Documents/Arduino/Libraries/ for MacOS

Now you can open the example code we created to help you out. In your Arduino IDE, open the example “OKdo_Air_Quality_IoT_Starter_Kit_V1″ under “File > okdo-aq-iot-starter-kit-master > examples > OKdo_Air_Quality_IoT_Starter_Kit_V1”

Authenticate your device

Select the tab ‘keys.h’.

In the OKdo Cloud application and your Playground, open the previously created device. You will now see the asset overview.

Click the Settings button in the top right section of the device screen and update the DEVICEID and DEVICE_TOKEN values in your keys.h tab with the values that can be found in Device Settings > Authentication section.

 

/****
* Enter your AllThingsTalk device credentials below
*/
#ifndef KEYS_h
#define KEYS_h
const char* DEVICE_ID = "LA1Sn4yuYx16YBAABqQQnSan";
const char* DEVICE_TOKEN =
"maker:4VyRL0fr22kOm01qFyHqw3gE91MahfK1Q3zEfRg0";
const char* WIFI_SSID= "myWiFi";
const char* WIFI_PASSWORD = "MyWiFiPassword";
#endif

While you are here, go ahead and put your WiFi credentials (WIFI_SSID & WIFI_PASSWORD) so you can get your device online when you disconnect it from your computer.

Upload the code

If you’ve followed all the steps above, then uploading your code should be easy. Simply hit the upload icon in the Arduino IDE. This will save the sketch, compile it and upload it to your Arduino.

Now your device will start sending the sensor data to the OKdo Cloud every minute which can be visualized when you sign up and sign into the OKdo Cloud.

If you want to check to make sure everything is working locally, you can also open the Tools > Serial monitor of the Arduino IDE. This can be very useful when debugging your own sketches too.

  • Make sure you select the correct COM port to listen (under Tools > Port).
  • When the monitor is open, make sure the Baud rate is set to 115200bps.

Sharing your air quality data with the global community

If all goes well you should see sensor data of your device coming in. You can now share this data with the Air Quality Community.

In the OKdo Cloud select your newly configured device.

Set now your Location by clicking the location asset, and click “Use my location”. You can always fine-tune your location by clicking on the map.

Afterwards open the Settings dialog and select ‘Share Data’. Now activate the toggle to share with the Air Quality community.

Welcome to the Community! Now you can see other team members data also as we all work together to help monitor our planet.

Like what you read? Why not show your appreciation by giving some love.

From a quick tap to smashing that love button and show how much you enjoyed this project.