Skip to content
Advertisements

How to use the FC 51 InfraRed proximity/obstacle avoidance sensor with Arduino

Hello,

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, like in obstacle avoidance robot, this module si very easy to use, it sends infrared waves and if there’s something they reflect back and inform us that something is near, and it depends of how you set the potentiometer to adjust the detection range.

FC 51 Module

Wiring:

Code:

//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 Surtrtech 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);             


}

 

Advertisements

Yassine View All

Electronics, Automation engineering student... I try to share my little experience with other electronics amateur.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: