Schematic:
The proximity sensor's set up and usage were quite simple. The sensor runs on low current so it can be directly connected to the Arduino's 5V input and only needs to be connected to one analog input for the analogRead function.
To connect the sensor, I had to solder on solid core wire to the stranded wires of the device as shown above. Then I used electrical tape to wrap the exposed wire to prevent any short circuits.
Once connected up, I was able to start testing.
TESTING:
For values at specific distances, I used a ruler for nearly exact measurements and observed the values of given by analogRead. The values actually tended to fluctuate even without movement of the sensor and object reflecting the waves. The values are thus estimates of what the value given should be.
I placed an object at 20, 40, 60, and 80 cm from the sensor and got output values of around 260, 130, 110, and 80, respectively.
The effective range of the sensor is from 4 in to 36 in away from the sensor. The function analogRead gives a value of 0 for objects more than 3 feet away and gives 630 at 4 inches. The value given begins to drop as the object slowly gets closer to the sensor starting at 4 inches.
Comments