Friday, June 30, 2017

Compass gadget

Compass gadget use and calibration



Immediately after installing the BlessTags application, you will notice that the compass application does not work.
This is a perfect example to highlight the need for calibration of the magnetic sensor – placed on CC2650STK or CC2541DK SensorTags. In the following, a sensor calibration process will be presented.
In a future post, I will present the mathematical basis of the magnetic sensor calibration and the software implementation mode.

This application,  blessTags (BLE SensorTags) application, can be downloaded from the Windows Store Apps: https://www.microsoft.com/store/apps/9p054xsjjr1n.




Monday, June 26, 2017

Motion security system

Introduction


      The motion security system is an application able to work only with CC2650 SensorTag. This limitation is mainly due to a unique capability of the CC2650 to wake-on-movement (shake detection).
      The movement sensor (MPU9250), embedded on the CC2650 SensorTag, uses an interrupt for the wake-on-movement function. In this mode, the CC2650 SimpleLink multi-standard 2.4 GHz ultra-low power wireless MCU stay almost all time in shutdown consuming only 100 nA

      When a shake is detected, the movement sensor (MPU9250) uses an interrupt to wake on the MCU. After this, the SensorTag will provide the movement data for 10 seconds before entering the MPU in the low power state. In this mode, the CC2650 SensorTag saves energy and it will prolong the battery life.

Practical application

     
      Problem - let's assume the following scenario:
  • you are at an airport and you have to wait 4 hours until your plane leaves;
  • under these circumstances, you decide to finish the presentation that you just have to sustain tomorrow, or why not, to watch the last episode of your favorite movie.
But, during the whole working/recreation period, your luggage remains unattended.
                 
       Solution:

      Use an CC2650 SensorTag and the blessTags application. So:
  1. start the SensorTag, 
  2. pair with your laptop, 
  3. start the Motion security system gadget’s application, and
  4. take care of your activities without any concern. 
      The problem is solved! If someone moves, even one centimeter your luggage, the app will warn you audio and/or visually of this fact … and the thief will be caught.  


A demonstration movie for the Motion Security System gadget


Application 1: thieves protection system

 

Application 2: warning system for the arrival of the boss, wife, best friend etc.



This application,  blessTags (BLE SensorTags) application, can be downloaded from the Windows Store Apps: https://www.microsoft.com/store/apps/9p054xsjjr1n.

Sunday, June 11, 2017

BlessTags version history

The latest version of blessTags (BLE SensorTag) application, can be downloaded from the Windows Store Apps: https://www.microsoft.com/store/apps/9p054xsjjr1n.


        Every few weeks, I release a new version of the blessTags application with improvements. This is the web page where I’ll tell you about them.


Version number significance: A.B.C.0

                    A – major software improvements – new functions were launched
                    B – small to medium improvements
                    C – when this value has incremented a correction of error(s) took place


Version number: 11.1.5.0 (36476 lines of code, release date: September 27, 2018)

In this version, the software (the blessTags application) is able to manage a new SensorTag: WICED Sense2 – produced by Cypress. All the data, from this SensorTag, is acquired based on the notification mechanism: (a) for the accelerometer, gyroscope, and magnetometer a notification is received every 120 ms, (b) for the barometer, temperature and humidity a notification is received every 1.2 s.
An error (which affected, from time to time, all SensorTags) was corrected at the mechanism of data transfer between threads – between (a) the thread used to display the sensor's data and (b) the thread used to acquire the sensor's data (through the notification mechanism).
It was, also, changed the method used to interrogate and identify the different types of SensorTags, from 0x180A service to 0x1800 service. The 0x1800 service is a mandatory one (in accordance with the Bluetooth standard) and, in this mode, a large number of unknown BLE devices can now be found and interrogated.
In the help section, several social media connection was introduced: Facebook, Youtube, Blogger, Twitter, and Instagram.

Version number: 11.0.5.0 (34561 lines of code, release date: August 13, 2018)

     A big step was done!!! The notifying mechanism of data transfer is fully functional and supported even in the latest version of Windows 10 - not only in Windows 10 version 1607, like up to the version 11.0.0.0 of the blessTags application.

Version number: 11.0.0.0 (33904 lines of code, release date: August 1, 2018)

      In this version, a new and very exciting feature was implemented: activities. The activities bring a new dimension in the device (on which blessTags run) control through a SensorTag. Also, the ability to inform the user anywhere and any time of the sensors state values brings a new degree of flexibility to the blessTags application. An activity is a specific action that blessTags application will execute when a specific event will take place: run an application, send an email, quit the blessTags application, restart, shut down, hibernate, lock, log off or sleep the device on which it is running.
      In the interrogation process with an unknown type of BLE device, this version of the application, can right now identify more than 200 characteristics and present a detailed information to the user.
      This version solved also several issues (in the saving feature - as a response to a specific event, an error in sensor configuration and several errors in the warnings generated by multiple simultaneously events).

Version number: 10.0.0.0 (28985 lines of code, release date: January 24, 2018)

      This version of the blessTags application brings a new important functionality: events. An event will be generated if a desired value (instantaneous, mean or variance), of a specific sensor, meet a condition or a series of conditions (is lower, higher, inside or outside of a specific range). If at least one condition was met a trigger will be generated and the user will receive a visual or/and an audible warning or/and a data saving process will be started.
     In this version of the application several issues were solved (an error on temperature computation, 2 errors on the graphical interface conditioning and an error regarding the writing into the registry).
      A large part of the application was rewritten (code quality improvements) to enhance the user experience and to create a maintainable environment.

Version number: 9.8.9.0 (24279 lines of code, release date: November 16, 2017)

      An issue regarding the loading of an internal dll was solved.
     But most importantly, the blessTags application was prepared in order to unleash her younger brother: "blessTag" Lite (a free application derived from blessTags application).  

Version number: 9.7.8.0 (24167 lines of code, release date:  October 30, 2017)

      Starting with this version, of the blessTags application, the reading mechanism from the SensorTag was implemented. So, both reading and notifying data transfer are now possible - each time when a SensorTag allows us (when a specific characteristic support both mechanism of data transfer). The reading mode is the only mode of data transfer supported by Windows 10 Fall Creators Update. 
       An issue was solved: in developer mode sometimes was impossible to read the correct value of 0x2902 descriptor.

Version number: 9.6.7.0 (23994 lines of code, release date: October 12, 2017)

       An improvement was done in subroutines of the PC remote control. Now, if the contact with the SensorTag is lost (e.g., due to the output from the coverage zone of the Bluetooth connection), the blessTags application sense this situation and put itself in a state from where the connection can be restored in a very easy way.
        Several displaying issues were resolved.

Version number: 9.5.6.0 (23796 lines of code, release date: September 22, 2017)

        Attention! BlessTags known problem (discovered since the release of the version 9.4.5.0): there is an issue with Bluetooth, in the Windows 10 Creators Update (version 1703), that inhibit the functionality of this application – on the Windows 10 Creators Update the Bluetooth is not working properly.
       Two new functionalities were implemented: (a) for the CC2650STK the battery level is displayed every 5 seconds (the CC2650STK SensorTag Battery Level Service is supported starting only from the Firmware version 1.40) (b) a help option was implemented – 2 buttons (one placed on the main graphical user interface, marked with “?” and one placed on the developer window, marked with “Web Links & Info”) launches a new window containing links to documents on this blog capable of answering to a wide variety of questions.
       Some minor errors, in the functions related to data display, were corrected.
  
Version number: 9.4.5.0 (23669 lines of code, release date: September 1, 2017)

        BlessTags known issue (discovered since the release of the version 9.4.5.0): there is an issue with Bluetooth, in the latest Windows 10 Creators Update (version 1703), that inhibit the functionality of this app – on the Windows 10 Creators Update the Bluetooth is not working properly.
      This version corrects an error that sometimes prevents the discovery of other types of SensorTags if at least one CC2541DK was not previously discovered.

Version number: 9.4.4.0 (23667 lines of code, release date: August 17, 2017)

      In this version of the blessTags application, a new module was released: PC Remote Control (PC-RC). The PC-RC is a module which can send different commands from a SensorTag device (CC2650STK, Thunderboard React, Thunderboard Sense and CC2541DK) to: (a) an application running on Windows or (b) even to the operating system.
    There are two different lists of remote commands: (a) a predefined one and (b) a custom list introduced by the user.
  
Version number: 9.3.4.0 (22895 lines of code, release date: August 2, 2017)

     A new gadgets application was introduced: accelerometer mouse. Using blessTags application, the accelerometer sensor and the buttons located on the SensorTag we can replace, with success, the computer mouse in different games and applications. The speed of the mouse cursor movement is directly proportional to the inclination angle of the SensorTag.
    Several errors were also corrected: (a) in subroutines for the wireless presenter, (b) in the accelerometer data display for CC2650STK, software version 1.4 and (c) in the validation of Save button.
 
Version number: 9.2.3.0 (22500 lines of code, release date: July 22, 2017)

       Several errors were corrected: (a) in the case of the remote acquisition, the acquisition process restarted every time when the acquisition button was pressed on the SensorTag, (b) the correlation between the elements of recording (acquisition length, number of the acquisition samples and the acquisition sample rate) was incorrectly implemented and (c) when the blessTags application was started, the user could choose a SensorTag that was not connected.

Version number: 9.2.2.0 (22425 lines of code, release date: July 9 , 2017)

      Several controls, from UI (user interface), were associated with a specific text. These texts will be displayed when you hover the mouse over the control – in this mode will be easier to work and understand the different blessTags functions.
      In the developer mode window, the text box is resizing with the panel. In all graphical data representation, the graphs controls are now resizing correctly with the window.
       In the developer mode, the BLE characteristic rights were completed with 2 more members: (a) IsWritableWithoutResponse (appear on the interface with the name: Wnr – writable no response) - significance: the characteristic can be written without requiring a response and (b) IsSignedWritable (appear on the interface: Wsgn – writable signed) - significance: the characteristic can be signed writable.
       In the computation of mB (resulting magnet field), the occurrence of a very rare situation of a NaN (not a number) was treated.
       Gadget panel error correction - when gadget panel is closed (before compass panel) and, in the end, when we close compass panel an error appeared each time.

Version number: 9.1.1.0 (release date: June 14, 2017)

    One improvement, the Thunderboard React & Thunderboard Sense can work now with a sampling rate up to 20 minutes. Others small errors were corrected.

Version number: 9.0.0.0 (release date: June 6, 2017)

    In this version the blessTags application:
  • Communicate with already paired Bluetooth devices, showing details for the individual sensor.
  • The supported sensor’s characteristics are:
    1. For CC2541DK: accelerometer, gyroscope, magnetometer, temperature (IR and normal), barometer, humidity, keys and output LEDs.
    2. For CC2650STK: accelerometer (+wake-on-motion), gyroscope, magnetometer, temperature (IR and normal), barometer, humidity, luxometer, keys, reed switch and output LEDs.
    3. For ThunderBoard React: accelerometer, orientation, temperature, humidity, light (ambient & UV), keys and output LEDs. 
    4. For ThunderBoard Sense: accelerometer, orientation, barometer, temperature, humidity, air quality (CO2 & TVOC), light (ambient & UV), sound level, keys and output LEDs (2 x low power LEDs & 4 x power LEDs).
  • 4 gadgets are implemented: compass (works with CC2541 and CC2650 SensorTags), motion security system (works only with CC2650 SensorTag), magnetic security system (works with CC2541 and CC2650 SensorTags) and wireless presenters forPowerPoint (works with: CC2541, CC2650, ThunderBoard React and ThunderBoard Sense).