- Mon Jul 06, 2015 8:17 pm
#22642
JopieK wrote:I want to connect the GP2Y1010AU0F that according to its' datasheet (https://www.sparkfun.com/datasheets/Sen ... 10au_e.pdf) supports a voltage range of -0.3 to +7V. Well I don't know how to connect -0.3 volts, but I assume 3.3V will be fine therefor.
-0.3 to 7V are the absolute maximum ratings, meaning you may never exceed these voltages on the power supply pin, so don't even try to supply -0.3V. Basically what this tells you is, that you'll fry the sensor if you hook up your power supply in reverse polarity.
Do not confuse absolute max. ratings with recommended parameters. While the datasheet guarantees, that the sensor will not be damaged within those limits, there is no guarantee, that it will operate correctly over the entire range (it most likely will not). The recommended supply voltage is 5V +/-0.5 (see the last section on page 4), which means it will probably not work at 3.3V (even if it does, the output is not guaranteed to be correct).
Can one give me any hints into a direction on this? Probably what I do first is connect the sensor to an Arduino to make it not too complex.
I never actually used such a sensor, but it looks like a fairly simple analog sensor. Fig. 1 in the datasheet tells you how to hook up the LED part of the sensor. On a 5V Arduino, you can run the analog output straight to an ADC pin, for the ESP you need a voltage divider, since the ESPs ADC can only handle up to 1V (a 1:4 divider should work, use 1% resistors or a multi turn pot you can use for calibration).