User Activity

When I place an object near the sensor, it shows the reading between 40 - 50mm. How to perform the calibration of this sensor to accumulate accurate reading from the sensor. I have attached the code that I have uploaded.