Difference between revisions of "Projects:2017s1-156 Interrogating a Glucose Monitor"

From Projects
Jump to: navigation, search
(Introduction)
(Near Field Communication)
 
(58 intermediate revisions by 2 users not shown)
Line 5: Line 5:
 
For this project, we choose the Freestyle Libre company’s glucose monitoring device. We build a wearable device that provides users with the ability to get the readings at any time on their phone rather than using another company’s own-designed monitor reader equipment. The application installed on users’ phone will display the data on their screen and store the readings in a remote server to allow them to access the information from different devices.
 
For this project, we choose the Freestyle Libre company’s glucose monitoring device. We build a wearable device that provides users with the ability to get the readings at any time on their phone rather than using another company’s own-designed monitor reader equipment. The application installed on users’ phone will display the data on their screen and store the readings in a remote server to allow them to access the information from different devices.
  
===Freestyle Libre Flash Glucose Monitoring System===
+
==Freestyle Libre Flash Glucose Monitoring System==
 +
[[File:Sensor.PNG|thumb|none|Libre Freestyle Sensor]][[File:Reader.png|thumb|none|Libre Freestyle Reader]]
 
This product consists of two parts, sensor and reader. Both are communicated via NFC which means the reader need to be close enough to interact with sensor. The sensor is small and lightweight. Thus, it is also a water-resistant. It is designed to be worn for up to 14 days and it need to be applied on the back of the upper arm. When sensor is applied, a thin, flexible and sterile fibre is inserted just under the skin. Sensor dimensions is 35mm x 5mm and its weight is 5 grams. It has memory to store the data up tp eight hours.
 
This product consists of two parts, sensor and reader. Both are communicated via NFC which means the reader need to be close enough to interact with sensor. The sensor is small and lightweight. Thus, it is also a water-resistant. It is designed to be worn for up to 14 days and it need to be applied on the back of the upper arm. When sensor is applied, a thin, flexible and sterile fibre is inserted just under the skin. Sensor dimensions is 35mm x 5mm and its weight is 5 grams. It has memory to store the data up tp eight hours.
  
[[File:sensor.PNG]]
+
==Design==
 +
[[File:Main_design.png|center|550px|System Architecture]]
  
 
===Near Field Communication===
 
===Near Field Communication===
 +
 +
This board is based on module ST Micro CR95HF NFC interface chip. This chip allows the the board to communicate with Near Field Communication EEPROM and enabled tags via SPI interfaces or UART. Operating frequency of this RFID is 13.56MHz. It supports three different protocols which are ISO/IEC 14443, 15693 and 18092 [12].
 +
 +
[[File:Bm.png|550px]]
 +
 +
The antenna is designed to be on the bottom part of the board as labelled in the Figure 9. This module operates at the voltage of 3.3VIts maximum operating distance for detecting NFC tags is 28mm depending on the current antenna size. Its dimension is 27.94mm x 38.10mm x 1.27mm and its weight is 45.4g. As written on the board, this module is designed and manufactured by Solutions Cubed. This board will cost for A$16 [12].
 +
 +
To establish the communication of NFC, there are few steps that need to be followed. First, user need to determine which communication interface they want to use, either UART mode or SPI mode. The red part which is NFC protocol must be set by user and for this project, the protocol used is ISO/IEC 15963. NFC protocol gas to be enclosed correctly into the CR95HF protocol. Then, CR95HF will handle all the communication flow to and from RF tag or in this project is refer to sensor.
 +
 +
[[File:Nffffc.png|550px]]
 +
 +
====Set Up Communication Interface====
 +
A wake-up pulse (low) is needed after the module power-up to set the communication interface. A wake-up pulse (low) is needed after the module power-up to set the communication interface.
 +
 +
[[File:SPI.png|550px]]
 +
 +
====Setting Up Protocol Interface====
 +
 +
In NFC communication flow, CR95HF acts as a translator that converts serial commands to RF signals and vice versa. As shown in the pictures, the line that is set with hexadecimal value of “0x01” is the command to set the protocol of ISO/IEC 15693. This can be refer from the datasheet of BM019 [12].
 +
 +
[[File:Protocol.png|550px]]
 +
 +
====Reading Data from Sensor====
 +
 +
To read the glucose data from the sensor, the command is “Read Single Block”. This will send signal to CR95HF to read a single block of memory from RF tag/sensor and the hexadecimal code for this command is “0x20”.
 +
 +
[[File:Read.png|550px]]
 +
 +
===Case Design===
 +
 +
Designing a case for the device is required to make it wearable. A lot of things need to be considered while designing the case which includes the size, durability, material and weight. This is because to make sure it will be comfortable and safe to wear. Selection of material is the crucial part because to ensure it will not give harm to the skin since it will be worn for 24/7.
 +
 +
[[File:GluCase.png|550px]]
 +
 +
[[File:GluLid.png|550px]]
 +
 +
The dimension of the case is labelled as in the picture and all the measurements are in millimeter(mm). The round hole is made to occupy the sensor which attached to the arms. There are still a lot improvements can be made to this design especially with its size because it still looks a bit bulky for a device that will be worn for 24/7. The width is a bit long because it is designed to deploy the armband at the both end.
 +
 +
[[File:3DPrint.png|550px]]
  
 
===Bluetooth===
 
===Bluetooth===
 +
The team decided to use HM-13 as our Bluetooth module since its dimensions suiting our project, 1.7 mm * 27 mm * 13mm, 0.8 grams. It supports Bluetooth 4.1 connectivity with 2~8 Kb/s transferring rate. 4 pins will be used to utilize this module, Rx, Tx, Vcc, GND.
 +
The Rx and Tx pins connect to the main chip board for transmitting signal.
 +
Vcc and GND pins provide the power.
 +
 +
[[File:HM-13.jpg|550px]]
 +
 +
HM-13
 +
 +
After checking with HM-13’s data sheet, we discovered that connect pin 15 of HM-13 can improve battery lifetime.
 +
 +
====Set up correct Baud Rate====
 +
 +
The default setting for the BLE connection baud rate is 9600. In case this rate value is not recognizable, the for loop will try all 8 possibilities and set the correct value once it reads an “OK” response.
 +
Once the device is turned on, the wakeup function will call ‘restartBLE’ function to deliver the stored data in “HIGH” variable.
 +
 +
[[File:Set_up_baud_rate.png|550px]]
 +
 +
====Build Bluetooth Packet====
 +
 +
This is the most critical part of the project since it will transfer the data collected from NFC modules and send the measurement to the mobile phone. This process is like how the cargo transfers intermodal containers between harbours. A packet shall be created to let the xDrip application accept following the BTWixel packet which is the uniformed format containing all required criteria by the application. The packet includes current glucose value, current battery percentage, sensor minutes elapse, glucose trend (15-minutes trend), current battery level and in mV.
 +
 +
[[File:Build_up_bluetooth_packet.png|550px]]
 +
 +
[[File:Output_of_raw_NFC_readings_and_converted_Bluetooth_packet.png]]
 +
 +
Output of raw NFC readings and converted Bluetooth packet
 +
 +
====Bluetooth Data Transfe====
 +
 +
After gathering all required variables in the Packet string, the program calls “send packet” function to send these values to the mobile phone. It also checks the status of this process and returns whether it is a success or not. If the transmitting process failed, "Packet not sent! Maybe a corrupt scan or an expired sensor." will be displayed.
 +
 +
[[File:BT_data_transfer.png|550px]]
 +
 +
===Cloud Storage===
 +
 +
All automated data readout will be transmitted to a cloud storage system and this storage system can be accessed via an android application. Our team decided to use the existing well-developed program xDrip+. The Nightscout xDrip+ application supports MongoDB1, which can be used as a file system with load balancing, enabling user to upload their real-time readings to the cloud and access them from anywhere later. After completing some research, the team choose Heroku2 as the service provider to deploy a website platform which not only store the data and but also display them with a nice Web UI showing the readings from the MongoDB straight forward. A specific application programming interface (API) code is used among 2 Android phones’ xDrip+ application so the statistics are synchronised. The second phone requests the online data base and download the information from remote server to local storage.
 +
 +
Here is the link of the online web interface.
 +
glucose-monitor : https://glucose-monitor1.herokuapp.com/
 +
 +
On 27th Oct 2017, a new Freestyle glucose sensor will be deployed and used during the exhibition. Since the glucose monitor sensor has 14 days of life time, after that, there is no reason to keep the website running without new uploads, but current data base can be exported. This website will be closed after 10th Nov 2017.
 +
 +
Following is one sample of the entries uploaded by the application. It contains current glucose level reading, current device battery level, time.
 +
 +
 +
{ "_id": {"$oid": "59f0f45c0323d652496bdeb4"},
 +
    "device": "xDrip-LimiTTer",
 +
    "date": 1508963414135,
 +
    "dateString": "2017-10-26T07:00:14.135+1030",
 +
    "sgv": 93,
 +
    "direction": "Flat",
 +
    "type": "sgv",
 +
    "filtered": 80823.52334999999,
 +
    "unfiltered": 80823.52334999999,
 +
    "rssi": 100,
 +
    "noise": 1}
 +
 +
[[File:Nightscout_Web_Interface.png|550px|]]
 +
 +
Nightscout Web Interface
  
 
== Group Members ==
 
== Group Members ==
Line 25: Line 126:
  
 
== References ==
 
== References ==
 +
 +
[1] "Diabetes in Australia", Diabetesaustralia.com.au, 2017. [Online]. Available: https://www.diabetesaustralia.com.au/diabetes-in-australia. [Accessed: 24- Oct- 2017].
 +
 +
[2] "Diabetes", World Health Organization, 2017. [Online]. Available: http://www.who.int/mediacentre/factsheets/fs312/en/. [Accessed: 25- Oct- 2017].
 +
 +
[3] W. Organization, Global Report On Diseases 2016. France: World Health Organization, 2016, pp. http://apps.who.int/iris/bitstream/10665/204871/1/9789241565257_eng.pdf.
 +
 +
[4] H. Information, D. Overview, P. Problems, L. (Hypoglycemia), L. (Hypoglycemia), T. Center and N. Health, "Low Blood Glucose (Hypoglycemia) | NIDDK", National Institute of Diabetes and Digestive and Kidney Diseases, 2017. [Online]. Available: https://www.niddk.nih.gov/health-information/diabetes/overview/preventing-problems/low-blood-glucose-hypoglycemia. [Accessed: 20- Apr- 2017].
 +
 +
[5] F. Sensor and F. Reader, "Flash Glucose Meters & Monitoring Systems Online in Australia", FreeStyleLibre.com.au, 2017. [Online]. Available: https://www.freestylelibre.com.au/. [Accessed: 21- Apr- 2017].
 +
 +
[6] "FreeStyle Libre Reader - Buy Online", Freestylelibre.co.uk, 2017. [Online]. Available: https://www.freestylelibre.co.uk/libre/products/reader.html. [Accessed: 21- Apr- 2017].
 +
 +
[7] "UPetersen/LibreMonitor", GitHub, 2016. [Online]. Available: https://github.com/UPetersen/LibreMonitor. [Accessed: 21- Apr- 2017].
 +
 +
[8] "JoernL/LimiTTer", GitHub, 2016. [Online]. Available: https://github.com/JoernL/LimiTTer. [Accessed: 21- Apr- 2017].
 +
 +
[9] Wiki.seeedstudio.com. (2017). Xadow - Wiki. [online] Available at: http://wiki.seeedstudio.com/wiki/Xadow [Accessed 1 Jun. 2017].
 +
 +
[10] "NFC Tools", Play.google.com, 2017. [Online]. Available: https://play.google.com/store/apps/details?id=com.wakdev.wdnfc&hl=en. [Accessed: 01- Jun- 2017].
 +
 +
[11] Librelink.com, 2017. [Online]. Available: https://www.librelink.com/ [Accessed: 01- Jun- 2017].
 +
 +
[12] BM019 Serial to NFC Converter - Serial Data to Near Field Communication Converter. Chico: Solutions Cubed, 2013, p. 20.

Latest revision as of 01:03, 30 October 2017

Introduction

The purpose of this project is to interrogate the commercially available product of flash glucose monitoring by building a wearable device. The importance of continuous glucose monitoring is to maintain the normal glucose tolerance in the human body. It would be useful for people who face life-threatening diabetes symptoms since if the diabetic patients take inappropriate actions without knowing their real-time blood sugar would result in losing their life. For this project, we choose the Freestyle Libre company’s glucose monitoring device. We build a wearable device that provides users with the ability to get the readings at any time on their phone rather than using another company’s own-designed monitor reader equipment. The application installed on users’ phone will display the data on their screen and store the readings in a remote server to allow them to access the information from different devices.

Freestyle Libre Flash Glucose Monitoring System

Libre Freestyle Sensor
Libre Freestyle Reader

This product consists of two parts, sensor and reader. Both are communicated via NFC which means the reader need to be close enough to interact with sensor. The sensor is small and lightweight. Thus, it is also a water-resistant. It is designed to be worn for up to 14 days and it need to be applied on the back of the upper arm. When sensor is applied, a thin, flexible and sterile fibre is inserted just under the skin. Sensor dimensions is 35mm x 5mm and its weight is 5 grams. It has memory to store the data up tp eight hours.

Design

System Architecture

Near Field Communication

This board is based on module ST Micro CR95HF NFC interface chip. This chip allows the the board to communicate with Near Field Communication EEPROM and enabled tags via SPI interfaces or UART. Operating frequency of this RFID is 13.56MHz. It supports three different protocols which are ISO/IEC 14443, 15693 and 18092 [12].

Bm.png

The antenna is designed to be on the bottom part of the board as labelled in the Figure 9. This module operates at the voltage of 3.3VIts maximum operating distance for detecting NFC tags is 28mm depending on the current antenna size. Its dimension is 27.94mm x 38.10mm x 1.27mm and its weight is 45.4g. As written on the board, this module is designed and manufactured by Solutions Cubed. This board will cost for A$16 [12].

To establish the communication of NFC, there are few steps that need to be followed. First, user need to determine which communication interface they want to use, either UART mode or SPI mode. The red part which is NFC protocol must be set by user and for this project, the protocol used is ISO/IEC 15963. NFC protocol gas to be enclosed correctly into the CR95HF protocol. Then, CR95HF will handle all the communication flow to and from RF tag or in this project is refer to sensor.

Nffffc.png

Set Up Communication Interface

A wake-up pulse (low) is needed after the module power-up to set the communication interface. A wake-up pulse (low) is needed after the module power-up to set the communication interface.

SPI.png

Setting Up Protocol Interface

In NFC communication flow, CR95HF acts as a translator that converts serial commands to RF signals and vice versa. As shown in the pictures, the line that is set with hexadecimal value of “0x01” is the command to set the protocol of ISO/IEC 15693. This can be refer from the datasheet of BM019 [12].

Protocol.png

Reading Data from Sensor

To read the glucose data from the sensor, the command is “Read Single Block”. This will send signal to CR95HF to read a single block of memory from RF tag/sensor and the hexadecimal code for this command is “0x20”.

Read.png

Case Design

Designing a case for the device is required to make it wearable. A lot of things need to be considered while designing the case which includes the size, durability, material and weight. This is because to make sure it will be comfortable and safe to wear. Selection of material is the crucial part because to ensure it will not give harm to the skin since it will be worn for 24/7.

GluCase.png

GluLid.png

The dimension of the case is labelled as in the picture and all the measurements are in millimeter(mm). The round hole is made to occupy the sensor which attached to the arms. There are still a lot improvements can be made to this design especially with its size because it still looks a bit bulky for a device that will be worn for 24/7. The width is a bit long because it is designed to deploy the armband at the both end.

3DPrint.png

Bluetooth

The team decided to use HM-13 as our Bluetooth module since its dimensions suiting our project, 1.7 mm * 27 mm * 13mm, 0.8 grams. It supports Bluetooth 4.1 connectivity with 2~8 Kb/s transferring rate. 4 pins will be used to utilize this module, Rx, Tx, Vcc, GND. The Rx and Tx pins connect to the main chip board for transmitting signal. Vcc and GND pins provide the power.

HM-13.jpg

HM-13

After checking with HM-13’s data sheet, we discovered that connect pin 15 of HM-13 can improve battery lifetime.

Set up correct Baud Rate

The default setting for the BLE connection baud rate is 9600. In case this rate value is not recognizable, the for loop will try all 8 possibilities and set the correct value once it reads an “OK” response. Once the device is turned on, the wakeup function will call ‘restartBLE’ function to deliver the stored data in “HIGH” variable.

Set up baud rate.png

Build Bluetooth Packet

This is the most critical part of the project since it will transfer the data collected from NFC modules and send the measurement to the mobile phone. This process is like how the cargo transfers intermodal containers between harbours. A packet shall be created to let the xDrip application accept following the BTWixel packet which is the uniformed format containing all required criteria by the application. The packet includes current glucose value, current battery percentage, sensor minutes elapse, glucose trend (15-minutes trend), current battery level and in mV.

Build up bluetooth packet.png

Output of raw NFC readings and converted Bluetooth packet.png

Output of raw NFC readings and converted Bluetooth packet

Bluetooth Data Transfe

After gathering all required variables in the Packet string, the program calls “send packet” function to send these values to the mobile phone. It also checks the status of this process and returns whether it is a success or not. If the transmitting process failed, "Packet not sent! Maybe a corrupt scan or an expired sensor." will be displayed.

BT data transfer.png

Cloud Storage

All automated data readout will be transmitted to a cloud storage system and this storage system can be accessed via an android application. Our team decided to use the existing well-developed program xDrip+. The Nightscout xDrip+ application supports MongoDB1, which can be used as a file system with load balancing, enabling user to upload their real-time readings to the cloud and access them from anywhere later. After completing some research, the team choose Heroku2 as the service provider to deploy a website platform which not only store the data and but also display them with a nice Web UI showing the readings from the MongoDB straight forward. A specific application programming interface (API) code is used among 2 Android phones’ xDrip+ application so the statistics are synchronised. The second phone requests the online data base and download the information from remote server to local storage.

Here is the link of the online web interface. glucose-monitor : https://glucose-monitor1.herokuapp.com/

On 27th Oct 2017, a new Freestyle glucose sensor will be deployed and used during the exhibition. Since the glucose monitor sensor has 14 days of life time, after that, there is no reason to keep the website running without new uploads, but current data base can be exported. This website will be closed after 10th Nov 2017.

Following is one sample of the entries uploaded by the application. It contains current glucose level reading, current device battery level, time.


{ "_id": {"$oid": "59f0f45c0323d652496bdeb4"},

   "device": "xDrip-LimiTTer",
   "date": 1508963414135,
   "dateString": "2017-10-26T07:00:14.135+1030",
   "sgv": 93,
   "direction": "Flat",
   "type": "sgv",
   "filtered": 80823.52334999999,
   "unfiltered": 80823.52334999999,
   "rssi": 100,
   "noise": 1}

Nightscout Web Interface.png

Nightscout Web Interface

Group Members

Hui Wang

Wan Muhammad Che Mustafa

Supervisors

Prof. Mathias Baumert

Dr. Said Al-Sarawi

References

[1] "Diabetes in Australia", Diabetesaustralia.com.au, 2017. [Online]. Available: https://www.diabetesaustralia.com.au/diabetes-in-australia. [Accessed: 24- Oct- 2017].

[2] "Diabetes", World Health Organization, 2017. [Online]. Available: http://www.who.int/mediacentre/factsheets/fs312/en/. [Accessed: 25- Oct- 2017].

[3] W. Organization, Global Report On Diseases 2016. France: World Health Organization, 2016, pp. http://apps.who.int/iris/bitstream/10665/204871/1/9789241565257_eng.pdf.

[4] H. Information, D. Overview, P. Problems, L. (Hypoglycemia), L. (Hypoglycemia), T. Center and N. Health, "Low Blood Glucose (Hypoglycemia) | NIDDK", National Institute of Diabetes and Digestive and Kidney Diseases, 2017. [Online]. Available: https://www.niddk.nih.gov/health-information/diabetes/overview/preventing-problems/low-blood-glucose-hypoglycemia. [Accessed: 20- Apr- 2017].

[5] F. Sensor and F. Reader, "Flash Glucose Meters & Monitoring Systems Online in Australia", FreeStyleLibre.com.au, 2017. [Online]. Available: https://www.freestylelibre.com.au/. [Accessed: 21- Apr- 2017].

[6] "FreeStyle Libre Reader - Buy Online", Freestylelibre.co.uk, 2017. [Online]. Available: https://www.freestylelibre.co.uk/libre/products/reader.html. [Accessed: 21- Apr- 2017].

[7] "UPetersen/LibreMonitor", GitHub, 2016. [Online]. Available: https://github.com/UPetersen/LibreMonitor. [Accessed: 21- Apr- 2017].

[8] "JoernL/LimiTTer", GitHub, 2016. [Online]. Available: https://github.com/JoernL/LimiTTer. [Accessed: 21- Apr- 2017].

[9] Wiki.seeedstudio.com. (2017). Xadow - Wiki. [online] Available at: http://wiki.seeedstudio.com/wiki/Xadow [Accessed 1 Jun. 2017].

[10] "NFC Tools", Play.google.com, 2017. [Online]. Available: https://play.google.com/store/apps/details?id=com.wakdev.wdnfc&hl=en. [Accessed: 01- Jun- 2017].

[11] Librelink.com, 2017. [Online]. Available: https://www.librelink.com/ [Accessed: 01- Jun- 2017].

[12] BM019 Serial to NFC Converter - Serial Data to Near Field Communication Converter. Chico: Solutions Cubed, 2013, p. 20.