We've been stuck on this issue for a while now. Basically, we have an IR base pair -- an emitter and a phototransistor -- that is supposed to detect motion. Here is the code.
void setup() {
Serial.begin(9600);
pinMode(A3, INPUT);
pinMode(2, INPUT);
}
void loop() {
int sensorValue = analogRead(A3); // change A0 to your sensor pin
Serial.println(sensorValue);
delay(500);
}
However, everytime we run the code and make changes, numbers on the console display as either only 0 or 1 (from digital) or 1023 (from analog), and are not actually responsive to motion close to the sensor.
We know that the LED emitter is working as we have used our smartphone cameras to detect the infrared light successfully.
Any help is greatly appreciated.