Accéder au contenu principal
Publicités

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

}

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.

Publicités

Yassine Tout afficher

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

One thought on “How to use the FC 51 InfraRed proximity/obstacle avoidance sensor with Arduino Laisser un commentaire

Répondre

Entrez vos coordonnées ci-dessous ou cliquez sur une icône pour vous connecter:

Logo WordPress.com

Vous commentez à l'aide de votre compte WordPress.com. Déconnexion /  Changer )

Photo Google

Vous commentez à l'aide de votre compte Google. Déconnexion /  Changer )

Image Twitter

Vous commentez à l'aide de votre compte Twitter. Déconnexion /  Changer )

Photo Facebook

Vous commentez à l'aide de votre compte Facebook. Déconnexion /  Changer )

Connexion à %s

%d blogueurs aiment cette page :