BrainBit for developers Subscribe for updates Visit website

BrainBit 2 Devices

 

The BrainBit2 class is designed to work with several device families: BrainBit (new), BrainBit Pro, BrainBit Flex (new), BrainBit Flex Pro. All devices have a sampling frequency of 250Hz. All devices can work in two modes - signal and resistance separately. These devices have different number of channels - BrainBit, BrainBit Flex have 4 channels each and BrainBit Pro, BrainBit Flex Pro have 8 channels each. The main difference from BrainBit of the first version is that they do not support gain property, but have the ability to set gain for each channel separately using `BrainBit2AmplifierParam` structure. Also, devices of this type support the ping command and have an 8-digit serial number.

 

Ping signal

BrainBit2 devices support signal quality check functions using signal ping. You can send a specific value (marker) to the device and it will return that marker with the next signal data packet. Marker is small value one byte in size.

OpStatus outStatus;
pingNeuroSmart(sensor, 5, &outStatus);
            
sensor.pingNeuroSmart(5);
            
sensor.pingNeuroSmart(5)
            
sensor.PingNeuroSmart(5);
            
sensor.PingNeuroSmart(5)
            
sensor.ping_neuro_smart(5)
            
sensor?.pingNeuroSmart(5)
            
[sensor PingNeuroSmart:5];
            

 

 

Info about channels

The device can have 4 or 8 channels. To determine how many and which channels they are, you need to use the `getSupportedChannels()` method:

let channels: Array<EEGChannelInfo> = getSupportedChannels()
            

            

            

            

            

            

            

            

 

`EEGChannelInfo` contains some info:

| Field | Type | Description |
|--|--|--|
|Id|EEGChannelId|physical location of the channel. You will receive the values `O1`, `O2`, `T3`, `T4` or `Unknown`. `Unknown` means that the position of a specific electrode is free.|
|ChType|EEGChannelType|type of channel, possible values `A1`, `A2`, `Differential` or `Referent`|
|Name|String|channel name|
|Num|number|channel number. By this number the channel will be located in the array of signal or resistance values|
            

            

            

            

            

            

            

            

 

You can also check only the number of channels with no information:

let maxChCount: number = BrainBit2Sensor.getMaxChCount()

let chCount: number = sensor.getChannelsCount()
            

            

            

            

            

            

            

            

 

AmpMode

This device can show it's current amplifier mode. It can be in the following states:

  • Invalid;
  • PowerDown;
  • Idle;
  • Signal;
  • Resist.

You can check Amp. mode by two ways:

1. By callback:

sensor.AddAMPModeChanged((ampMode)=>
  { 
    console.info("ampMode: " + ampMode) 
  });
            

            

            

            

            

            

            

            

2. Get value at any time:

var mode: SensorAmpMode = sensor.getAmpMode()
            

            

            

            

            

            

            

            

It is very important parameter for BrainBit2 device because you can set amplifier parameters only if device into `PowerDown` or `Idle` mode.

 

Amplifier parameters

You can configure each channel and whole device settings by setting amplifier parameters.

let chCount = sensor.getChannelsCount();

let ampParam: BrainBit2AmplifierParam = {
  Current: GenCurrent.GenCurr6nA,
  ChSignalMode: Array(chCount).fill(BrainBit2ChannelMode.ChModeNormal),
  ChResistUse: Array(chCount).fill(true),
  ChGain: Array(chCount).fill(SensorGain.Gain6),
};
sensor.setAmplifierParam(ampParam)
            

            

            

            

            

            

            

            

 

Current

Sets the parameters of the probe current generator. Possible values:
- 0 nA
- 6 nA
- 12 nA
- 18 nA
- 24 nA

 

Signal modes

- Short - shorted input
- Normal - bipolar input mode (used for EEG)

 

Gain

Gain of an ADC signal for each channel. Possible values:
- 1
- 2
- 3
- 4
- 6
- 8
- 12

 

Receiving signal

To receive signal data, you need to subscribe to the corresponding callback. The values come in volts. In order for the device to start transmitting data, you need to start a signal using the `execute` command. This method is also recommended to be run in an separate thread.

sensor.AddSignalReceived((data)=>{
    console.log(data)
}); 
sensor.execute(SensorCommand.StartSignal)
...
sensor.RemoveSignalReceived();
sensor.execute(SensorCommand.StopSignal)
            

            

            

            

            

            

            

            

You get signal values as a list of samples, each containing:

| Field | Type | Description |
|--|--|--|
|PackNum|number|number for each packet|
|Marker|number|marker of sample|
|Samples|Array<number>|array of samples in V. Each sample number into array consistent with `Num` value of EEGChannelInfo from `getSupportedChannels()` method.|
            

            

            

            

            

            

            

            

 

Receiving resistance

BrainBit2 also allow you to get resistance values. With their help, you can determine the quality of the electrodes to the skin. Initial resistance values are infinity. The values change when the device is on the head.

sensor.AddResistanceReceived((data)=>{
    console.log(data)
}); 
sensor.execute(SensorCommand.StartResist)
...
sensor.RemoveResistanceReceived();
sensor.execute(SensorCommand.StopResist)
            

            

            

            

            

            

            

            

 

You get resistance values structure of samples `ResistRefChannelsData` for each channel:

| Field | Type | Description |
|--|--|--|
|PackNum|number|number for each packet|
|Samples|Array<number>|array of samples in V. Each sample number into array consistent with `Num` value of EEGChannelInfo from `getSupportedChannels()` method.|
|Referents|Array<number>|array of values for referents channels. For BrainBit2 sensor is empty now.|