Eye blink sensor

I have Motor Neuron Disease (MND ALS)
I am trying to write a script for a infrared sensor using TCRT5000L IR.
I want the sensor to detect my eye blink and click the left mouse button on the screen.
This will be both single click and double.
I will attach a second sensor to my right eye for the right click.

I am totally paralyzed and on a ventilator and rely on my computer access.

Thank You Fleck

You need to get the sensor wired up and mounted to find out what signal you get when you blink ( if any ?).
The sensor is intended to be close up to a reflective surface.
When you know this you can see how to interface it .

Hi,
so what you're thinking about is a kind of eye mouse using an Arduino to convert the IR sensors output to left and right click via usb to control a pc? Please don't take this the wrong way but I'm pretty sure this kind of stuff already exists so why try build your own? I could speak to the right people up at The Royal Hospital for Neuro-disabilities in Putney and see what they have used(I'm a regular visitor to the place). I, and I'm sure a lot of other people on this forum, will give you as much help as we can.

Thanks very much for prompt replies.
I have in a number of devices including Natural Point Smart Nav and Tobii eye gaze.
However it is the mouse click that is important for software that I use for my 3D printing (Autocad)
I have some code that i have been playing about with but it keeps returning a message
Why does it keep returning this error

' leftClick' was not declared in this scope

This is the code

void setup() {
Serial.begin(9600);
pinMode(8, INPUT);// set pin as input

}
void loop() {

switch (leftClick) {

case 1:

if (check_eye_blink() == true) {
lastBlinkTime = millis();
leftClick = 2;
}
break;

case 2:

if (millis() - lastBlinkTime >= 400) {

if (doubleBlink == true) {
doubleBlink = false;
leftClick = 1;
}
else {

leftClick = 1;
}
}
else {
if (check_eye_blink() == true) {
doubleBlink = true;
lastBlinkTime = millis();
leftClick = 1;
}
}
break;
} // End of switch loop
}

well I see no declaration of a variable called ‘leftClick’, have you posted the full sketch?

Yes, looks like this is incomplete code, can’t see leftclick declared as a variable which is why you’re getting the error message and there does not appear to be any code that sets it’s value outside the case statement.

Just a thought but I think it would be possible to modify a standard usb mouse for this purpose. Just replace the button micro switches with the ir sensor and a transistor, just another way to skin a cat :slight_smile:

Beware damaging your eye from IR. There are industry guidelines.