DISCLAIMER: This is completly useless and overly complicated, but damnit it will work.
I have talked about this issue about a month ago, basically the problem is this:
Within the "bad" region it gives kinda insane readings. Notice the following image:
Please note the first part, which is indeed a very bad reading. Notice it goes up some, and dies some. You will also note that it has a region where several values are repeated(1.8v-2v).
So how on gods green earth can we determine if the value of 2.2v is actually 10cm or 16cm?! Pretty easy:
The range that this particular sensor is completly insane is 10cm's. Take a SECOND sensor(you wanted this sensor to work, but you will have to buy a second one to correct the first lol) of equal design. Now place it 5cm behind the first one. Just above it, barely... now set your MCU to hit the first sensor off, hit the second one on and take a reading. Now hit it off, and first one back on. Take a reading.
Lets pretend there was an object 3cm infront of you(which is in the bad region). One sensor would see it as a 3cm, the other as 8cm. So sensor 1(closer) would give us a reading of:
1.4v, the other as 1.8v or something. Now if you take that into the standard reading set, you would get readings such as:
16 and 20cm away. The first one(20cm) is from the closer sensor while the second sensor gives 16cm. Obviously wrong. How can the farther back sensor reading closer then the closer sensor? Something is a wry.
Switch it to a SECOND formula(the crazy one) and it would read out as 3cm and 8cm.. the 5cm distance is right and something we already knowt be true.
Now I know this has flaws, and in NO way what so ever to I actually encourage this.. but if you wanted to think outside the box and find someway to make the 100cm range it has as bad, to be useful.. this would work probaly. the key would be to hit the sensors off as the other one worked.. or you would get wrong readings.
so party on.