Skip to main content

The ScientISST SENSE Python API

Project description

scientisst-sense-api-python

The ScientISST SENSE Python API.

Learn how to use it, check examples, and much more here!

Dependencies

  • PySerial

Install it using pip:

pip install pyserial

Installing

# Getting this repository 
git clone https://github.com/scientisst/scientisst-sense-api-python.git

Running

Automatic

  1. Pair your device
  2. Run:
python sense.py
  1. Select the device from the list displayed:
ScientISST devices:
[1] ScientISST-ab-de - 08:3A:F2:49:AB:DE
[2] ScientISST-ac-be - 08:3A:F2:49:AC:BE
Connect to: 
  1. Hit CTRL-C when you wish to stop.

Help

$ python sense.py -h

usage: sense.py [args] address

description: The program connects to the ScientISST Sense device and starts an acquisition, providing the option to store the received data in a .csv file.

positional arguments:  address               Linux: bluetooth MAC address, Mac: serial port address, Windows: bluetooth serial COM port

optional arguments:
  -h, --help            show this help message and exit
  -f FS, --frequency FS
                        sampling frequency, default: 1000
  -c CHANNELS, --channels CHANNELS
                        analog channels, default: 1,2,3,4,5,6
  -d DURATION, --duration DURATION
                        duration in seconds, default: unlimited
  -o OUTPUT, --output OUTPUT
                        write report to output file, default: None
  -s, --lsl             stream data using Lab Streaming Layer protocol
  -q, --quiet           don't print ScientISST frames
  -v, --verbose         log sent/received bytes

Manual

Linux

Pair and trust the ScientISST Sense board:

bluetoothctl
scan on
pair XX:XX:XX:XX:XX
trust XX:XX:XX:XX:XX

You can now run the sense.py script:

python sense.py XX:XX:XX:XX:XX

Mac

First, you need to pair the ScientISST sense device in the Bluetooth Settings section. Then, you'll need to find the serial port address using the Terminal:

ls /dev/tty.ScientISST*

Copy the String like: /dev/tty.ScientISST-XX-XX-SPP_SE.

You can now run the sense.py script:

python sense.py /dev/tty.ScientISST-XX-XX-SPP_SE

Windows

Turn the ScientISST Sense board on.

Now, go to Control Panel > Hardware and Sound > Devices and Printers. Select "Add a device". Select the ScientISST Sense board, hit "next" until its set up.

While connected to the board, search "Bluetooth settings" on the Control Panel, then go to the "COM ports" tab and check the port name for the outgoing entry. Copy the String like: COMX

You can now run the sense.py script:

python sense.py COMX

Example

Example usage to acquire AI1 at 10Hz sample rate (Linux):

python3 sense.py -f 10 -c 1 08:3A:F2:49:AC:D2 -o output.csv

Plot

Dependencies:

  • pandas
  • numpy
  • matplotlib
python plot_output.py

Example ECG

Disclaimer

This is not a medical device certified for diagnosis or treatment. It is provided to you as is only for research and educational purposes.

Acknowledgments

This work was partially supported by Fundação para a Ciência e Tecnologia (FCT) under the projects’ UIDB/50008/2020 and DSAIPA/AI/0122/2020 (AIMHealth) through IT—Instituto de Telecomunicações, which is gratefully acknowledged.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

scientisst-sense-1.0.4.tar.gz (18.4 kB view details)

Uploaded Source

Built Distribution

scientisst_sense-1.0.4-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

Details for the file scientisst-sense-1.0.4.tar.gz.

File metadata

  • Download URL: scientisst-sense-1.0.4.tar.gz
  • Upload date:
  • Size: 18.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.9.13

File hashes

Hashes for scientisst-sense-1.0.4.tar.gz
Algorithm Hash digest
SHA256 599c248e456c34ff602484908890c62c7bc57dc47080ffe3764e500e84fa174c
MD5 933667778f786ebde9526d64083fc0c4
BLAKE2b-256 84c9c51f1e535acd1db1d0427e493dc755c36902d074356562647a3ef628e524

See more details on using hashes here.

File details

Details for the file scientisst_sense-1.0.4-py3-none-any.whl.

File metadata

File hashes

Hashes for scientisst_sense-1.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a049e04649397374fa1c42783b91c4cd4d11ddf52140bfaeb7c79cc7e69e7445
MD5 3d7ff958a1827cf9f63d63644d564ffa
BLAKE2b-256 c0eb9679ce9bc937a650ac625386c2b48d0a20a5ad3b02f06e212ec7b51f848c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page