BetaFocus is a project that uses the Mindflex EEG toy from Mattel to measure concentration and visualize them in real-time.
The project is divided into two parts: the hardware, which consists of hacking the Mindflex toy and connecting it to a microcontroller, and the software part, which visualizes the attention data.
This README was written in German and English. If you want to see the German version, click hier or click the badge under the title.
- Buy a Mindflex EEG toy from Mattel. As they are not produced anymore, you need to get one from Ebay or similar platforms.
- Get a Microcontroller (Arduino Uno, Nano, etc.) with Bluetooth (not BLE!).
- (Optional) Get a 128x64 or 128x32 OLED Display with I2C interface.
- Follow our YouTube tutorial to hack the Mindflex toy and connect it to an Arduino: Extremly cool video
Unfortunately, the BetaFocus Device won't last a long time with a display, as the power supply of 4.5 V will reach the 3.3 V mark after 10 hours of usage, will . To maximize the battery life, it would be best to use the device without a display.
- Read the Arduino Readme and choose the right Arduino sketch.
- Upload the sketch to the microcontroller via Arduino IDE or PlatformIO (VS Code).
- Done!
Only tested with Python 3.8+. Tested on Windows 10, macOS and Ubuntu 22.04.
git clone https://github.com/visar77/BetaFocus.git
pip install pyserial pyqt5 pyqtgraph pyqtwebengine pandas
cd BetaFocus/BetaFocus/src
python3 main.py
For Ubuntu users this command might be also necessary:
sudo apt install pyqtwayland5
(Under development)
-
Go to Verbinden -> COM Port and select the COM port number
-
Stop the session by clicking on the red square
- Connect to the BetaFocus device via Bluetooth
- Select the correct port by trying out the available ports that are shown in the software (step 5 in the Windows 10 guide)
After a session has been stopped, you will see the time in seconds that you have concentrated (that means that the concentration value was over 40), the maximum concentration value and the concentration values over time with a regression line indicating the trend of the concentration values. Lastly a bottom graph shows the average concentration values of all sessions that have been recorded.
- Click on the "Statistik" button in the main window
- You will see a list of all sessions that have been recorded and a graph of the average concentration time of all sessions
- To see the data of a specific session, double-click on the session in the list
- To change the name of a session, write a valid name in the text field and click on "Fertig"
For more information on how to use the software, click on the question mark button in the main window on the top right. There you will find a detailed explanation of the software as a PDF.
It is unfortunately only available in German at the moment.
The science behind the Mindflex toy is based on the EEG technology. We explain the technology in our Info PDF, which can be accessed through the info button in the main window at the top left.
It is unfortunately only available in German at the moment.
Specifically thanks to the wonderful Limor Fried (Ladyada) for providing the open source software to control i2c and spi mini-displays.
Software License Agreement (BSD License)
Copyright (c) 2012, Adafruit Industries
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holders nor the
names of its contributors may be used to endorse or promote products
derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY
DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
The main inspiration for this project was the Frontier Nerds' blog about hacking EEG toys: https://frontiernerds.com/brain-hack.
It's a wonderful read, easy to follow and gives a lot of insight.
It's written by Eric Mika, a NYU alumni and current Creative Director of Local Projects (https://www.linkedin.com/in/emika/).
His Arduino Brain Library https://github.com/kitschpatrol/Brain also reads NeuroSky-EEG-Headsets and can be combined with BrainGrapher https://github.com/kitschpatrol/BrainGrapher to visualize the read values.
Thanks to Eric, we came up with this idea and expanded upon his hack.