Arduino Sensor Sharp GP2D120 Distance Sensor Tutorial
By Previn Wong
Mar 8, 2013
The Sharp GP2D120 is a distance sensor from Sharp 's range of optoelectronic devices. Optoelectronic devices are transducers that work by converting light to electricity or vice versa.
The GP2D120 has two lenses in front; it works by emitting a focused beam of light through one. If there is an object in the sensor 's working range the beam reflects off that object and lands onto the collector (second) lens. This makes a triangle between the emitter, object and collector. The sensor then checks the angle of the reflected beam and uses it to identify how far the object is.
There are two types of inputs digital and analogue. Digital inputs are discrete signals in the form of HIGHs and LOWs. The combination of these HIGHs and LOWs indicates what the data is. Analogue signals are continuous signals in the form of voltage. The GP2D120 distance sensor gives an analogue output. It can detect objects within the range of 40mm to 300mm. When the sensor is turned on it takes 44 ms to start up and has a response time of 39 ms meaning that it updates its values every 39 ms. The average power consumption is 33 mA.
Like everything there are pros and cons for this sensor as well. The Sharp GP2D120 is cheap, light, compact, easy to program and accurate enough for most tasks. On the other hand it can only get a reading of one point of the object, any readings below 40mm are