mindflex hack issues

Gday, im trying to code a mindflex with an Arduino to control an rc car with another Arduino however I’ve ran into a problem, for whatever reason im not receiving any serial code back on my computer when I hook the Arduino and mindflex up. I used to receive one line of code every second this line was consisted of 10 numbers which are attention, meditation, delta, theta, low alpha, high alpha, low beta , high beta, low gemma, high gemma. I am no longer receiving code im wondering why this might be, the code has worked before and I don’t think the mindflex is faulty however im not sure how to actually check. And yes tx is wired and connected to Rx properly. Im not the author of the code

(please be kind im new at coding and using arduinos)

url of the code:

// Arduino Brain Library - Brain Serial Test
 
// Description: Grabs brain data from the serial RX pin and sends CSV out over the TX pin (Half duplex.)
// More info: https://github.com/kitschpatrol/Arduino-Brain-Library
// Author: Eric Mika, 2010 revised in 2014
 
#include <Brain.h>
 
// Set up the brain parser, pass it the hardware serial object you want to listen on.
Brain brain(Serial);
 
void setup() {
	// Start the hardware serial.
    Serial.begin(9600);
}
 
void loop() {
	// Expect packets about once per second.
	// The .readCSV() function returns a string (well, char*) listing the most recent brain data, in the following format:
	// "signal strength, attention, meditation, delta, theta, low alpha, high alpha, low beta, high beta, low gamma, high gamma"   
	if (brain.update()) {
  	  Serial.println(brain.readErrors());
        Serial.println(brain.readCSV());
	}
}

Here’s the URL for the Mindflex:

and the library included to make it work, also here’s the URL I got the library from: How to Hack Toy EEGs | Frontier Nerds

#ifndef Brain_h
#define Brain_h

#include "Arduino.h"

#define MAX_PACKET_LENGTH 32
#define EEG_POWER_BANDS 8

class Brain {
    public:
        Brain(Stream &_brainStream);    

        // Run this in the main loop.
        boolean update();

        // String with most recent error.
        char* readErrors();

        // Returns comme-delimited string of all available brain data.
        // Sequence is as below.
        char* readCSV();

        // Individual pieces of brain data.
        uint8_t readSignalQuality();
        uint8_t readAttention();
        uint8_t readMeditation();
        uint32_t* readPowerArray();
        uint32_t readDelta();
        uint32_t readTheta();
        uint32_t readLowAlpha();
        uint32_t readHighAlpha();
        uint32_t readLowBeta();
        uint32_t readHighBeta();
        uint32_t readLowGamma();
        uint32_t readMidGamma();
        
    private:
        Stream* brainStream;        
        uint8_t packetData[MAX_PACKET_LENGTH];
        boolean inPacket;
        uint8_t latestByte;
        uint8_t lastByte;
        uint8_t packetIndex;
        uint8_t packetLength;
        uint8_t checksum;
        uint8_t checksumAccumulator;
        uint8_t eegPowerLength;
        boolean hasPower;
        void clearPacket();
        void clearEegPower();
        boolean parsePacket();
        
        void printPacket();
        void init();
        void printCSV(); // maybe should be public?      
        void printDebug();

        // With current hardware, at most we would have...
        // 3 x 3 char uint8_t
        // 8 x 10 char uint32_t
        // 10 x 1 char commas
        // 1 x 1 char 0 (string termination)
        // -------------------------
        // 100 characters       
        char csvBuffer[100];
        
        // Longest error is
        // 22 x 1 char uint8_ts
        // 1 x 1 char 0 (string termination)
        char latestError[23];       
        
        uint8_t signalQuality;
        uint8_t attention;
        uint8_t meditation;

        boolean freshPacket;
        
        // Lighter to just make this public, instead of using the getter?
        uint32_t eegPower[EEG_POWER_BANDS];
};

#endif

I've done the same hack and initially used the same test code to receive data from the Mindflex.
You say you were previously receiving data without problems, so it must be a hardware problem, not firmware. The code you're using is the standard example "BrainSerialTest" example, which should work fine.

Double-check that your connections are OK, and that you don't have a short anywhere, particularly where your wires are attached to the "T" and ground terminals on the TGAM1 board in the headset.

I assume that you've tried new batteries in the headset?

thanks for the reply,

my mindflex is transmitting data again i think one of the wires must have come lose or been brocken, you're saying that you've done this hack before what did you use it for and did it work?
im trying to control an rc car using the mindflex.

imAstudent:
thanks for the reply,

my mindflex is transmitting data again i think one of the wires must have come lose or been brocken, you're saying that you've done this hack before what did you use it for and did it work?
im trying to control an rc car using the mindflex.

Don't expect too much from it. My basic plan was to simply control the speed of a DC motor for starters with the 'Attention' data, but I could never get it under control. It didn't seem to matter how much I concentrated or relaxed, the 'Attention' values were in a world of their own. Same with the 'Meditation' values.

I spent many hours using the 'Brain' library to send values to the serial monitor, but gave it up as useless in the end. Maybe it was just me, so see how you go, but as I say, don't get your hopes up too much.

One point, ensure that the mains filter is correct for your location. I'm in Australia and bought my headsets from the US, so had to change the filter from 60Hz to 50Hz before I got reliable data. I also had to use ECG gel to get a constant, good connection between the forehead electrode and my skin.

Another thing to keep in mind is that whenever the 'Poor Signal' level goes above 26, the headset will just continue to repeat the last valid data. That could be a problem when controlling a motor. It'd be better if the headset just sent 0 for 'Attention' and 'Meditation' when the signal is weak, but they set them up to appear to still be working when playing the game.

Hopefully you'll have more luck than I did. I'd advise that you do the same as me - get lots of practice just sending the values to the serial monitor before doing anything more complex, and see if you can get good control over it.