A place users can post their projects. If you have a small project and would like your own dedicated place to post and have others chat about it then this is your spot.

User avatar
By JopieK
#22595 I have a lot of experience with Arduino, Teensy and other microcontrollers, but the ESP8266 is new for me. 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.

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.

Background on the project: we want to provide (at this point) 20 sensor units to high school students in a workshop that they will take home for a few weeks and use to do air quality measurements with. Still some weeks of summer holidays, but also need to do a lot of other things so any guidance very welcome (for the purpose of making youngsters enjoy technology!).
User avatar
By lethe
#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).