Every year in the US, 40,000 motor accidents, of which 15,000 are fatal, are caused by microsleeping. Microsleeping is a process by which one closes their eyes for a few moments and the brain enters a sleep-like state. Unsurprisingly, this occurs most frequently when exposed to sleep deprivation and monotony, such as during long drives. However, the biggest issue with microsleeping is that the sufferer frequently does not realize that they are doing it.

In an attempt to make the roads safer, we used an OpenBCI electroencephalogram paired with an accompanying android app to inform drivers as to their state of wakefulness, and alert them when they enter a microsleep.


There are several markers of fatigue and drowsiness that can be detected by an electroencephalogram. The easiest to observe is in the frequency and duration of blinking. Stern et al. found that as fatigue increases, the rate of blinking increases by a factor of over 50%, and the duration for which they are held down is nearly doubled. By placing probes along the prefrontal cortex, we were able to find fluctuations of approximately 6µV representing the opening and closing of eyelids. The amplitude of these disturbances is great enough that we are able to detect blinks with roughly 85% accuracy. The other means for determining exhaustion is through the amplitude of alpha waves near the occipital cortex. By placing probes on the back of the skull, we can obtain a signal representing brain activity. Through the use of a Fourier Transform, we can find the amplitude of the component waves with frequencies between 9 and 13 Hz, representing alpha waves. While in an attentive state, the amplitude should be roughly 3µV, but while in a state of drowsiness or sleep, it will rise to approximately 10µV. Since beta waves (15-20Hz) do not change with fatigue, we may use the ratio of alpha to beta waves to detect microsleep.


All the data acquisition is done through the use of an OpenBCI EEG. It is then transmitted over the gazelle protocol to an FTDI chip, which is plugged into an android phone. All of the processing is then provided by the phone, which also has an interface for monitoring your status while on a trip, and the ability to store and retrieve data from a remote MongoDB instance.

Technical Challenges

Perhaps the most technically difficult aspect of our project was getting the phone to communicate with the OpenBCI. The OpenBCI may only communicate via the provided USB FTDI dongle. Android, however, does not have the required libraries to speak to this dongle. As such, we had to implement our own version of d2xx for android so that we could read data off of the device.

Built With

Share this project: