Skip to content

UPetersen/LibreMonitor

Repository files navigation

LibreMonitor - Monitor your Freestyle Libre

LibreMonitor is a little DIY device that uses near field communication to read data from a Freestyle Libre sensor and transmit it via bluetooth low energy to an iPhone application. LibreMonitor scans the sensor every two minutes. It transfers all the 32 history values for the last eight hours and the 16 trend values for the current time and the last 15 minutes and displays them in a chart and in a table.

Be aware that only the so called raw data is used and you have to choose slope and intercept yourself to have the application calculate useful glucose values. Values that mostly work fine for my sensors are 0.13 for slope and -20 for offset. Any other internal information such as from the temperature sensors is not yet fully understood and thus neglected.

This code is published so that others can contribute and help to improve it or use it to improve their own devices.

LibreMonitor has no affiliation of any kind with Abbott. This is a DIY project for research purposes. The code provided here might provide wrong results. You will have to build your own device and are responsible for the results. Use at your own risk.

What you need to build a LibreMonitor

1. Buy some hardware

Parts needed for a LibreMonitor are

  • BM019 NFC module capable of ISO/IEC 15693 commands. Possible sources are Solutions Cubed LLC, Warbutech or Robotshop.
  • Simblee or RFDuino and a corresponding USB Programming Shield. I recommend to get a startet kit. See their Webites for Distributors.
  • Lipo, e.g. this one (100 mAh is fine for a full day).
  • Lipo charger (optional), e.g. this or this from adafruit.
  • Switch (optional but helpful if you mount a lipo charger).

2. Do the wiring

Wire the parts as shown in the following diagram (courtesy to libxMike).

It is suggested to mount and test everything on a breadboard before soldering the final device. Below are pictures of another LibreMonitor device without a lipo charger. As you can see, one can save a lot of space by cutting of the black part of the stacks for Pins GPIO2 to GPIO6, push them through the pin holes of the BM019 and then solder the parts together. Therefore you also have to cut off the stack pins on the other side, too. It is suggested to bend the black part of the other stacks by 90 degree. Thus, you can still plug in the USB Programming Shield (RFD22121) but save some space.

Another device, this time with a lipo charger:

3. Program your Simblee

Simblee is IoT for connecting Everyone and Everything (IoT4EE). It incorporates Mobile, Bluetooth® Smart, Mesh, Cloud and other forms of wireless connectivity.

The software to program the Simblee is standard Arduino code. It consists of LibreMonitor.ino and the library contained in LibreMonitorArduinoLibrary.zip. Refer to the Simblee quick start guide on the Simblee website for instructions on how to program the Simblee. If you wired your LibreMonitor as described above, don't forget to reconfigure the SPI pins of the Simblee in the variant.h file (see the wiring information in LibreMonitor.ino for more information on this)

4. Build and run the LibreMonior iOS application

The iOS application requires Xcode 8, swift 3.0 and iOS 10. Download the Xcode project. Run cocopoads to install the charts library, needed for the blood sugar graph. Build the application and run it on the phone and start it. If you want to receive notifications for high or low glucose values and have a badge icon displayed, allow for the corresponding settings, when asked. Once the app is running set values for slope and offset (e.g. 0.13 and -20, press the corresponding row to get into the settings view). Connect to your Simblee by pressing "connect". Once the Simblee ist detected and connected the "Simblee status" should change to "Notifying" and be green. Place the LibreMonitor device above your Freestyle Libre and after no more than two minutes the data should be displayed or refreshed. See the screenshots below.

Some explanations

The "Glucose" row shows the current glucose value and two "delta values" that show how the glucose is about to develop (linear extrapolation for the next fifteen minutes). The first delta value is the difference of the current and the oldest minute-value, the delta value in braces is the difference of the current glucose value and the glucose value from 8 minutes ago, multiplied by two. The two "prognosis" glucose values are calculated by adding the delta values to the current glucose value. Glucose is calculated from the raw value as follows:

glucose = raw * slope + offset

The "Last 15 minutes" and "Last eight hours" sections display the glucose values, corresponding date, the raw value, the 6 bytes of data as read from the Freestyle Libre sensor and some other test data.

General Troubleshooting

  • If a crc is wrong, most likely the device is not located near enough to the Freestyle Libre sensor.
  • If the data is not refreshed, disconnect and reconnect.
  • If the device cannot be connected, check whether bluetooth is switched on.

Suggested readings

Blog by Pierre Vandevenne with information on the internals of the Freestyle Libre and suggestions on how to choose slope and offset. Without his work all this would probably not have been possible.

Similar projects

  • LimiTTer. Similar device, but data is sent to xDrip+, an Android app.
  • Freestyle Libre Alarm. Uses as Sony smart watch to read data from the Freestyle Libre and send it to an Android phone.
  • Bluereader project by Sandra Kessler who got funding to build a small neat device. I intend to adapt this project to work with bluereader once the first devices are available.
  • Android reader application by Viktor Bautista that was helpful at the beginning of this work.

Personal note

As of September 2018: I used different versions of the LibreMonitor and similar hardware (Marek’s Transmitter) based on Simblee or RFDuino since early 2016 up to March 2018 and liked it very much. When I started the project nothing similar was available. Meanwhile many other projects have evolved and also commercial hardware is available. Since March 2018 I have been using the MiaoMiao hardware and I have to say that in my opinion it is much better than anything I had seen before. Thus I will no longer support the LibreMonitor hardware but only MiaoMiao hardware with the LibreMonitor iPhone application. So if you want to use the LibreMonitor with MiaoMiao, use the swift4 branch. If you choose to use the old LibreMonitor hardware, choose the old master branch.

About

Monitor your Freestyle Libre

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published