Eye Blink Sensing System- Working Principle

About Eye Blink Sensor

Eye blink Sensor

Eye blink Sensor is a relatively simple sensor used to detect eye blinks. It uses a simple infrared sensor to detect if the person’s eye is closed and the corresponding data received can further be processed by any logic as required for the application. 

The eye blink system comes with an IR sensor mounted on glasses which the user can wear like regular glasses, shown in the picture above.

Hardware Required

The eyeblink sensor system comes with two main pieces of hardware

  1. Glasses
  2. Infrared sensor

The infrared sensor is mounted on the glasses and positioned in a way so that it lines up with the user’s eye. The infrared then gives an output HIGH signal when the sensor detects a blink, that is the uses closes their eyes. The infrared sensor also has an onboard indicator LED to alert the user of the same.

Hardware Required for eye blink sensor

The onboard infrared sensor comes with three pins

  • VCC – 5V input
  • OUT – output based on blink detection
  • GND – ground connection

VCC and GND can be connected to the system and blink detection will be signaled using the onboard LED.

In case further logics are required to keep track of the duration of the blink, number of times blinked, etc. a microcontroller can easily be paired up with a system and an appropriate code can be written on the controller to record the above.

For cases such as the above, an OUT pin is given where the logic state can either be HIGH or LOW based on the blink state. The OUT pin can directly connected to any digital input pin of any microcontroller

Software Required

The software required to read the data from the eye blink system is very simple and straightforward. The code for the same done in Arduino IDE is given below.

For this sketch, we will be connecting the OUT pin of the eye blink sensor to pin 8 of the Arduino and printing on Serial if the eye is closed or not.

int eyeBlinkPin = 8; // connecting eye blink sensor to pin 8

int detectionState; // initializing detection variable

 

void setup()

{

    pinMode(eyeBlinkPin,INPUT); // setting eyeblink pin as INPUT

    Serial.begin(9600); // Initializing serial monitor with baud rate of 9600

}

 

void loop()

{

    detectionState = digitalRead(eyeBlinkPin); // saving the eye blink state to detection variable

    if (detectionState == HIGH) // check the detection variable is HIGH

    {

        Serial.println("Eye is closed"); // if true, print the following message on serial monitor

    }

    else {

        Serial.println("Eye is open"); // if false, print the following message on serial monitor

    }

    delay(50); // providing a delay of 50ms between each loop

}

Assembly of the Glasses

Assembly of the Glasses

They eyeblink system comes preassembled, but the onboard IR sensor can easily be taken off by gently pulling it slowly from its mounting holes. The glasses are pre-drilled from the factory and positioned in such a way that the IR sensor system has a clear view of the person’s eye and eye lid. 

Working Principle of the Eye blink Sensor

Working Principle of the Eye blink Sensor

The IR sensor works based on the principle of IR.

The onboard IR array contains two components, an IR Emitter and an IR Photodiode

The IR Emitter emits an IR light towards the eye. The IR Photodiode is designed to detect if the radiation of the same wavelength is reflected back and detected. If the eye is closed, the IR rays will reflect back with a larger intensity and the photodiode will detect it. If the eye is open, the IR rays will wither go into the eye or scatter across the eye thereby causing a very low intensity of reflected IR light. Therefore, by monitoring the Photodiode, we can come to a reasonable conclusion if the eye is indeed closed or not.

The module also comes with an onboard potentiometer which can be used to tune the sensitivity of the Photodiode.

Applications of the Eye Blink Sensor

Eye blink system can be used in variety of applications where the user attention needs to be monitored.

For example, it can be used while driving, so that an alarm or a notification can be sent if the driver’s eye is closed for more than 2 seconds.

Other applications, include scientific studies to measure fatigue or can be used for research purposes to count number of eyeblinks in various different situations.

Leave a comment

Please note, comments must be approved before they are published