DEV Community

Paula
Paula

Posted on

Use the force, Luke

There are certain things in computer science that remind us of cyberpunk, and certainly mind-reading tech is one of the most cyberpunk things that I have found. Let me explain: There's a toy called Mindflex which is very easy to hack using arduino, so you can read certain mind waves and use them in C code. I tend to specialize in security... But this is a lot of fun.

The hardware of the mindflex has an EGG chip, a radio transmitter and a microcontroller. The hack consist in link the EGG chip with the arduino using some soldering abilities and using the library "Brain" for arduino, which will allow us to play with it. To do this, is as easy as removing the plastic cover of the head device, creating a hole on it for later, soldering what we need, put the cover again passing the cables through the hole and connecting the arduino. Before putting the cover again and all, I suggest to try the device, and see if the soldering is right. The soldering should go like this:

The soldering goes into a T labeled pin and the ground (the pic is not mine, But I did the same). Once we have the hardware checked, we should start studying the Brain arduino library. This is one of the basics example codes:

#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.readCSV());
        }
}

Enter fullscreen mode Exit fullscreen mode

This will basically show the data of the different mind waves read, printing them in the Serial. The mindflex basically reads the concentration (read with Yoda voice) if the force strong is on you and this is the measure you should take care of:

Delta (1-3Hz): sleep
Theta (4-7Hz): relaxed, meditative
Low Alpha (8-9Hz): eyes closed, relaxed
High Alpha (10-12Hz)
Low Beta (13-17Hz): alert, focused
High Beta (18-30Hz)
Low Gamma (31-40Hz): multi-sensory processing
High Gamma (41-50Hz)

But this is a toy, after all, and it doesn't work perfectly. I'm trying to experiment a mixture of arduino, python, bash and openssl to make it work with randomness in algorithms and other geeky stuff. But in the future it could lead to help with prosthesis movements or VR-controlling. Future seems very cyberpunk!

Top comments (0)