Distance measurement using IR sensor FC 51

Hi, I am facing issue with the IR sensor FC 51 in measuring distance of obstacle.

Hi, @dikshakumarikangra07
Welcome to the forum.

What is the issue?
What model Arduino are you using?

Have you got any code?

Can you please tell us your electronics, programming, arduino, hardware experience?

Is this a school/college/university project?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

The IR sensor FC 51 is not suitable for measuring distances to an object.

It can only detect the presence or absence of a reflective surface. There is a sensitivity control to adjust how far away the object is sensed, but it is in no way calibrated.

You can't measure distance with the FC 51.
You can only detect if something is within a certain range that is set with the pot.

TOF10120 is a "laser" time-of-flight limited to under two meters.

Yes, Tom, this is a school project. I got my answer.

How can I extend the range of the IR sensor FC 51 and measure the distance?

See Post #3.

Hi, @dikshakumarikangra07

You need to do some research.
Google;

IR sensor FC 51

This link says;

FC 51 Module
The output is a digital one, and you cannot measure distance using this module,

Tom... :grinning: :+1: :coffee: :australia:
PS. Did you Google to find some data on the sensor?

const int sensorPin = A0;  // Analog pin for connecting the FC-51 sensor

void setup() {
  Serial.begin(9600);
}

void loop() {
  int sensorValue = analogRead(sensorPin);  // Read the analog value from the sensor
  float voltage = sensorValue * (5.0 / 1023.0);  // Convert analog value to voltage
float distance = 27.86 * pow(voltage, -1.15);

  Serial.print("Analog Value: ");
  Serial.print(sensorValue);
  Serial.print("  Voltage: ");
  Serial.print(voltage);
  Serial.print("  Distance: ");
  Serial.println(distance);

  delay(1000); 
}

Hi,
And what output do you get as you move an object towards the sensor with the code in post #10?

Where did you get this equation, what are the "distance" units?

Thanks.. Tom... :grinning: :+1: :coffee: :australia:

I got this from internet and unit is in cm

Three people including @TomGeorge have already told you that you cannot measure distance with that module.
You can only detect if something in within a range set by the little trimpot.

Can you please help me with Arduino code to detect color with a simple LED as a transmitter and a laser diode as a receiver?

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