TGAM (brainwave sensor) + Arduino development programming guide from Dr.Li Pingxuan

The TGAM is NeuroSky’s primary brainwave sensor ASIC module designed for mass market applications. The TGAM processes and outputs EEG frequency spectrums, EEG signal quality, raw EEG, and three NeuroSky eSense meters attention; meditation; and eyeblinks. With simple dry electrodes, this module is excellent for use in toys, video games, and wellness devices because of its low power consumption, which is suitable for portable battery-driven applications.

1.

One HC-05 Bluetooth module (to be used as master Bluetooth).

A set of TGAM kits, the kits come with their own slave Bluetooth.

A number of lead wires

2.

HC-05 is a master-slave Bluetooth module, HC-05 and Arduino can be connected

The Arduino board is connected to the HC-05 chip as follows.

Here Pin10 and Pin11 pins are interchangeable but correspond to SoftwareSerial(rxPin, txPin) in the program. rxPin is the soft serial receive pin and txPin is the soft serial send pin to ensure that the MCU sends to the chip to receive and the MCU receives to the chip to send.

EN/KEY is connected to 3.3V in order to initialize the command with AT+INIT, this command can only be used when the EN/KEY pin is set high. Only after it has been initialized can you search for other Bluetooth devices with AT+INQ.

We do not need to touch the Serial. begin baud rate in the program, it is a different concept from the baud rate when pairing the HC-05 with other Bluetooth modules for transmission, the baud rate here is only the baud rate used by Arduino to write commands to the HC-05, it does not affect the pairing.

The HC-05 has two modes of operation, normal mode and AT mode. After preparing the program and plugging in the cable, I pressed the small black button in the corner of the HC-05 module and powered up the Arduino development board.

3. Write to AT command

the pairing passwords to be the same.

the baud rate of the serial ports of the two Bluetooth modules to be the same.

The master module finds the slave module address

According to the official api given by Thinkgear, the default password of TGAM is 0000 and baud rate is 57600; we need to set the password and baud rate of HC-05 to this in order to pair.

4.

Turn on the Arduino serial monitor, select NL and CR, set the baud rate to 38400, you will see the display shows BT is ready

If send an AT at this point, it will reply OK and you are ready to configure the HC-05 Bluetooth chip. Here the first time I send an AT the program always returns ERROR, and only when I send it again does it show OK

5.

Next, disconnect the Arduino board and remove the wires from the HC-05 KEY pin, when plugged in again it will return to the HC-05 working mode, while the two Bluetooth modules will still match automatically.

when the two Bluetooth are successfully connected, the serial monitor may suddenly pop up a lot of garbled code, affecting the connection status, you can directly observe the two Bluetooth chip indicator statuses to determine whether the connection is successful.

6.Finally

Once connected, we can program the Arduino to read the data from the brainwave sensor.