Hi! I recently bought a line following module like this one https://microohm-eg.com/product/5-channel-line-follower-tracking-sensor-module-bfd-1000/ .
I don't know why it is not working. Every time it is showing 2500 in the console, and if i move it far away from the floor (50cm) it shows 8.
Also, the leds on the board are showing the same results.
Welcome to the forum
How is the module connected to the Arduino ? A schematic would help
Please post teh sketch that you are running, using code tags (the </> icon) when you post it
Of course, and here is the code as well:
const int pinOUT1 = 22;
const int pinOUT2 = 23;
const int pinOUT3 = 24;
const int pinOUT4 = 25;
const int pinOUT5 = 26;
void setup()
{
Serial.begin(9600);
pinMode(pinOUT1,INPUT);
pinMode(pinOUT2,INPUT);
pinMode(pinOUT3,INPUT);
pinMode(pinOUT4,INPUT);
pinMode(pinOUT5,INPUT);
}
void loop()
{
Serial.println(digitalRead(pinOUT1);
Serial.println(digitalRead(pinOUT2);
Serial.println(digitalRead(pinOUT3);
Serial.println(digitalRead(pinOUT4);
Serial.println(digitalRead(pinOUT5);
}
The code you posted indicates the console can only print a 0 or a 1 on each line of the serial monitor. Where does the 2500 come from?
From what little I gather from the links I saw, your device is working properly.
The code that you posted will not print 2500 or 8
Have you posted the correct sketch ?
Sorry, i used another code before, importing QTRSensors.h, but i figured out that the module is working just binary, showing 1 if the line is under it, and 0 otherwise.
But with this code, the module is showing 1 every time. I cannot see any difference if i slide the black line under the sensor.
I want to add that the sensor is placed 1cm above the ground.
I also tried with this code:
void setup(){
Serial.begin(9600);
}
void loop(){
Serial.print(analogRead(8));
Serial.print(" ");
Serial.print(analogRead(9));
Serial.print(" ");
Serial.print(analogRead(10));
Serial.print(" ");
Serial.print(analogRead(11));
Serial.print(" ");
Serial.print(analogRead(12));
Serial.print(" ");
Serial.println("");
delay(250);
}
and this is what i get.. even if i slide a black line under the sensors:
997 997 997 997 997
997 997 997 997 997
997 997 997 997 997
997 997 997 997 997
997 997 997 997 997
997 997 997 997 997
997 997 997 997 997
997 997 996 997 997
997 997 997 997 997
997 997 997 997 997
I connected the pins as follow:
IF you actually want to receive help, you need to tell us what the pins are connected to and what the device is supposed to be sending. Right now you are the only one with documentation and we can't see it very well.
I didn't find any documentation, but the pins are connected as the diagram shows above. From what I found on internet, you get a binary value (1 - line , 0 - not line) on each sensor pin.
The tests I did above shows that the value is constant 1 logic. It changes just if I move the sensor further away (50cm).
Do you mean the picture? Totally useless. Make a pencil drawing.
IF you have not tested with a line on the floor, you have not tested, just playing around.
Here it is.. the 2nd diagram.
I need to mention that I tested the sensor in every way I could. Even with a line on the floor, at different distances (0 to 4 cm) and with different colors (bg black - line white, bg white - line black, etc.).
Then what is the problem you are trying to solve?
As I shown in the output above, the sensor is giving 1 logic every time, even if the line is under it. Maybe you know what causes this problem.
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.