Pulse Sensor + Cyton data collection with Brainflow [resolved]
Hello!
I am using the OpenBCI pulse sensor, but I cannot find where that data can be accessed with the python Brainflow API. For example, with the EEG data you can simply use brainflow.board_shim.BoardShim.get_eeg_channels() to get the EEG channel indexes. I realize that the pulse sensor is not connected to the pins on the Cyton like the EEG sensors (but rather the D11 header), but I don't see anything in the Brainflow documentation about reading data from those inputs.
Also, if this is not the right category for this question, please let me know where else I should post it.
Thank you!
Comments
Aven, hi.
Please see this section of code in the GUI widget,
https://github.com/OpenBCI/OpenBCI_GUI/blob/master/OpenBCI_GUI/W_PulseSensor.pde#L267
The pulse data is coming in on one of the THREE Cyton 'Aux' channels. This channel represents the brightness level from the PSG sensor. It is NOT a direct BPM rate value; BPM is derived from the pulse wave peak detected via above code. There are three of the Aux channels, corresponding to the lower resolution analog to digital converters on the PIC32 / chipKIT microcontroller. When the Cyton is in 'analog mode', the three accel channels are replaced by the three Aux values.
https://brainflow.readthedocs.io/en/stable/SupportedBoards.html#cyton
The Cyton SDK (serial port command string) is used to switch from the default accel values to the 'analog' mode:
https://docs.openbci.com/docs/02Cyton/CytonSDK#board-mode
Analog mode is set by the ascii command string
"/2".https://brainflow.readthedocs.io/en/stable/UserAPI.html#python-api-reference
The Python Brainflow function
config_board(string)sends the command string, in your startup code before the Cyton starts streaming.William
Exactly what I was looking for - thank you!
Here is an addendum mentioned by Andrey today on the Brainflow Slack, regarding the ordering of the config_board call, relative to other Brainflow calls.