Dear Arduino - team,
I am trying to calibrate the infrared sensor but I could not succeed.
The sensor is always outputting 0 instead of 1 when no white paper is in front of it.
Playing with the potentiometer does not change anyhting to the output. Note that the problem only occurs for the left and right sensor, the middle sensor is working wel...
Do you have any ideas how to solve this ? Could the sensor somehow be slightly damaged ?
Thanks a lot !
Kind Regards,
Guillaume
What exact sensors do you have?
How are the sensors wired? How are they powered? A schematic or wiring diagram and photos would be helpful.
Without an annotated schematic and links to the technical information on the hardware I cannot be sure if I can give an accurate answer. However I will take a SWAG: It sounds like you have one of those sensors that only have a digital output so you are getting what it is designed to output. They have a pot which allows you to adjust the threshold level, not the sensitivity. If you want to measure levels you need a different sensor. This is one of the many circuits.
Dear all,
First of all : thank you for your quick answers and help.
What I meant is the following:
The tree lights of each sensor are OFF but the output is 0 1 0 whereas it should be 0 0 0 (no signal detected)
I will attach some pictures to clarify my sentence above.
Thank you very much again for the help
KR
Guillaume
PS: I still need to better look at your answers as I do not have more time today, apologizes.
Have you tried adjusting the threshold settings with the potentiometers (blue boxes)?

Hello Groundfungus,
Yes I tried but it does not change the output value so I guess it is somehow slightly damaged.
Anyway one of the sensors detects something so it is not completely lost.
Meanwhile, I am testing the servo control project of this robot (project 4 servo control of robotcars multipurpose). The aim of the code is to let rotate the servo from 0 to 180 and then from 180 to 0 degrees.
The servo can not achieve this apparently. I adapted the code for the angles and I conclude that the servo can only rotate from 0 to 45 and from 45 to 0 correctly.
Any idea about the reason behind this malfunction ?
Could it be due to the pulsewidth ? From other forums, I could read that sometimes the servo motor should have a higher pulsewidth signal. Is that correct but how should I adapt this ?
Thank you very much
With Very Kind Regards,
Guillaume
Attached the servo motor that I use with a detection sensor build on it
Hello,
It is now working using another similar code with the servo programmed as an object.
I wonder why this method works and not the other but at least it is working. If any one knows the reason behind it, I would be glad to know 
Code that works is using servo as object and write the position angle into the object.
Code that does not work completely is working with a function named procedure but does basically the same...
Thanks a lot
With Very Kind Regards
Attached the working (=servo_control_2) and non working code (=servo_control) for the information
servo_control.ino (743 Bytes)
servo_control_2.ino (584 Bytes)
Hello everybody,
I have another question regarding servo control; I have concluded that the servo control works well when setting the servo motor to 0 degrees before starting (initializing/reference)
However in the installation, they asked to set up 90 degrees as initializing angle. But if I do so, I have an obvious shift of 90 degrees when playing with the servo control.
So my question is: why do they ask this unlogic initialisation ?
Thanks for your time and effort
Kind Regards,
Guillaume