Go Down

Topic: HELP with Infrared emitter + sensor problems (Read 10526 times) previous topic - next topic

njs707

I just realized I worded my last post poorly, when I say " light was on "... I did not mean IR led, I meant incandescent light only, just to test how much the values change when someone would turn a light switch on or off.  The room was completely dark, then I switch an incandescent light on, then off.  Not ir led, sorry for the confusion if there was any.

njs707

Man this stuff is frustrating.

Ok, I want to set up an IR receiver that will calibrate to the environment... ( check to see how much ir light is in the environment) and then set that as the new zero level, so if the other IR receiver receives a little more ir light than that new zero ( threshold), then an led will turn on.  To test this, I simply have 2 of the exact same infrared receivers hooked up the exact same way with the exact same resistors to analog 0 and 5 on the arduino.  The 2 receivers are not more than 1 inch apart and are at the same level vertically.  The problem is they are receiving vastly different ir values?? why?


here is the code and the resulting values..... 

int Calibration;
int Receiver;


void setup()

{
  int Receiver = analogRead(A5);
  int Calibration = analogRead(A0);
  Serial.begin(9600);
  Serial.println("Calibration Input = ");
  Serial.println(Calibration);
  delay(1000);
  Serial.println("Receiver Input = ");
  Serial.println(Receiver);
  }

void loop()
{}
 
 
here are the values..


Calibration Input =
133
Receiver Input =
359
Calibration Input =
141
Receiver Input =
377...


HOW COULD THEY BE SO DIFFERENT?

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy