The ideal non-invasive brain computer interface (BCI) transforms signals originating from human brain into commands that can control devices and applications. Hence, BCI provides a way for brain output that does not involve neuromuscular system. This represents an advantage for those individuals suffering from neuromuscular impairments such as Amyotrophic Lateral Sclerosis (ALS) or various types of paralysis. In this study we propose to design a new noninvasive BCI that is based on optical means to measure brain activity by monitoring hemodynamic response. The proposed system uses functional near infrared (fNIR) spectroscopy to detect cognitive activity from prefrontal cortex elicited voluntarily by performing a mental task namely N-back test. Our findings indicate that fNIR signal correlates with cognitive tasks associated with working memory. These experimental outcomes compare favorably with previous functional magnetic resonance imaging (fMRI) and complement electroencephalogram (EEG) findings. Since fNIR can be implemented in the form of a wearable and minimally intrusive device, it also has the capacity to monitor brain activity under real life conditions in everyday environments leading the way to potential applications of fNIR in BCI development for communication and entertainment purposes.