How to use the FC 51 InfraRed proximity/obstacle avoidance sensor with Arduino
Hello there,
Welcome to this little tutorial, we gonna see how to use the FC 51 infrared sensor, it’s a module used to detect if something is passing by or an obstacle is nearby, like in obstacle avoidance robot, this module is very easy to use, it sends infrared waves and if there’s something on the way they reflect back and it’s detected by the receiver, and it depends of how you set the module potentiometer (blue component below) to adjust the detection range.
The output is a digital one, and you cannot measure distance using this module, all you have to do is to check the distance to detect using the potentiometer, check the video for easier details.
Wiring:
It’s one of the easiest module to use and integrate in a project, but the possibilities are not that many.
The module is powered using 5V, and delivers a digital signal that can be read using a digital pin.

Code:
In the code below a distance was set before and if there’s a detection the Arduino internal LED will light up.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
//This code is to use with FC51 IR proximity sensor, when it detects an obstacle it lights the internal LED //of the Arduino Board, refer to http://www.Surtrtech.com for more information const int ProxSensor=3; //Declaring where the Out pin from the sensor is wired void setup() { pinMode(13, OUTPUT); // setting the pin modes, the "13" stands for the internal Arduino uno internal LED pinMode(ProxSensor,INPUT); // then we have the out pin from the module } void loop() { if(digitalRead(ProxSensor)==HIGH) //Check the sensor output if it's high { digitalWrite(13, LOW); // Turn the LED on (Yes by writing LOW) } else { digitalWrite(13, HIGH); // Turn the LED OFF if there's no signal on the ProxSensor } delay(100); } |
No libraries needed, the functionning of the module is very simple, it has a digital output that’s give a high level when it detects something otherwise it’s low, the detection range can be set by the potentiometer on the module.
Categories
Yassine View All
Automation and Electrical Engineer, Electronics amateur trying to share my little projects.
3 thoughts on “How to use the FC 51 InfraRed proximity/obstacle avoidance sensor with Arduino” Leave a comment ›