How can I read out sensor data in real-time from a Clue to a

For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

How can I read out sensor data in real-time from a Clue to a

Post by Peter_Gamma »

The Pyloton open source bike computer is based on the Clue. I want to reat out heart rate sensor data from to Clue to a PC. How can I read out sensor data in real-time from a Clue to a PC?

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Arduinos can be connected to Matlab or Python through usb, and there are examples available for instance on youtube how to control an Arduino from a PC. I ve read somewhere, that the Clue is Arduino compatible, is that correct?

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Here

https://www.hackster.io/news/get-a-clue ... 01884a7a28

it says, you can expect Arduino IDE compatibility of the Clue. Does that mean I can connect for instance over usb with the same software to the Clue as to an Arduino?

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: How can I read out sensor data in real-time from a Clue

Post by adafruit_support_bill »

Yes, the Clue is Arduino compatible. Instructions for setting it up in the Arduino IDE can be found in the documentation: https://learn.adafruit.com/adafruit-clu ... O1NnbnIkLw

You can send data to your PC via the same USB/Serial connection used to program the board.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Thank you, adafruit_support_bill, for your answer, that s great.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Thank you for your answer. Therefore it should be possible to have a Serial Connection between Arduino UNO to Matlab via USB:

https://www.youtube.com/watch?v=ymWXCPenNM4&t=43s

for instance to read out BLE sensor data from the Pyloton Open Source Bike Computer to Matlab.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

If it works, the Pyloton would probably be the easiest way to stream BLE sensor data to Matlab:

https://www.mathworks.com/matlabcentral ... contriblnk

It only needs a bridge code and a proof that it works.

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: How can I read out sensor data in real-time from a Clue

Post by adafruit_support_bill »

We are not Matlab experts and have not tested that configuration. But the Clue supports standard Arduino Serial communication via the USB port.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Thanks.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

I was looking for most suitable devices for meditation and meditation research. I found out that Bike computers are the most suitable devices. :-)

The Garmin Varia Vison insight display which is great for meditation works best when connected to a Bike computer.

And meditation research as done by Richard Davidson and the Dalai Lama looks promising with BLE sensors, Matlab and the Pyloton Open Source Bike Computer :-).

Or when we look for low cost-high quality devices. Then it looks most promising with BLE sensors, desktop Python heart rate analysis software and the Pyloton bike computer :-)

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Here is an example of an USB communication between Arduino Uno & PC using Python, which eventually also could be used for reading out sensor data from a Pyloton Bike Computer:

https://www.youtube.com/watch?v=CebbJ7zrAWU

The example shows how to send sensor data from PC to Arduino over usb. Unfortunately, I did not get an answer from the author of the youtube video, whether it is possible to use this example also to read out sensor data from an Arduino.

User avatar
kevinjwalters
 
Posts: 1026
Joined: Sun Oct 01, 2017 3:15 pm

Re: How can I read out sensor data in real-time from a Clue

Post by kevinjwalters »

I've not used it for a while but I have GNU Octave installed. It looks simple to do with the instrument-control package and there are a few examples floating around t'internet. Two notes of caution: the naming syntax on Windows is very unusual (s1 = serial("\\\\.\\COM10");) and some examples are incorrect; when I tried it half my USB serial ports stopped working and could only be recovered by rebooting Windows, YMMV.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

Great package. Many many thanks.

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

But also in Python, there are great analysis tools, like the Python Heart Rate Analysis Toolkit:

https://www.google.ch/url?sa=t&rct=j&q= ... 4Nie4rpwq0

Sensor raw data could be helpful for calculating heart rate variability, and it is also necessary for estimation of respiratrory rate in Matlab. But do I get raw sensor data from the Pyloton bike computer?

User avatar
Peter_Gamma
 
Posts: 56
Joined: Tue Jun 02, 2020 5:38 pm

Re: How can I read out sensor data in real-time from a Clue

Post by Peter_Gamma »

For heart rate variability or respiratory rate estimation ECG peaks or PPG peaks are needed. Polar OH1 or Polar H7 BLE sensors for instance can be used for such calculations, as shown by the Polar HRV logger:

https://play.google.com/store/apps/deta ... ri_monitor

but do I get heart sensor raw data out of the Pyloton?

Locked
Please be positive and constructive with your questions and comments.

Return to “CLUE Board”