Introduction

    WearON consists of 3 main components:

  • WearON mobile phone app:
    • enables the designer to control inputs and outputs from their connected microcontroller board via the mobile phone app using bluetooth
    • enables the data from the inputs and outputs to be stored on an online data repository; Thingspeak
    • enables pulling of 1 set of data from any devices that are indexed on Thingful via Thingful’s API
    • enables cross connectivity between 1 wearable device that is using WearON
  • WearON Arduino code:
    • provides a simple API for nRF8001 BLE chip (found in Blend Micro and BLE Mini) to exchange data to a mobile phone via bluetooth
  • An online data repository:
    We use Thingspeak as it is an open source tool and easy to use with a lot of online documentation.
    • Enables the designer to store data online
    • Enable the designer to retrieve data easily via Thingspeak API


    How to set up your electronics with WearON , How to set up WearON mobile phone app and How to connect your electronics with WearON mobile phone app will provide you with a more comprehensive guideline on using WearON for your projects. Hang on for a few more minutes to learn how it all works, so you can make the most out of WearON!


How to set up your electronics with WearON

Using Blend Micro

    WearON has been tested using Blend Micro, created by Red Bear Lab. It is an integrated developement board that blends Nordic nRF8001 Bluetooth Low Energy IC and Arduino into a single board. For more information on how to use the board, please refer to Red Bear Lab website.
Source Repository

    All of the WearON's code has been developed using the Git source code management tool, and a published version of the repository has been published to Umbrellium's public Github account.

    Clone or download the WearON-arduino repository into your local directory.

    The location of the published repository is:

    https://github.com/umbrellium/WearON-arduino

Running WearON on Blend Micro board
    This section provides you with instruction on how to install the WearON arduino code onto a Blend Micro board. Follow the set of instructions below to set up the Arduino IDE setup for the first time in order to use Blend Micro 3.3V/8MHz board

  • Software Checklist:
    • Arduino IDE version 1.0.5
    • blend_micro_arduino.zip - found in the WearON-arduino folder that you have downloaded from github. Unzip the folder, you will find:
      • BLE
      • hardware
      • main.cpp
      • RBL_nRF8001
  • For Arduino IDE Setup (first time only), an Add-On is required in order for the Arduino IDE to support your Blend Micro, please follow the steps below:
    • Before you install the Add-On package, you should not be able to see the Blend Micro board
    • Check your "Sketchbook location" in Arduino IDE (it is for storing Arduino support files), go to menu File > Preferences...(on Mac OSX, go to menu Arduino > Preferences...)
    • Exit/Quit Arduino IDE
    • Navigate to your Sketchbook folder (e.g. C:\Users\\Documents\Arduino), it should be empty or contains a folder named "libraries"
    • Copy the "hardware" folder from "blend_micro_arduino" to your Sketchbook folder (Note: inside "Arduino" folder not inside the "libraries" folder)
    • Locate "main.cpp" in your Arduino IDE folder
      • Windows: Arduino IDE folder (usually found in C:\Program Files (x86)\Arduino) > hardware > arduino > cores > arduino > main.cpp
      • Mac OSX: Ctrl-Click/Right-Click the Arduino.app file and choose Show Package Contents
        Contents > Resources > Java > hardware > arduino > cores > arduino > main.cpp
    • Replace it with the "main.cpp" from the "blend_micro_arduino" folder.
    • Re-start the Arduino IDE and two (2) Blend Micro boards should be available
    • The last step is to add a library into the Arduino IDE. Launch Arduino IDE and select menu Sketch > Import Library... > Add Library...
    • Navigate to BLE inside the "blend_micro_arduino" folder, select the BLE folder icon and click "Open" to import
    • Select menu Sketch > Import Library... > Add Library... again, navigate to RBL_nRF8001 inside the "blend_micro_arduino" folder, select the RBL_nRF8001 folder icon and click "Open" to import
    • Now both Nordic's "BLE" and our "RBL_nRF8001" should appear at the 'Contributed' section of Import Library menu
    • Open the arduino code inside "WearONApp_arduino_code_blend_micro" found in the WearON-arduino folder that you have downloaded from github. Click on verify/compile the code, you should be able to run it.
Plugging in sensors and actuators
    This version of WearON utilises only:
    • 2 x Analog sensor pin: A4 and A5 (*it only read data coming from sensors plugged into these pins)
    • 2 x Digial output pin: Pin 9 and 10 (*it only send data to devices plugged into these pins)
    Note: You can change the pin number to your preferred choice by updating the arduino code.

    Once you are done with the setup, your Blend Micro board is good to go! Proceed to How to set up your WearON mobile phone app to learn how to install the app or go to How to connect your electronics with WearON mobile phone app to learn how to set up connection with your Blend Micro board


Using BLE mini

    WearON has been tested using BLE Mini created by Red Bear Lab. It uses Nordic nRF8001 Bluetooth Low Energy IC and requires only a serial port for communication so it supports all major development platforms that have UART interface including Arduino, Raspberry Pi, Netduino, BeagleBone. For more information on how to use the board, please refer to Red Bear Lab website.

Source Repository

    All of the WearON's code has been developed using the Git source code management tool, and a published version of the repository has been published to Umbrellium's public Github account. Clone or download the WearON-arduino repository into your local directory.

    The location of the published repository is:

    https://github.com/umbrellium/WearON-arduino

Running WearON on BLE Mini board
    This section provides you with instruction on how to install the WearON arduino code onto a BLE Mini board.

    1. Install the following library from WearON arduino folder into your Arduino library folder:
      1. WearON-arduino->lib->RBL_BLEMini.zip
      2. *Follow the instruction on Arduino to install the libraries in lib into your arduino program
    2. Open the arduino file WearONApp_arduino_code_ble_mini
    3. Note: When uploading the code, make sure that you disconnect the wires that connects BLE Mini to arduino pin 0 and 1. After you have uploaded the code onto the controller board, reconnect back the wires, restart the board and you are good to go!

Plugging in sensors and actuators
    This version of WearON utilises only:
    • 2 x Analog sensor pin: A4 and A5 (*it only read data coming from sensors plugged into these pins)
    • 2 x Digial output pin: Pin 9 and 10 (*it only send data to devices plugged into these pins)
    Note: You can change the pin number to your preferred choice by updating the arduino code.

    Once you are done with the setup, your BLE Mini board is good to go! Proceed to How to set up your WearON mobile phone app to learn how to install the app or go to How to connect your electronics with WearON mobile phone app to learn how to set up connection with your BLE Mini board


How to install WearON mobile phone app


Using iOS

    The WearON mobile phone app was developed with the latest up to date cordova version 6.3.1. It supports iOS version > 9.1
Note
  • This app is developed separatedly with Arduino Uno connected to Ble mini and Blend Micro board
Source Repositories
To install
    Unfortunately, for iOS version, there is no easy way of installing the app through the App Store. Please follow the instructions on README in the github repository on how to deploy the app on an iOS phone locally using Xcode

    Once you are done with the installation, your mobile phone app is good to go! Proceed to How to connect your electronics with WearON mobile phone app to learn how to set up connection with your electronics


Using Android

    The WearON mobile phone app was developed with the latest up to date cordova version 6.3.1. It supports Android version > 6.0.1
Source Repository

    All of the WearON's code has been developed using the Git source code management tool, and a published version of the repository has been published to Umbrellium's public Github account. Clone or download the WearON-android-app repository into your local directory if you would like to make changes to it.

    The location of the published repository is:

    https://github.com/umbrellium/WearON-android-app

To install
    To install the mobile phone app, download the APK file into your mobile phone using this link.
    • On your mobile phone, open your browser, find the APK file you want to download, and tap it – you should then be able to see it downloading on the top bar of your device.
    • Allow app installation from the unknown sources. You can find the settings to the same under Security settings of your phone.

    Once you are done with the installation, your mobile phone app is good to go! Proceed to How to connect your electronics with WegiarON mobile phone app to learn how to set up connection with your electronics


How to use WearON

Signing up to an online data repository

    In order to connect your wearable project to the web, you will first need to create a Thingspeak account to send and store the data that you have collected online. Thingspeak is an open source Internet of Things (IoT) application and API to store and retrieve data from things using the HTTP protocol over the Internet or via a Local Area Network. There are extensive support documentation online that explain each aspect of the platform, take a look here. Sign up using your email address, then go to Channels -> My Channels and set up a new channel to begin using it. Once you have set up a new channel, there are a couple of things that you would need to take note of in order to connect your Thingspeak account to the WearON mobile phone app and utitlise some of the features in the app:

    • Your Thingspeak User API key
    • Your Channel ID
    • Your Thinkspeak Channel Write API key
    • Your Thinkspeak Channel Read API key

    Once you are done with setting up a new account and channel on Thingspeak, go to the next step: Obtaining a User Configuration Key


Obtaining a User Configuration Key

    In order to connect your wearable project to the web, you will need to use the information acquired on your Thingspeak account to generate a unique Configuration key using this link.
    The configuration key is a unique 6 characters encrypted key (for example, 744-267) that enable your WearON mobile phone app to access and connect to your Thingspeak channel. This key will be used in the next step: Pairing your electronics to your app .

Pairing your electronics to your app

    Step 1
    Open the WearON mobile phone app. Check that the following settings are enabled in your phone:
    • Bluetooth
    • Stable network connection; any 3G network and above
    • if GPS tracking is used in your wearable project, location tracking needs to be switched on
    Once you have ensure that all the required settings are enabled, press Begin
    Step 2
    Make sure you have your electronics ready for pairing with WearON app. Once ready, press Scan For Device
    Step 3
    App will start scanning for any available bluetooth devices within close proximity to the phone. In this example, the device “BlendMicro” with the MAC address “CD:4F:8E:86:72:D9” has been found. Check that the information is exactly the same as what is on your microcontroller board, if correct, press on the device name to continue to next step.
    Step 4
    Key in the 6 characters configuration key that you have previously generated from Obtaining a configuration key, and press Get Data Check that the data retrieved is correct (Note: It may take a while for the app to retrive the data). Once verified, press Connect to Thingspeak
    Step 5
    Once you are in the main content page, there are 3 main features to the app that you can utilise:
    1. Device Control Panel:
      Enable you to directly control the input and output pins on your electronics. Go to Device Control Panel for information on how to use the panel.
    2. Cross Connectivity Control Panel:
      Enable you to cross connect your device to other devices that has a Thingspeak account.
      Note: This version of WearON only allow a maximum of 1 device to be connected. You will have to access the app’s source code to upgrade this feature. Go to Cross Connectivity Control Panel for information on how to use the panel.
    3. Global Connectivity Control Panel:
      Enable you to connect your device to other type of global public devices found on Thingful (e.g air quality monitor, sound sensor etc). Go to Global Connectivity Control Panel for information on how to use the panel.
    Note
    Once your app is connected to your electronics, the app will continue to run in the background.
    • For Android version:
      If your electronics were to lose connection with the app (e.g low battery, hardware malfunction etc), the app will send both sound alert and pop up notification to inform you of the situation. This helps you to identify the issue with the hardware if any.
    • For iOS version:
      Different from android version, when the app gets disconnected from your electronics, it will send a vibration notification to alert you.

Device Control Panel

    This control panel enables you to control the 2 input and 2 output pins from your electronics.
    In this control panel, you can:

    1. Enable analog sensing from pin A4 and A5 using Enable Pin in the separate A4 and A5 sections.
    2. Connect the data collected from either A4 or A5 to your Thingspeak account using Connect to Thingspeak
    3. Check whether output pins D9 and D10 are working by pressing Enable Pin in the separate D9 and D10 sections
    4. Connect the analog pins to the output pins using Set Logic The app will check for any possible issues with your constructed logic, e.g whether D9 or D10 have been utilised in other control panels, whether the values indicated is within range etc. If there is no error, the panel will show -Logic: Successful-, press “Close Panel” to exit to main content page.
    5. Save the entire setting you have created under the Device Control Panel by pressing Save This enables you to return to the same setting by pressing Use Last Saved even if you disconnect the microcontroller board from the app.

Cross Connectivity Control Panel

    This control panel enables you to get data from up to 1 external Thingspeak channel field and connect the data to 1 output pin on your electronics.
    In this control panel you can:

    1. Retrieve up to 1 external thingspeak channel field. You can either connect to another one of your Thingspeak channel or to another WearON user's Thingspeak channel.
        Step 1
        Go to this link to generate a unique configuration key.

        Step 2
        In your WearON mobile phone app, under Data Feed, press Retrieve and key in the 6 characters configuration key that you have previously generated.
        Step 3
        Press Get Data Check that the data retrieved is correct (Note: It may take a while for the app to retrive the data).
        Step 4
        Once verified, press Retrieve Data Set
    2. Connect the analog pins to the output pins using Set Logic The app will check for any possible issues with your constructed logic, e.g whether D9 or D10 have been utilised in other control panels, whether the values indicated is within range etc. If there is no error, the panel will show -Logic: Successful-, press “Close Panel” to exit to main content page.
    3. Save the entire setting you have created under the Device Control Panel by pressing Save This enables you to return to the same setting by pressing Use Last Saved even if you disconnect the microcontroller board from the app.

Global Connectivity Control Panel

    This control panel enables you to get data from up to 1 IoT device on Thingful and connect the data to output pins on your electronics.

    Thingful is a search engine for the Internet of Things, enabling secure discoverability & interoperability between millions of public & private connected objects around the world. Simply put, it’s an index of all the web-connected sensors that generate publicly available data. Users can browse to find sensors around the world, which includes things like energy, seismic, radiation and weather monitors.
    In this control panel you can:

    1. Retrieve up to 1 data feed from 1 IoT device on Thingful.
        Step 1
        Find a device on Thingful that you want to retreive data from and go to the device's url. Then go to this link to generate a unique configuration key.
        Step 2
        In your WearON mobile phone app, under Thingful feed, press Retrieve and key in the 6 characters configuration key that you have previously generated.
        Step 3
        Press Get Data Check that the data retrieved is correct (Note: It may take a while for the app to retrive the data).
        Step 4
        Once verified, press Retrieve Data Set
    2. Connect the analog pins to the output pins using Set Logic The app will check for any possible issues with your constructed logic, e.g whether D9 or D10 have been utilised in other control panels, whether the values indicated is within range etc. If there is no error, the panel will show -Logic: Successful-, press on “Close Panel” to exit to main content page.
    3. Save the entire setting you have created under the Device Control Panel by pressing Save This enables you to return to the same setting by clicking on Use Last Saved even if you disconnect the microcontroller board from the app.

Lock Screen Feature

    When you have successfully configure your wearable project with WearON. Depending on the nature of your project, you might require end user testing (e.g getting another person to carry your electronics for a period of time to collect data). WearON mobile phone app provides a basic framework for creating an end user interface within the app.

    • Access this feature by pressing Lock Screen
    • This feature make sure that the end user cannot alter the configuration that you have set up between your electronics and the mobile phone app through a password lock. This password is the 4 characters that you have saved in your User Configuration Setting, refer to Obtaining a User Configuration Key
    • For advanced users of WearON, in the WearON mobile phone app’s source code, there is a section of the code that enables you to create a bespoke user experience for your wearable project.
      • html file can be found under: www->index.html->line 429-453
      • css file can be found under: www->css->user.css