have new Ganglion, want to develop custom firmware for feedback

edited November 2018 in Ganglion
Im glad my github name was available here.


I tried building a circuit similar to the ganglion and it was a little too difficult but all my files are there. I learned a little along the way though. I recently purchased a Ganglion and I have some ideas to try with it.  I am also a diagnosed schizophrenic. My mother was a schizophrenic so I guess I'm second generation. I'm an avid meditator with some interesting ideas there too. I got my Ganglion the other day it fit pretty good in an acrylic playing card box. A 3.7v rechargeable battery fits in there too. I Pierced both ears to use for grounds. I also shaved my head and tattooed dots for the 10-20 system on it. Just an example of how crazy I am. I was listening to the birds singing and I noticed that I didn't hear any of them far away. They were all near the house...

I need to write firmware that has 2 maybe 3 modes. I need a button to switch modes.

Mode 1 analuzes the data and toggles an io pin to beep a buzzer to signal certain states for meditation and stuff. I  guess I would need to do fourier transform to analyze the frequency.
Mode 2 will do logging to the sd card.
Mode 3 will do bluetooth, but I don't need this one yet.

I haven't dug into the code yet but I noticed the simblee is arm cortex m0. It's much more fun if you have help doing stuff. I guess the first thing I would need to get started is some similar example code

Comments

  • wjcroftwjcroft Mount Shasta, CA
    Hi, Logical,

    Have you experimented with your Ganglion, such as with the tutorial steps?


    The best approach is usually to use the Ganglion or Cyton as an EEG data collection device that sends to a laptop. Then do your analysis or feedback from the laptop. There is much more EEG signal processing software available on the laptop. Here is one example laptop program that is widely used in neurofeedback applications, and works with Ganglion and Cyton.


    It is possible to write custom firmware for both OpenBCI boards, but you would get faster and easier results with running your feedback on the laptop.

    Regards,

    William

  • edited November 2018
    I was hoping to do mobile readings. With the box as small as it is you can cover your electrodes with a hoodie or whatever and put the box in your pocket.

    I'll be honest. I'm paranoid about cellphones ,and wifi and other things too.

    I also noticed that the sd card stores data in an ascii hexadecimal format but binary would be 1/2 the size. I have been alone for a long time now and spent a lot of time meditating. I have some interesting experiences I would like to discuss maybe in private if possible. It's  not a game.

    Last night I found out you add:

    #define ARM_MATH_CM0
    #include <arm_math.h>

    to  your arduino code you can use the CMSIS  library. awesome. I haven't tried the default firmware on the board. I would like to have the source code for it before I overwrite it.

    No pinhead jokes about the tattoos...
  • I started a github repository for the firmware i described.


    It would be great if anyone would look and comment.I will update it later. I'm going to try to use the CMSIS library to do an fft and analyze the frequency components and trigger a beeper connected to an io pin. My math is not great but I'll try. I noticed a ring buffer used for the data in the ganglion code. I was looking at trying to use the compression_ring array as a data set for an fft or whatever. If anyone wants to join in you are welcome.

    Also i got some ball electrodes in the mail today.

    image
    They too big for EEG.I could not find the size anywhere online .They are almost 3/4" cups.Maybe good for other stuff.
  • wjcroftwjcroft Mount Shasta, CA
    Logical, hi.

    re: mobile readings. The EEG electrodes and cables are extremely sensitive to movement. So generally do not work when in motion. You need to be relatively motionless for optimal EEG with little noise / artifacts.

    re: SD card on Ganglion. This is not supported in the firmware due to hardware restrictions of the Simblee processor discovered only after the SD card was initially tested. There are more details here,


    The Simblee processor is somewhat underpowered for FFT analysis and signal processing. It devotes most of it's cycles to handling the Bluetooth radio protocols.

    Regards,

    William
  • wjcroftwjcroft Mount Shasta, CA
    The electrode photo you showed, those are for ECG. But even then, this type is rarely used, perhaps in China. Normal ECG electrodes are foam stick-on.


  • What the hell is it good for then?

    I'm going to say you are  mistaken so I don't believe you are cheating all these people. It's one thing for a guy to think that this device can read his his mind and another thing for him to think it's an actual eeg device.

    You have to get 2x the maximum frequency for the nyquist sample rate. I've done some pretty good stuff on processors with similar specifications.

    You can find arduinos writing to an sd card all over the web but you can't get your device to do it? I thought I get the firmware going in a few days but I assumed your device was working.


    Your messing with me right?
  • This is totally undermining my faith in open source hardware. You rushed this out right?

    The joke here is that I have tattoos on my head...
  • wjcroftwjcroft Mount Shasta, CA
    As I've said, you will find it much easier to do your signal processing and neurofeedback on the laptop or Android mobile. You can go ahead and write your own firmware, but may find there are CPU processor power limitations as to how much signal processing can be done and still service the Bluetooth radio processes. On the Cyton and Wifi Shield, separate microcontrollers handle the radio traffic. On Ganglion, the Simblee must do everything.

    Using a simple 'buzzer' as you mentioned for neurofeedback, is a sort of a jarring and binary on/off way of providing feedback. If instead you did your feedback on a laptop or Android mobile, you could provide more subtle forms of feedback, such as volume control of an audio track, fade-in / fade-out of various other tracks, midi instrument tones, etc. In conventional neurofeedback, these subtle forms of feedback are predominantly used, instead of buzzers. The BioEra app I mentioned can do all of this without any programming, and is used by many neurofeedback companies and practitioners. 

    We're sorry about the SD card situation, but you can read the details on the above link. The Simblee processor has limitations.

    Another caution with the buzzer approach, is that EEG uses microvolt level signals. And can easily pick up noise from cables that are drawing significant current. Not sure if a piezo buzzer would be in that category. But you could find that noise pulses from the piezo get into your EEG signals.

    This is the main reason why Cyton and Ganglion send the EEG data over the air to another computer for signal processing.

    More on how to read the data from Android:


    Regards,

    William

  • edited November 2018

    just a glance at your code and i'm wondering if you are using hardware or software SPI because the spi runs at 4Mbps so I assume the bottleneck is the sd card. You schematic says "seeed microsd". I found a schematic for the controller on seeed but the controller chip isn't labeled. If the speed of the controller was high enough I would think you could just send it fast enough in between samples.

    Your wrist watch has a piezo buzzer they are very low current. I just want a tiny beep I barely notice. maybe several different sounds even.


  • I'll try shielding the electrode leads.

    Has anyone else noticed any witchcraft? Nothing against anyone's religion, just malicious spirituality let's say.

    My internet is being spoofed and I'm harassed when I leave my house. I've complained to my ISP and they pretty much laughed. I've written senators and the governor. etc. etc. The funny thing is when I went to chat roulette and half the people were making fun of me like they knew me. I'm sure they are messing with my phone too. I got kicked off a dating site for no reason. I've tried wearing a body camera to prove it.

    I am flattered.

    Oh, never mind...

    I think you are messing with me and I'm going to try the firmware.
  • wjcroftwjcroft Mount Shasta, CA
    re: "I think you are messing with me"

    No, I'm just speaking from a lot of experience with EEG and neurofeedback. Your first priority should be to go through the Ganglion tutorial and see what your signals look like. Both sitting and moving. See how practical is "mobile EEG". Check your generation of alpha with eyes closed. Play with the Focus widget. I assume you have cup electrodes and paste. In your case with a shaved head, you could also use foam ECG electrodes on your head.

    You have to walk before you can run.  :-)

    The EASIEST way to approach neurofeedback is with what is called a VPL, Visual Programming Language, such as the BioEra I mentioned previously. The processing blocks are drawn on the screen and represent the signal processing flow, thresholds, feedback elements. All of this can be done in an afternoon, vs. many days, possibly weeks if you are writing your own firmware. 

    A free VPL is BrainBay, which does work with Ganglion. There is a Cyton BrainBay tutorial here,


    By switching a couple element blocks you can adapt this for Ganglion.

    Another VPL that is available is OpenViBE.

    Regards,

    William

  • Thank you for your help. One last question. Does anyone know of a device like an "event time recorder". I don't know what it would be called. you push a button when something happens and it records the time.
  • wjcroftwjcroft Mount Shasta, CA
    In EEG data collection, this is usually called "external trigger", where a button press or other event is recorded simultaneously with the EEG data.

    Both Ganglion and Cyton have what are called Aux channels, to record this type of event. Here is a thread mentioning how it is done. In the context of a different sensor for heart rate. But same idea applies. In this thread they are using analog pins, but I think some digital pins are exposed as well.


    William

  • ok. thank you.
Sign In or Register to comment.