Understanding the Bias pin with Myoware + ECG

brownjonkentbrownjonkent United States
edited May 2019 in Cyton
How do I understand more about the bias pin?  I've managed to get the myoware board and the ecg leads working... separately, but since they both look like they use the bias pin, how do I use them at the same time?  Is there a limit to how many sensors and boards I can have running on the cyton?

Comments

  • brownjonkentbrownjonkent United States
    edited May 2019
    Is there a limit to the dupont cable/wire length that I can use when connecting the little sticker pad to the board or the sensor board to the cyton?

    I wanted to wire my bicep to the myoware board and then connect that to the cyton and that might be around 3-4 feet (taped on my arm, down my back and to a belt with the stuff in there).  

    Any other recommendations on how to hardwire the devices around the body?
  • wjcroftwjcroft Mount Shasta, CA
    Jon, hi.

    You really need only ONE bias / ground connection to the body when doing ECG or Myoware. So you are only limited by the number of channels (8 on Cyton). 

    My impression is that the Myoware idea was more applicable to Ganglion, which uses a complex compression scheme to send the data over Bluetooth. Because of this compression, RAW EMG may be harder to capture on Ganglion than Cyton. Cyton has no such limitation. Myoware makes this easier on Ganglion by INTEGRATING the raw EMG signal to produce an output signal that is the average amplitude (moving average) of the EMG over time. This signal changes more slowly than the raw EMG, hence is better received by Ganglion. Does that make sense?

    With Cyton, you can just collect the raw EMG directly, without using the Myoware. Although you can use Myoware boards if you have them.

    Regards,

    William

  • wjcroftwjcroft Mount Shasta, CA
    3 or 4 feet of wire is fine for EMG, ECG. Where wire length is more critical is in EEG, where shortest length possible is advisable. This reduces movement artifacts with the microvolt level EEG signals. EMG and ECG are millivolt level signals.
  • brownjonkentbrownjonkent United States
    William,

    Thanks for the replies!  The wire length one makes perfect sense, I'll build accordingly.

    As for the Bias, i guess the bias is considered a type of a "ground"?

    I have the cyton working with the myoware perfectly - I guess my next step is to try it with and without the bias to see if the readings change.

    Overall, I am shooting for heartrate with muscle activation sent into one "stream" of data.  From what I can tell, this occupies three for heartrate (1 bias + 2 on n5) and three for the myoware (1 bias + 2 on n1).  My initial thought that I cannot add another muscle sensor on there since my bias is full, but I guess if it's grounded then we should be ok.

    I dunno if what I said makes sense - this is my first run in this world :).

    -Rishi
  • wjcroftwjcroft Mount Shasta, CA
    Bias is the same as Ground on the Cyton. In some ECG / EMG applications this is also referred to as DRL Driven Right Leg, because a counter-mains small voltage is injected to cancel some of the mains noise.

    You always need ONE Ground connection from the EEG/ECG/EMG device to the person. You do not need more than one. So you can leave out the extra wires to multiple Myoware boards if you use such. So your statement "My initial thought that I cannot add another muscle sensor on there since my bias is full..." is not true.

  • brownjonkentbrownjonkent United States
    Just to make sure, based on the fact that there are 8 channels, I can have conceptually 8 muscle signals coming through?  or 8 of any type of sensor that's supported by cyton?

    If I wanted 6 muscle sensors + 1 ECG + 1 pulse sensor, that's just a matter of connecting them to the right connectors?

    I'm setting up an IoT data science project for a buddy who's a fighter, and could be a neat little harness to gather metrics while he's training.  Muscle movement vs heart rate vs etc.  Any advice on how to power said boards?  is it as easy as 3.3v DC source per board?


  • wjcroftwjcroft Mount Shasta, CA
    Yes, you could have 8 EMG signals coming in. Or 8 EEG channels, etc.

    Easiest way to power the Cyton, is with a small rechargeable lithium flat pack cell. Such as are sold on Adafruit.


    They also sell chargers powered by usb.

    "If I wanted 6 muscle sensors + 1 ECG + 1 pulse sensor..." Doesnt the ECG already give you the heart rate sensor you need? Are you talking about Joel Murphy's Pulse Sensor ear lobe clip. That would fall off someone doing athletics, and not give accurate readings.
  • brownjonkentbrownjonkent United States
    I ran out of things to keep adding to add up to 8 for my hyperbolic example... but yes, the ECG gives me most of what I need.

    At this point, I just have an arduino for the Oximeter, but all else is coming from the Cyton + Myowares.

    BTW - I know I keep adding questions, but any perspective on the Myoware power shields?  They look like theyr'e built to stack and power the sensors, assuming the only leads come into the Cyton.


    The adafruit link seems great, but the 4xAA pack that came with the Cyton seems to be working well for now.  Why would anyone move to the power packs aside from making them rechargeable?

    Thank you!!!
  • wjcroftwjcroft Mount Shasta, CA
    You should not need the Myoware's with Cyton, it can receive the full raw EMG. You can do the same type of moving average integration that Myoware does, with your own calls on common DSP libraries. As I mentioned the Myoware was more targeted to Ganglion. Using multiple Myowares will make your subject feel more awkward with circuit boards strapped to his arms or legs. The simple EMG leads are all you need. With the cables running to the Cyton taped down.

    https://www.mvapmed.com/button-snap-1-5mm-lead-5-pack-.html

    The 4xAA pack is fine, but somewhat bulky if you are going to be taping the Cyton (perhaps in a plastic bag) to your subject. In that case the flat pack lithium cells are both much more mAh capacity and much smaller / lighter.
  • brownjonkentbrownjonkent United States
    oh, that's interesting.. i don't need the myoware at all?


    let's say I have three leads for the ECG (one on the right wrist and two on the left wrist). 

    From what i know of the Myoware, they have two leads that run longitudinal to the muscle and the little black one off to the side.  

    How would I place the other EMG leads to get the same/similar signals?  
  • wjcroftwjcroft Mount Shasta, CA
    https://www.google.com/search?q=emg+electrode+placements

    Click on the Google Search 'Images' tab to see example placements. It is typically in one the center of the muscle body, then the other off to the side by some short distance. These are your two differential signals connected to the INxN and INxP pins.

    The black wire in the Myoware is just Ground, and the same as the 'R' wire shown in the tutorial. That connects to the Ground pin in the Cyton. You just need ONE single ground connection for all your EMG electrodes. NOT one per pair.

    ECG / sEMG electrode leads are available in various lengths. I see the OpenBCI kit is 1 meter. But other lengths are available. The MVAP page shows those terminated in touchproof connectors. You can either use the converters shown on the store, or just cut off the touchproof, and splice on a female dupont / berg connector such as these from Adafruit,


    You can use your Myoware, but if you are needing to use 6 or 8 of them, that seems rather bulky and unnecessary. Reread the previous comment:


    The only advantage the Myoware offers, is the integration / moving average. This is easily done in any DSP library.
  • brownjonkentbrownjonkent United States
    Wow.. this is quite eye opening.  I cannot thank you enough!!

    So if I got this right, let's say I set this up:
    1 EMG lead from ground to somewhere on the body
    2 EMG leads from top and bottom N1P to each wrist
    2 EMG leads from top and bottom N2P to let's say bicep along the muscle
    2 EMG leads from top and bottom N3P to tricep along the muscle
    2 EMG leads from top and bottom N4P to shoulder
    2 EMG leads from top and bottom N5P to chest
    all taped down and wired to a project box with the battery pack (for now) and the cyton

    This will ultimately get me in the GUI and the SDK
    channel 1 = ECG
    channel 2 = muscle activity on bicep
    channel 3 = muscle activity on tricep
    channel 4 = muscle activity on deltoid
    channel 5 = muscle activity on pectorals

    the software on the other end of the NodeJS code does all the DSP... all i really need to try to do is to send the raw data onwards to the data science teams.

    then, no need for the myo at any point.... ?

    -Rishi
    PS - appreciate your patience.. this is all magic as I work through understanding it :)
  • wjcroftwjcroft Mount Shasta, CA
    ECG is typically measured on the chest, see the recent thread "5 Lead ECG", for diagrams. The wrists are used in the tutorial for ease of placement, and so Conor did not need to take off his shirt(!)  ;-)

    Check with sites that specialize in surface EMG for the recommended placement for each muscle you are interested in.

    The Cyton pins are labled IN1N, IN1P, IN2N, IN2P, etc. The board mask printing had to abbreviate that to fewer letters.

    You can play around with your Myoware, but should not need it.
  • brownjonkentbrownjonkent United States
    ok so i wired it all up... two leads on one bicep + wrist placement for ECG (for now)

    I see the ECG graph on both channels inthe UI, and when i flex my bicep, both graphs show muscle activity. 

    Is that normal just because of the way the UI works, and I need to DSP the signal data to actually treat them differently, or did I mess something up in my wiring?  I'm trying to decipher the posts, but it's taking me a while to work through the acronyms.


  • wjcroftwjcroft Mount Shasta, CA
    edited May 2019
    Did you go through all the steps of the tutorial?

    You need to disconnect your EMG & ECG channels from the SRB and Bias busses.
  • brownjonkentbrownjonkent United States
    I see the part of the tutorial that I've missed - I'll work through that today.

    Just to validate tho, these are changes that are for the GUI right?  the "raw" signals coming through aren't processed here.  I'm getting my data primarily through the nodeJS tool and so that data is being relayed directly to the analytics tools.

    I assume would need to recreate the filtering and signal processing there?
  • wjcroftwjcroft Mount Shasta, CA
    (1) the GUI (and Hub) interact with the Cyton using the data stream format and SDK (serial port commands) listed here,


    If you look through the SDK you will see serial port commands that correlate directly with the settings available in the GUI. In the GUI when you disconnect channels from the SRB and Bias busses, the serial port commands are sent. You can do the same in your node.js program.

    (2) I forgot to mention last night, that measuring ECG from the wrists, and simultaneously trying to get EMG from the bicep, is not recommended. In that case you have TWO overlapping differential circuits (bicep inside of ECG). You need to move the ECG onto the chest. Otherwise you are also going to get interference.

    You still need to disconnect from the SRB and Bias busses, all your EMG and ECG channels. Because these channels are differential and use both pins. The SRB busses are for EEG type applications, with ONE reference lead and 8 single wire per channel electrodes on the scalp.
  • brownjonkentbrownjonkent United States
    OK, this will take me a bit to decipher, but I'm mounting ECG to the chest and keeping my bicep points.  The part about the overlapping circuits makes perfect sense.

    I'll also look at the SDK on how to disconnect the SRB and Bias busses.... will experiment there.

    I also don't see in the SDK where to get the accelerometer data... I see sample.samplenumber, sample.timestamp, and sample.channelData[0-7], but not sure how to reference the X/Y/Z?

    ourBoard.on('sample', (sample) => {
    BCIJSON = '[{\"sampleindex\":' + sample.sampleNumber + ',{\"timestamp\":' + sample.timestamp + ',\"Channel0\":' + sample.channelData[0].toFixed(8) + ',\"Channel1\":' + sample.channelData[1].toFixed(8) + ',\"Channel2\":' + sample.channelData[2].toFixed(8) + ',\"Channel3\":' + sample.channelData[3].toFixed(8) + ',\"Channel4\":' + sample.channelData[4].toFixed(8) + ',\"Channel5\":' + sample.channelData[5].toFixed(8) + ',\"Channel6\":' + sample.channelData[6].toFixed(8) + ',\"Channel7\":' + sample.channelData[7].toFixed(8) + ',}]';
        console.log(BCIJSON);

    });

    -Rishi
  • wjcroftwjcroft Mount Shasta, CA
    In addition to 'channelData' 0 to 7, there are also 'auxData' 0 to 2. I'm not sure where the code snippet above is from, but you need to parse ALL of the data packet info, not just the channelData.

  • brownjonkentbrownjonkent United States
    That's my nodeJS code where I'm listening to the data stream and sending JSON messages to my analytics tools.

    I don't see an example of nodeJS where I can pull the auxData, but I guess it to be "sample.auxData[0-2]"?

    ps - what did you mean that I need to parse all of the data packet info?  What other data elements are there besides channelData and auxData?
  • wjcroftwjcroft Mount Shasta, CA
    I was referring to the auxData, which the code above is missing. See the data format description for all the fields. 
  • brownjonkentbrownjonkent United States
    I think the nodeJS libraries are masking what the serial data coming in looks like, and how it maps to the Cyton object in the code.

    I instantiate the Cyton, then once I start the stream, I get access to the data elements in the sample object.  There fore I only know of the channelData stuff, never saw the auxData... am curious what else is mapped to the Cyton object in the libraries

    This is my full code:

    const Cyton = require('./node_modules/@openbci/cyton/openBCICyton');
    const debug = false; // Pretty print any bytes in and out... it's amazing...
    const verbose = false; // Adds verbosity to functions
    const myArgs = process.argv.slice(2);

    let ourBoard = new Cyton({
        debug: debug,
        verbose: verbose
    });

    let portName = '/dev/ttyUSB0';

    if (myArgs.length === 1) {
        portName = myArgs[0];
    }

    ourBoard.on('sample', (sample) => {
    BCIJSON = '[{\"sampleindex\":' + sample.sampleNumber + ',{\"timestamp\":' + sample.timestamp + ',\"Channel0\":' + sample.channelData[0].toFixed(8) + ',\"Channel1\":' + sample.channelData[1].toFixed(8) + ',\"Channel2\":' + sample.channelData[2].toFixed(8) + ',\"Channel3\":' + sample.channelData[3].toFixed(8) + ',\"Channel4\":' + sample.channelData[4].toFixed(8) + ',\"Channel5\":' + sample.channelData[5].toFixed(8) + ',\"Channel6\":' + sample.channelData[6].toFixed(8) + ',\"Channel7\":' + sample.channelData[7].toFixed(8) + ',}]';
    console.log(BCIJSON);
    });

    This is what I see in the log (I only had channels 6 and 7 connected:

    /usr/local/bin/node /home/rshah/Documents/BCITest/test.js
    Debugger listening on ws://127.0.0.1:44859/d77cf194-9f6a-42cf-879b-ed0281a5e52f
    Debugger attached.
    [{"sampleindex":0,{"timestamp":1559104502776,"Channel0":0.00000000,"Channel1":0.00000000,"Channel2":0.00000000,"Channel3":0.00000000,"Channel4":0.00000000,"Channel5":0.00000000,"Channel6":0.00000000,"Channel7":0.00000000,}]
    [{"sampleindex":1,{"timestamp":1559104502836,"Channel0":0.01850733,"Channel1":-0.18750002,"Channel2":-0.18750002,"Channel3":0.18750000,"Channel4":0.18750000,"Channel5":0.18750000,"Channel6":0.00220777,"Channel7":-0.18750002,}]
    [{"sampleindex":2,{"timestamp":1559104502837,"Channel0":0.01859634,"Channel1":-0.18750002,"Channel2":-0.18750002,"Channel3":0.18750000,"Channel4":0.18750000,"Channel5":0.18750000,"Channel6":0.00222270,"Channel7":-0.18750002,}]
    [{"sampleindex":3,{"timestamp":1559104502838,"Channel0":0.01860327,"Channel1":-0.18750002,"Channel2":-0.18750002,"Channel3":0.18750000,"Channel4":0.18750000,"Channel5":0.18750000,"Channel6":0.00220245,"Channel7":-0.18750002,}]
    [{"sampleindex":4,{"timestamp":1559104502840,"Channel0":0.01852595,"Channel1":-0.18750002,"Channel2":-0.18750002,"Channel3":0.18750000,"Channel4":0.18750000,"Channel5":0.18750000,"Channel6":0.00219061,"Channel7":-0.18750002,}]
    [{"sampleindex":5,{"timestamp":1559104502841,"Channel0":0.01851290,"Channel1":-0.18750002,"Channel2":-0.18750002,"Channel3":0.18750000,"Channel4":0.18750000,"Channel5":0.18750000,"Channel6":0.00221025,"Channel7":-0.18750002,}]
  • wjcroftwjcroft Mount Shasta, CA
    I believe I mentioned on this or another thread that one expert you should consider contacting, is Alex Castillo. He is a wizard at the node.js access. I am not.
  • brownjonkentbrownjonkent United States
    Thanks William - I had reached out to him earlier, just hoping to get a reply back soon :)

    Thank you for all your guidance!!

    -Rishi
Sign In or Register to comment.