Pomodoro X BCIs 🍅
Taking the Pomodoro Technique to the next level with BCIs
I love the Pomodoro technique.
It’s great for deep focus in short time intervals! 25 minutes of focusing with 5 minute breaks in between. For each focusing period, you work on a single task. After 4 focusing periods, there’s a long break. Rinse and repeat!
It’s scientifically proven that human attention starts tapering off following the 25–30 minute mark. Taking a little break in between gives you some time to recover and then get back to it! But the Pomodoro alone isn’t enough to induce INTENSE focus.
I wanted to superpower the Pomodoro 💪
I noticed that there were times in the focusing period when I was still pretty distracted, daydreaming or jumping onto social media. I’m sure you all know the feeling of wanting to focus but then suddenly getting distracted by funny cat videos or meme pages. Maybe it’s a matter of discipline, but being able to control my focus would be phenomenal!
Using brain computer interfaces, we can track the level of focus! Read on to learn how I used the Muse headset to superpower the Pomodoro 😉
But first, how do we track focus?
The Muse headset and other BCIs work by detecting EEG brainwaves in the form of electric signals (read more about EEGs here). Depending on our state of consciousness, our brain emits a different frequency of waves.
As you can see, there’s a bunch of different types of brainwaves. Alpha and beta are emitted in a focused state while delta and theta are from a sleeping or meditation state 🧘
If we want to track focus, we should determine whether the brain is emitting alpha or beta waves, and their intensities! The higher the intensity of those waves, the more focused you are.
Great! So now that we understand the neuroscience, let’s figure out how we can actually implement the idea!
Streaming the Brainwaves
From the Muse headset, I’ll be using Muse Direct to stream the EEG data to a python program.
When I connect my Muse to the computer through Bluetooth, it’ll show up in the Muse Direct window!
Then, we’ll set our IP 🏠 to be 127.0.0.1 and our UDP port to be 6082. This gives us a channel to allow us to send the data between local programs (learn more in-depth about how it works here)!
Receiving the Brainwaves
Now, I’ll be talking about how the code works!
I’ll be simplifying a bit, so if you want to see the whole thing, check out the GitHub here.
I used the socket package to receive the OSC stream. We declare the IP and UDP port, create the socket, and bind them together!
Processing the Brainwaves
Now, when we get the data, it’s not neatly laid out for us in a list! It’s actually in string format and separated by a series of commas and x’s. So, we’ll have to remove those! ❌
It’s also in hexadecimal, so we’ll have to convert it to decimal with a hexadecimal converter! You can just grab one off the Internet or Stack Overflow 😃
After converting to decimal, we’ll take the average of the entire list to determine the intensity! However, we have to make sure that the values aren’t corrupt (which can often be the case due to noise).
Awesome!! Now that we can determine the intensity of these brainwaves, let’s create the superpowered Pomodoro program!
Phase 1: Calibration
Before we start the Pomodoro cycle, we’ll have to calibrate the focus measure to the specific person’s focus levels! To do this, we’ll calculate the intensity of their alpha waves for 30 seconds while they’re closing their eyes and focusing.
Phase 2: Let’s go Pomo!
After the calibration, we can start the Pomodoro cycles! I asked the user for their preferences on the length of focus times, break times, and the number of focus sessions in a cycle!
We loop through the number of sessions and every 10 seconds, we measure the user’s focus! I set the metric to qualify as “focused” if their focus was at least 80% of their baseline, “semi-focused” if it was between 50% and 80%, and “distracted” if it was below “50%”. If so, a “beep” will play, reminding them to GET BACK TO WORK! 📁
After the focus session, we’ll break out of the loop! After pausing the program for a break, we’ll start the session again. After all the sessions have completed, the program will complete! Happy Pomodoro! 🍅
To take a look at the whole program, check out the GitHub here.
This is sickkkk!!! With BCIs, we can measure and manipulate the state of the human brain! Not only can they help with focus, but they’re also widely used to help disabled individuals control their robotic arms and legs! Not to mention a bunch of other medical applications to empower patients! 💪
In the future, we’ll see many more applications in BCIs fundamentally changing the ways we live our lives. Communication with brainwaves, telekinesis, downloadable skills, and even computing with the brain are far-fetched but possible implications of this amazing technology!
What about focus? Imagine a device that not only tracks your focus but actually induces focus in your brain 🤯 We’d be able to focus for hours on end without getting distracted and be at the epitome of productivity!
But for now, just enjoy your amazing Pomodoro sessions and superpowered focus :)
I hope you enjoyed this article! If you liked it, please connect with me on LinkedIn and follow me! 👋 Have a good one! 😃😁