Avoidance sensor is not working properly


i have an avoidance sensor, that is working correctly. How you would expect:
Move sth near the sensor and the led of it will light. You can change the sensitivity by
turning the potentiometer of it.

Then i bought myself 3 more avoidance sensor. But these arent working as expected.
The led should keep lighting as sth is towards the sensor. But at most it will blink for once and
only if the object moved fast towards the sensor. Ive already adjusted the two potentiometers
of it but i cant make it work correctly.

Here is a photo of the arduino with sensor.

I bought the sensors here:


And the code:

int isObstacle = HIGH;
int input = 3;
void setup() {
  // put your setup code here, to run once:



void loop() {
  // put your main code here, to run repeatedly:
  isObstacle = digitalRead(input);

  if(isObstacle == HIGH)


Hope someone can help me.

I can read a bit of German, but not what is in your link. Can you please supply information about you sensor in English?


There are not many information about it.
Only that it can be used as obstacle sensor, the supply voltage is from 3.3 to 5 V
and it can be adjusted by 2 potentiometers.
The name is ky-032. It is exactly the same one as i already had before.
Can it really be possible, that 3 sensors are broken?

More info on how the things work here.

This sensor needs a little more work to operate than just reading the output: you have to actively enable the output LED for a short while, then read the result.

Thank you for your answear. But it didnt work.
I also tried the code on the site but i got the same result as before.

I tried different methods like only activating the en pin in the setup function.
I also tried to change the HIGH to LOW but nothing will work.