Show Posts
Pages: [1]
1  Using Arduino / Sensors / Re: infrared emitter / detector on: March 01, 2011, 12:16:47 am
How would one go about making a sketch using a IR detector/emitter circuit to detect eye movement?
would it concentrate on the reflectance or a difference of reflectance from two sensors? Or some sort of average reflectance?
2  Using Arduino / Sensors / Re: QTR-1RC & Arduino Mega on: March 01, 2011, 12:13:17 am
Well that sensor is going to be placed on a sleeping mask. the distance is in mm so i would say off the top of my head as if your wearing glasses if that makes any sense.
3  Using Arduino / Sensors / QTR-1RC & Arduino Mega on: February 28, 2011, 06:31:36 pm
Hi, I'm trying to design a Lucid Dreaming Machine, that detects Rapid Eye Movements. During sleep, your brain is active, and while your sleeping, your eyes are moving while the rest of the body is paralyzed. So i was thinking of a machine that can use infrared sensors such as the QTR-1RC,
Can i use the reflectance to count 20 movements??? Or some sort of difference between 2 sensors??
Here's my code so far.. How would i go for this sort of sketch??? Any ideas are welcome. I picked the QTR-1RC to avoid a ADC

#include <PololuQTRSensors.h>

 // Six Analog Pins can be commonly referenced as:
 // analog 0 - Reference as: Pin 14
 // analog 1 - Reference as: Pin 15
 // analog 2 - Reference as: Pin 16
 // analog 3 - Reference as: Pin 17
 // analog 4 - Reference as: Pin 18
 // analog 5 - Reference as: Pin 19

unsigned long time;
int ledPin = 10;

PololuQTRSensorsRC qtr((unsigned char[]) {3},1);

void setup()
{
  pinMode(ledPin, OUTPUT);
  // then start calibration phase and move the sensors over both 
  // reflectance extremes they will encounter in your application: 
  int i; 
  for (i = 0; i < 250; i++)  // make the calibration take about 5 seconds 
  { 
    qtr.calibrate(); 
    delay(20); 
  } 
  Serial.begin(9600);
}
void loop()
{
  unsigned int sensors[1]; 
  int EYE = qtr.readLine(sensors);
  //Output to Serial
  Serial.print(sensors[1]);
  Serial.print("   Reflectance ");
  Serial.print("0 (Full Reflectance) to 1000 (no Reflectance)");
  Serial.print("Time Elapsed: ");
  time = millis();
  //prints time since program started
  Serial.println(time);
  // wait a second so as not to send massive amounts of data
  delay(1000);
  Serial.println();
  if (sensors[0] == 0)
 {
   digitalWrite(ledPin, HIGH);
 }
  // Turn off the LED if we have a Low Reflectance.
  else digitalWrite(ledPin, LOW); 
}
Pages: [1]