Interfacing unknown IR sensor

Hello, I am trying to make, from what it looks like an IR obstacle detection sensor to work with an Arduino. I have no information about the sensor, apart of that it was fitted on the bottom of a car door mirror on a motorized door opening retrofit kit. Where this sensor would detect an obstacle ( another car or human, or tree , etc...) when the door swings open and will stop it if any obstacle is detected. There is a small circuit board after the sensor that is cast in resin so I can't see what components it is built of. The sensor does looks like infrared sensor, as it has that dark red tinted glass (like the remote controls) and as far as I can see there are two LED's behind it.
Below is a generic code to interface and IR sensor but I got nothing with it. I mean I get "object detect d" constantly even though nothing is in front of the sensor ( this is when I have the "state== LOW"). And if I change the code to "state==HIGH" I've got "Clear" on the serial monitor.
It is connected to Arduino Uno R3, black to ground, red to 5v and the yellow to digital pin 4. I guess that the color logic is this.

const int IRsensor = 4;
const int led = 13;

void setup() {
  Serial.begin(115200);
pinMode (IRsensor, INPUT);
pinMode (led, INPUT);
}

void loop() {
  int state = digitalRead(IRsensor);
  Serial.println(state);
  if(state == HIGH){
    Serial.println("Object detected");
    digitalWrite(led, HIGH);
  }
  else{
    Serial.println("Clear");
    digitalWrite(led, LOW);
  }
}





That's not a good starting point. Looking at one of your pictures there appears to be 3 wires - red, black & blue. You could go with the assumption that the red & black are the supply & ground for the sensor. You would then need to figure out what the supply voltage might be.

You might be able to discover this by connecting the sensor to the potted components block and measuring the voltage.

That leaves the blue wire. It could be an analogue signal or a digital signal. It might need a pull up or pull down resistor fitted.

How much can you discover from taking measurements from the complete working setup?

I don't have the complete set up but I know it's 5 volt logic. It's a good shout that the signal on the blue wire could be analog.

Maybe this is a proximity/distance sensor with circuit boards inside the enclosure. RED/BLK power, BLU data... and whoever soldered RED to BLU and YEL to RED should be fired.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.