TrackerSensor v4 not reading

I'm using this sensor, same code same wiring but not working.

First in the diagram shows that the VCC should be in power 5v or 3.3v and "S" is on pin2, but the red light indicator is not lighting up in the sensor and the reading is all zero white and black surface, then I swap the "S" and Vcc and the red light is lighting but the problem is it keeps on 1 value in Serial monitor tested in black and white surface.

I don't know what's wrong because I tested my atmega2560 and its working on other sensors like distance and also motors

How far from the surface did you hold the sensing element when trying to detect the black line?

1cm and even close.

Try holding a sheet of white paper in a distance of about 1mm in front of the sensor. If that doesn't give you a HIGH reading you should check your hardware (sensor, wires, Arduino).