Intro
The button on the Raspberry Pi (RPi) - Electrical Assembly can be pushed to trigger an infinite loop in the RPi, which constantly collects brainwave data from the Muse 2 device. The raw data from the frontal lobe is preprocessed as follow: *FFT > Averaging the magnitudes in the α and β regions > getting the β:α ratio > averaging the β:α from the frontal lobe channels. * When the β:α ratio is below a certain threshold a certain number of times (signifying inattentiveness), the RPi produces an annoying beep sound to alert the driver to stay awake until the β:α ratio is above the threshold.
Libraries
Libraries used to connect and collect data from the Muse 2 were uvicmuse, pylsl, pygatt, and asyncio. To process the raw EEG data from the Muse 2, Numpy was used and to visualize the data, matplotlib was used. Finally, the interaction between python and the pins on the RPi was coded using RPi.GPIO.
Verification
Stay Awake Offline (SAO) has verified the focused and unfocused states through Moto Road Rash 3D. When the player is engaged and driving, the beeping sound is successfully suppressed. Conversely, when the player is inattentive, the beeping sound is activated.

Log in or sign up for Devpost to join the conversation.