ARM Controller and EEG Based Drowsiness Tracking and Controlling during Driving

ABSTRACT


INTRODUCTION
Driving is a complex task, requiring full concentration and a calm attitude. Stressed and strong emotions, whether they result from the driving task itself or unrelated matters, can affect a driver's abilities. For example, research has shown that angry drivers are more likely to take risks such as speeding, rapidly switching lanes, tailgating and jumping red lights. EEG signal can be one of the features of BCI for detecting driver's state of mind.
The main objective of this paper is to study the different mental state recognition methods based on EEG signals. Later work can be done on analyzing different mental states of a driver in different traffic situation and based on the study, predicting whether driver is mentally fit or not. In recent past, it has been observed that drivers with mental fatigue lead to accident. In this proposol, we proposed a robust real-time embedded platform to monitor the loss of attention of the driver during day and night driving conditions. The alertness level can be measured by using different parameters, such as electro encephalogram (EEG) signals, visual features, blood samples, speech and others. The EEG-based method has been reported to be highly authentic for estimating the state of drowsiness. In a new method for multi fractal analysis of EEG signals named generalized Higuchi fractal dimension spectrum (GHFDS) was proposed and applied in mental arithmetic task recognition from EEG signals.

PROPOSED BLOCK DIAGRAM
The above block diagram shows the control of vehicle through ARM Controller, it identifies the drowsiness while driving and also it detects the obstacles near to the vehicle. Figure 1 shows BCI-attention tracking. It consists of two sections, i.e. (a) design and implementation and (b) system hardware using ARM Processor.

Design and Implementation
Electroencephalography (EEG) is the measurement of electrical activity in the living brain. In this project we used a brainwave sensor MW001 to analyze the EEG signals. This design discuss about processing and recording the raw EEG signal from the sensor MW001 in the MATLAB environment and through Serial transmission control commands will be passed to the voice chip. This MW001 sensor is not used for medical purpose, but it is used to measure neurons feedback. The Brain control interface is a direct communication pathway between the brain and an external device.

Working Principle
The principle of operation is quite simple. It consists of two dry sensors are detect and filters the EEG signals. The sensor tip detects electrical signals from the forehead of the brain. At the same time, the sensor picks up ambient noise generated by human muscle, computers, light bulbs, electrical sockets and other electrical devices. The sensor and ear clip picks up the information from grounds and reference, which allows think gear chip to filter out the electrical noise. The device measures the raw signal, power spectrum (alpha, beta, delta, gamma, theta), attention level, mediation level and blink detection. For every clock frequency of 512 Hz, it receives the raw data from EEG. Other measured values are made every second. Therefore, raw EEG data is a main source of information on EEG signals using Mind Wave MW001.

Matlab Based Design Theory
The MATLAB allows including thinkgear.dll. This environment has broad support in toolbox, which makes it ideal for a scientific research. This paper presents how recording and processing the raw EEG signal in MATLAB environment using Mind Wave sensor. a system of digital rules for message exchange between MATLAB environment and Mind Wave MW001 device is processing through communications protocol. This section also presents the main parameters of think gear library.

The Communications Protocol
It consists of 7 basic steps, which are presented in following steps. Load Think Gear library into MATLAB Get a connection ID handle to Think Gear Attempt to connect the connection ID handle to serial port "COMx" Waiting to establish the connection Read packets from the connection Close the connection Unload Think Gear library In the first step are functions with parameters in the following order  The value -1 is returned if too many connections have been created. Select Connection ID, number of the serial port, Baud rate and type of data from the TG connect. The number of the serial port is given during the pairing of the device. The device can connect on modes 1200, 2400, 4800, 9600, 57600 and 115200 bits per second (bps). Here, we use the 9600 bps rate and stream 5V RAW mode, because these parameters have the minimum of transmission errors.

System Hardware LPC2148 Processor
In this paper it uses LPC2148 processor, is belongs to one of the family of ARM7. This processor employs the pipeline architecture, hence data processing and memory operations are executing parallel, it reduces the execution time.
It consists of two instruction sets.  Standard 32-bit ARMv5TE set  16-bit THUMB set

Thinkgear Asic Module
 It is used to interface the dry electrode, One EEG channel with three contacts namely EEG, REF, and GND.  Improper fit detected through "Poor Signal Quality" warning from ASIC to reset if off the head for four consecutive seconds, or if it is receiving a poor signal for seven consecutive seconds.  It is applicable for low power consumption devices.  Max power consumption 15mA @ 3.3 V  Raw EEG data output at 512 bits per second.

DC Motor
A motor consists of a rotor and a permanent magnetic field stator. The magnetic field is maintained using either permanent magnets or electromagnetic windings. Motors are the devices that provide the actual speed and torque in a drive system. This family includes AC motor types (single and multiphase motors, universal, servo motors, induction, synchronous, and gear motor) and DC motors (brush less, servo motor, and gear motor) as well as linear, stepper and air motors, and motor contactors and starters.

Ultrasonic Sensor
Ultra Sonic Sensor Our ultrasonic range finder is capable of allowing the user to determine his or her distance from an object or wall. It is used to identify the obstacle, nearer to vehicle while driving.

SYSTEM SOFTWARE
Using MATLAB's GUIDE, the processes of laying out a GUI (i.e., its buttons, pop-up menus, etc.) and programming the operation of the GUI are divided conveniently into two easily managed and relatively independent tasks.

Role of Matlab in BCI
The MATLAB allows including thinkgear.dll. This environment has broad support in toolbox, which makes it ideal for a scientific research. This paper presents how recording and processing the raw EEG signal in MATLAB environment using Mind Wave sensor. The Communication Protocol shows a system of The Communication Protocol, shows a system of digital rules for message exchange between MATLAB environment and Mind Wave MW001 device. This section also presents the main parameters of thinkgear library. The connection is established through command: calllib ('Thinkgear ','TG_ Connect', Id, ComPortName,TG_BAUD_115200,TG_ STR EAM _5VRAW). In the next step, we must attempt to read a Packet of data from the connection. We use the TG_Read Packets () function with ID parameter and number of packet to read. The command calllib ('Thinkgear','TG_ReadPackets', Id, 1). Figure 2 shows Brian signal representation in MATLAB.

Figure 2. Brian signal representation in MATLAB
The above graph representation includes the attention value and blink strength. Based on this signals device control file will be opened and the device will get controlled based on the brain signals.

ANALYSIS OF HARDWARE SECTION
ARM Controller read the value of raw EEG signal with the maximum frequency of 512 Hz. Sampling frequency is set on 512 Hz, and we control time delays in sampling. The value of the signal and time are written to the array data.The data which are stored in array will be compared with the threshold points given by the user. In this Paper, the Matlab section waits for three consecutive blink in order to send the hardware activation signal. Then based on the blink level signal, the cursor will be places upon any section to get the device control. Further the person has to raise the attention to switch the device. Figure 3 shows Brain wave signal identification in Matlab. Figure 4 shows Drowsiness identification through Matlab

CONCLUSION
The main goal of this paper is to design and implement a human thought controlled electrical switching system using BCI technology for the physically challenged people. Non invasive BCI method is used for capturing the brain signals with the help of brain wave sensor. Different cognitive state of the user like attention level, meditation level, and eye-blink can be used to measure the human thought. The signals are classified according their respective frequencies ranging from 0.5 Hz to 30 Hz. By setting the threshold value for an event, the interrupt is generated. This Interrupt is sent to the microcontroller unit for operating the appliances.