Hardware Reference
In-Depth Information
There are two parts to the curve. The first is the distance up to about 15 centimeters and
then the distance from 15 centimeters to 150 centimeters. This simple example ignores
distances closer than 15 centimeters, and models the distance from 15 centimeters and out
as a decaying exponential with the following form:
Thanks to teaching.ericforman.com/how-to-make-a-sharp-ir-sensor-linear/ , the values that
work quite well for a cm conversion in distance are 30431 for the constant and -1.169 as
the exponential for this curve.
If you open the Serial Monitor tab and place an object in front of the sensor, you'll see
the readings for the distance to the object, as shown in the following screenshot:
Search WWH ::




Custom Search