PROJECT TEST DRIVE

ECE 4180 - Fall 2019 - Final Project
Project Members: Harrison Banh, Kristyn DiGiovanni, David Schnelle

Driver Attention Monitoring System:

Place two LEDs and buttons on the periphery of a computer monitor or steering wheel while the user operates either a driving simulator on the monitor or is driving the vehicle itself. When the MBED sends flashing signals to a random LED, the user should press the corresponding button. The time between the flash sequence and the button press will be tracked, as well as the accuracy button presses. If accuracy or reaction speed deteriorates play an audible to alert the driver to their loss of attention.

Motivation:

With the advent of advanced driver assist technologies in cars manufacturers have discovered that they must ensure the vehicle can detect if the driver is still attentive to the task of driving. After the failure of Tesla’s steering wheel torque system, other manufacturers such as Cadillac have adopted in car cameras to track the driver’s pupillary movement. Unfortunately, this system, while effective, raises serious privacy concerns for motorists as in order to fully use the vehicle they must submit to being recorded in an environment normally considered at least somewhat private. This system is a continuous evaluation of the driver’s ability to process and react to information presented in the fields of view they must focus on in order to drive safely.

Demonstration

Block Diagram and Pin/Out

Full Block Diagram
http://mbed.org/media/uploads/kristyn1230/block_diagram.png

mbedTPA2005D1SpeakerLEDsPush Buttons
gndpwr - (gnd), in -Left - , Right -
Vout (3.3V)pwr +Left Button + in Series with 10kOhm Resistor, Right Button + in Series with 10kOhm Resistor
p25in +
out++
out--
p21Left + in Series with 330Ohm Resistor
p22Right + in Series with 330Ohm Resistor
p26Left Button -
p27Right Button -

Components

The following are the components used in this system with links to corresponding MBED Handbook/Notebook pages:

Main Program

Functionality:
The first thing to occur is the training period. This measures the average reaction time of the first 5 valid button presses and uses that as a baseline. The speaker sounds a 1000 Hz sound for half a second to indicate to the user that the training period is done. From then on, the user's reaction times are averaged based on the last 5 (WINDOW_SIZE variable) valid attempts. If this current average is less than 1.25 times (WEIGHT variable) the baseline an alarm is sounded to ensure the user realizes the loss of attention. Once the average builds back up, the alarm sound turns off. A count of incorrect button presses or timeouts is also kept track of to calculate and print out an accuracy onto the serial monitor.

PinDetect:
Since timing and number of button presses is important to the functionality of the program, Pin Detect was utilized to debounce the pushbuttons and create callback functions to tell the program exactly when and which button was pressed.

MBED RTOS:
The MTED RTOS is used to create threads that execute different program functionalities: the main thread determines the accuracy of button presses and prints the outputs to the Serial Monitor; the flash thread chooses which LED to light up, calculates reaction time averages, and starts timers; and the sound thread turns on/off the speaker depending on the relationship of the current average reaction time and the baseline.
For more information about MBED RTOS follow this link: MBED RTOS Handbook

Timers:
Timers were used to keep track of reaction times. They were started during the flash sequence and stopped in push button callback or timeout routines.
For more information about timers follow this link: Timer Handbook

Import program4180_FinalProject_DeploymentVersion

Deployment Version of the Project Test Drive Project application. It is a driver attention/awareness program that can be implemented in a vehicle to measure accuracy and attention times of the user. It alerts when the user goes below a threshold minimum using a speaker.

Import program4180_FinalProject_DemoVersion

Demo Code version of the Project Test Drive.

Import libraryPinDetect

InterruptIn style DigitalIn debounced with callbacks for pin state change and pin state hold.

Import librarymbed-rtos

Official mbed Real Time Operating System based on the RTX implementation of the CMSIS-RTOS API open standard.


Please log in to post comments.