Understanding the GP2Y10

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Understanding the GP2Y10

#1 Post by manjh » 07 Sep 2017, 16:43

I am going to set up a GP2Y10, have looked through this forum and the wiki but have a few questions left.

First, I see six connections coming out of the sensor. From the schematics I can understand numbers 1, 2, 4 and 6.
Number 5 is the output, I suspect.
But what about number 3? "LED"? In the Wiki schematic it connects to D7. What does this do?

Second, I want to connect the sensor using an ADS1115.
I have not found a schematic for this, but am thinking that I would connect pin5 of the sensor to one of the input channels of the ADS.
Pins 1, 2, 4 and 6 connect in the same way, but what about pin 3?

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#2 Post by Shardan » 07 Sep 2017, 20:04

For short from vaccations:

1,2 and 3 are the led circuit. LED power needs an own power supply with a 150 Ohm resistor in serial and a 220uF capacitor parallel to the GP2Y10 LED pins.
Pin 3 is the led driving input.

One measurement needs a number of led pulses of a defined time, the scattered light of this pulses is collected by the photo transistor and the amplifier inside the sensor.
This will make swapping to the ads1115 difficult as you have to sample the voltage at a specific time at the end of the pulses.

There is a more exact description in the datasheet, google for it.

Send from tablet
Shardan
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#3 Post by manjh » 07 Sep 2017, 21:26

Shardan wrote:
07 Sep 2017, 20:04
For short from vaccations:

1,2 and 3 are the led circuit. LED power needs an own power supply with a 150 Ohm resistor in serial and a 220uF capacitor parallel to the GP2Y10 LED pins.
Pin 3 is the led driving input.

One measurement needs a number of led pulses of a defined time, the scattered light of this pulses is collected by the photo transistor and the amplifier inside the sensor.
This will make swapping to the ads1115 difficult as you have to sample the voltage at a specific time at the end of the pulses.

There is a more exact description in the datasheet, google for it.

Send from tablet
Shardan
Ah, I understand. So pin3 is (so to speak) a trigger pulse for the LED.
If I connect the data to the ADS, and pin3 in the normal way, would that work?
Alternatively I could connect straight to the ESP unit, but I will have to look carefully at which model I am using.
Would it harm if I use the V-divider on a model that already has that? What would happen?

Pity that I already purchased tje ADS unit. I read somewhere that it would be preferable to connect the dust sensor via this little device, so when I ordered the sensor I also ordered the ADS1115. Oh well, it will come in handy at some point.

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#4 Post by Shardan » 07 Sep 2017, 22:29

have a look at the wiki and search for the gp2y10
The new article about the sensor is online.

A voltage divider is needed if you use bare ESP-12, a wemos has it built in.
If using a divider on a wemos you will get very low values and a bad resolution,
thats all.
Using the ads1115 needs an adaption of the gp2y10 plugin as you have
to meter the value at the end of the pulse series if i remember right
(sorry, i don`t have the data sheet at hand here in spain).

Regards
Shardan
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#5 Post by manjh » 08 Sep 2017, 21:25

Shardan wrote:
07 Sep 2017, 22:29
have a look at the wiki and search for the gp2y10
The new article about the sensor is online.

A voltage divider is needed if you use bare ESP-12, a wemos has it built in.
If using a divider on a wemos you will get very low values and a bad resolution,
thats all.
Using the ads1115 needs an adaption of the gp2y10 plugin as you have
to meter the value at the end of the pulse series if i remember right
(sorry, i don`t have the data sheet at hand here in spain).

Regards
Shardan
August 26th...
I don't see the new article, what I see is dated August 26th!

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#6 Post by Shardan » 08 Sep 2017, 21:27

... which is the new article as i'm on vaccation since beginning of September... :D
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#7 Post by manjh » 08 Sep 2017, 21:30

Shardan wrote:
08 Sep 2017, 21:27
... which is the new article as i'm on vaccation since beginning of September... :D
Lucky you! Have a great time!

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#8 Post by manjh » 10 Sep 2017, 22:08

I put together a small breakout board and put the sensor on it. the V-divider is on it, and can be switched on/off with a jumper, so I am flexible as to the use of the ESP unit.
I am now using a NodeMCU. Connected to the pin marked A0, and used this formula:

Code: Select all

(%value%-1940)*0.025
It looks like it works OK, but after a few days it consistently shows a value 577. I have no clue if this is a valid number, but it does seem strange that it does not change at all.
Any ideas?

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#9 Post by Shardan » 10 Sep 2017, 22:52

hello manjh,

first, i'm not sure if the nodemcu has a bult-in divider or not.
anyways, if it has the value would just be lower then expected.

To be honest i have no clue what is going on with youir circuit.
Try to disconnect the output pin of the sensor to see if the sensor gives that value
or something is wrong with the circuit on the bread board.

Several things are posible.
- Sensor Led is on permanently
- divider lost ground connection
- something is simply broken

Hope that helps
Regards
Shardan
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#10 Post by manjh » 11 Sep 2017, 12:17

I took a closer look at my circuit, and sure enought: found a very clumsy fault. :shock: :oops: The V-divider lead to ground had been cut. I repaired it and started the unit up again with the formula as mentioned:

Code: Select all

(%value%-1940)*0.025
It now produces value 284. Will leave it alone for a while and see what happens.

But it did make me realize that I don't know what to expect! Of course the value depends on the environment, but what range of readings would be OK? Perhaps a good idea to add in the Wiki article what range of value can be expected?

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#11 Post by Shardan » 11 Sep 2017, 17:36

Hello again,

i tried a lot to get really clear readings from this sensor.
At last i gave in. The GP2Y10 is not made for exact measurements.
The tolerances are very high. For example the zero deviation, the vbalue you get if
there is no dust at all is between 0.3..... 1V! So giving a value to expect makes no sense,
your sensor has it's individual tolerance.
In the wiki i described how to roughly calibrate it.

If you need more reliable values i'd suggest to use PMSx003 or SDS011 sensors.

Regards
Shardan
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#12 Post by manjh » 11 Sep 2017, 18:08

I don't really care about exact values, since it is all relative anyway.
The only thing I would like is to see if the sensor works at all.
At this moment I can see the effect when I disconnect the outputline, or the 3.3 or gnd connections.
But the LED driver (connection 3 on the sensor) does not seem to make any difference. So I would think the sensor is not working at all, right?
Or am I using the wrong plugin version? At the moment I am using build 147.

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#13 Post by Shardan » 11 Sep 2017, 21:07

i have one running on R148 and one on 2.0.0_11, both are working.

A very simple test is blowing smoke from a cigarette to the sensor, it should show a reaction with
the next "delay" period.
As said it is possible that the sensor has a somewhat high zero deviation so it remains on a high value.

Regards
Shardan
Regards
Shardan

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#14 Post by manjh » 11 Sep 2017, 22:22

Shardan wrote:
11 Sep 2017, 21:07
i have one running on R148 and one on 2.0.0_11, both are working.

A very simple test is blowing smoke from a cigarette to the sensor, it should show a reaction with
the next "delay" period.
As said it is possible that the sensor has a somewhat high zero deviation so it remains on a high value.

Regards
Shardan
Hmmm... I don't smoke.... :oops:
But I assume that disconnecting wire-3 of the sensor should have some effect, correct?

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#15 Post by Shardan » 12 Sep 2017, 11:48

ask a smoker for some help :D

I'm not sure a boit pin 3 as i don't have a detailed schematic of the sensor itself and can't test anything here in spain.

If the sensor is purely analog inside it should have an effect. If it is partly digital it might hold the output
until next led pulses come up. First option is more likely, both are possible.

Regards
Shardan
Regards
Shardan

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#16 Post by Ton_vN » 02 Apr 2018, 19:17

Experimenting with Dust-sensors, in parallel setups with SDS011 and GP2Y10: see http://www.vannwnhzn.nl/Meteo_Dust00E.html

Got SDS011 working as expected, but 'puzzled' by GP2Y10.
Indoor testing of the GP2Y10-setup showed results which could be explained.
After such experience one would expect similar results during outdoor operation, but not .....

GP2Y10 is simple & cheap device, and 'calibration' is try-and-error, but nevertheless at least you would expect some output related to clearly rising and dropping dust level, especially with the high dust-content we had last night from the Easter-fires in this region and one night earlier from neighbouring Germany.
Comparing the outputdata, the difference between SDS011 and GP2Y10 is very high, and then you try to find explanation .....
A practical solution is simple offset & multiplication of the value from GP2Y10 until it resembles the max. or average output from the SDS011, but that is a very rude method of alignment, and not very realistic for continuous use. Offset in the ESP-formula to be periodically 'tuned' for a 'sensible' value for display.
Now amply proven by experience that the measurements by GP2Y10 occasionally sway far beyond the values from SDS011, :( without clear explanation ........
My present point of view is that the information from GP2Y10 euphemistically gives a 'hint to ROM air-quality', nothing more, nothing less .....

Any 'better' ideas?

Addition 03rd of April:
:roll: Check & recheck.
:oops: Obviously it helps a lot if you properly set the GPIO-13, because that kicks the LED into operation ........
Before that moment, the ADC of the ESP8266 just measures what the GP2Y10 sees/reports 'by accident'.
Last edited by Ton_vN on 18 Aug 2018, 14:04, edited 1 time in total.

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#17 Post by Ton_vN » 18 Aug 2018, 09:52

Puzzled by the readings from the GP2Y10 relative to SDS011.

Anybody able to provide explanations on the 'operation' of the GP2Y10?

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#18 Post by manjh » 18 Aug 2018, 10:55

Ton_vN wrote:
18 Aug 2018, 09:52
Puzzled by the readings from the GP2Y10 relative to SDS011.

Anybody able to provide explanations on the 'operation' of the GP2Y10?
since the sensor has a relatively narrow tunnel, you must somehow ensure a constant airflow. Otherwise external influences that change the flow will give you weird measurements... for example opening a door or window.
I fitted mine with a small 3V fan. Measurements are quite constant.

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#19 Post by Ton_vN » 18 Aug 2018, 13:45

@manjh

Exactly the solution I also implemented.
See picture and bigger perspective:
- a small fan sucks the air through the 'sensor-pipe'
My sensor setup is in open air, outdoors, but protected by a box housing.

Initially readings seemed OK, but later much higher values for no clear reason:
- fan is running
- 'pipe' is clean

Only relevant aspect I could imagine:
the datasheet tells that the preferred position is with the 'pipe' vertical, while I have it horizontal.
But if the 'pipe' is clean, I don't see a reason why the measurement values should deviate so much.

If I compare with Shardan's description, to arrive within range before the division by 40, I have to subtract a much higher value of 3000 relative to 1940, meaning that the measurement values in my setup are substantially higher.

Addition November 03, 2018:
Periodic check & adjust is required to keep de displayed values from GP2Y10 > 0.
October a subtract-value of 2000, now at a subtract-value of 1400 .........
Might humidity&temperature have an (unknown) effect on the readings?
Last edited by Ton_vN on 03 Nov 2018, 16:28, edited 4 times in total.

manjh
Normal user
Posts: 459
Joined: 08 Feb 2016, 11:22

Re: Understanding the GP2Y10

#20 Post by manjh » 18 Aug 2018, 13:55

my problem with this sensor has always been the lack of reference. I can see a measured value, but I have no idea what it means...
Temp measurement is much easier to understand!😎

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#21 Post by Ton_vN » 18 Aug 2018, 14:00

:? Exactly my problem.
If I only would know what the device is assumed to be measuring ......

If the GP2Y10-line in the graph would more or less have the same tendencies as the line for SDS011, it already would help a bit, but not even that is applicable.

Thinking about possible influences, :idea: an aspect popped up which seemed positive, but in hindsight might have negative effects:
as you can read in my setup description, the fan is powered by the rough/unstabilized power supply going to the sensorbox.
Have assumed more or less constant consumption = more or less constant power supply, but obviously no guarantee.
;-) To be tested whether any difference if I connect the fan to the 5VDC-output of the add-on stepdown powerconverter serving the WEMOS D1 PCB.

Addition August 18, 18:00
Fan now happily humming at power from the main 5VDC-supply through Si-diode plus buffer-condensator, resulting in approx. 4.3VDC going to the fan:
should keep the power supply for the fan reasonably stable and noise-free.
;-) Let's see whether & what effects.
Last edited by Ton_vN on 19 Aug 2018, 23:09, edited 2 times in total.

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Understanding the GP2Y10

#22 Post by TD-er » 18 Aug 2018, 17:14

Here in the Netherlands we have every now and then a news item where the RIVM warns used with astma for upcoming high particle counts. See their site with expected values: https://www.lml.rivm.nl/verwachting/fijnstof.php
Every time I see such a warning, I look at my dust sensor too (SDS011) to see any change and indeed the value rises to peaks comparable with me lighting a BBQ within 5 meters of that sensor.

You have to know there are several ranges of particle diameters detected by several of these sensors and each impose different dangers.
Most ranges are:
- < 1um
- 1um ... 2.5 um
- 2.5 um ... 10 um

Also you have to take the airflow into account.
The SDS011 has its own chamber and fan, which I assume are calibrated. So the reported values should be comparable to public available values reported. Often expressed in µg/m3.
If you need to supply the airflow yourself, it may be hard to get a comparable range of reported values.
So you may want to compare a few official reported values with your own to get an idea of the factor you should apply to make your own calibration.

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#23 Post by Ton_vN » 18 Aug 2018, 18:02

@TD-er

That is not the issue in this thread.
I run SDS011 and GP2Y10 side by side (within 10m of each other): see viewtopic.php?f=5&t=3516&start=10#p27040

The issue is that we cannot see a similarity between the readings from the SDS011 and the readings from GP2Y10:
although the GP2Y10 is less sensitive and more wide spectrum, in the same environment some form of similarity should be present.

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Understanding the GP2Y10

#24 Post by TD-er » 18 Aug 2018, 21:02

OK, I get it.

Maybe you could try it with rather large dust particles like from a BBQ.
Try running both near the BBQ and try to see if they do show some spike then.
Those larger particles are rather uncommon in the air, unless you live in a big city, or near a busy road or industrial complex.
If you will get a similar reading then, then it is more clear the size of the particles matter.

Shardan
Normal user
Posts: 1153
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Understanding the GP2Y10

#25 Post by Shardan » 18 Aug 2018, 21:12

As I wrote before - i gave in with the GP2Y10.

It is made for air cleaners so it gives just a general value. I never was able to
relate the value to the values of a PMS-sensor.

The PMSx003 is quite similiar to the SDS011 you use. The manufacurer says it
is precalibrated... well, I'd like to check that with an exact value, but that is a problem of it's own...
Anyway the SDS and PMS types surely give far better values then the GP2Y10.

A reason for the behaviour of the GP2Y10 might be aging. The LED and the sensor inside
tend to have some aging effects. If they are running a long time this might lead to
strange results.
Maybe cover the GP2Y10's tunnel with a dust filter or completely to see which
zero deviation it actually has.

My advice would be to abandon the GP2Y10 and rely on the SDS011 or a PMSx003.

The plugin for the PMSx003 had a bad quirk with the old version I'm using:
It keeps the laser inside running permanently - this will reduce the lifetime dramatically to below one year.
I've used a GPIO from the ESP to switch the sensor to just wake every 30 seconds for 5 seconds.
As the last value is stored this has no effect on the sensors readings, worst case you get same value twice.

This quirk influences the SDS011 too. See the github issue #487 for description. The SDS can be set to sleep
via serial command so this should be done inside the plugin if it isn't already.

Regards
Shardan
Regards
Shardan

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#26 Post by Ton_vN » 18 Aug 2018, 22:54

@Shardan

Completely agreed.

My continued running of the GP2Y10 is just due to curiosity.
And ;) a certain laziness, because I have to modify the related webpages if I 'sidetrack' the GP2Y10, to put focus on the SDS011.
Starting fresh is easy, but it would be nice to keep the data and graphs meanwhile collected with the SDS011-package.
Contrary, looking at the 'dirty' graphs, loosing the GP2Y10-info is no real pain.
Requires some thinking on the mod of the webpages and the related RDDTool-functions.

August 19; Progress?
Fan power initially was coming from unstabilised feed.
Fan now running at semi-stabilised 4,3V from the Powershiled of the WEMOS PCB, which is approx. 33% of Voltage when powered by the earlier unstabilised Power Supply.
Must have impact on the measurements of dust, because it means that the air flow through the 'pipe' decreases to 33%.
On the other hand now a constant power supply => constant air flow.
:-( Is one of the weak aspects of the specification of the GP2Y10:
nowhere described how much air flow is required as reference for specified operation
['specified operation' is missing anyway].
Last edited by Ton_vN on 18 Nov 2018, 19:56, edited 6 times in total.

TD-er
Core team member
Posts: 2342
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: Understanding the GP2Y10

#27 Post by TD-er » 19 Aug 2018, 00:32

Shardan wrote:
18 Aug 2018, 21:12
[...]
This quirk influences the SDS011 too. See the github issue #487 for description. The SDS can be set to sleep
via serial command so this should be done inside the plugin if it isn't already.
[...]
For the SDS011 this is already fixed.
You can set the 'sleep time' to the flash of the SDS011. (after setting you can remove the TX(ESP) => RX(SDS) cable if you need its pin)
This will wake the sensor every N minutes and perform a reading, which takes 30 seconds. Then it will sleep again.

Like this, my sensor is running since dec. 31 2017, right before the fireworks :)

Ton_vN
Normal user
Posts: 142
Joined: 21 Oct 2016, 15:20
Location: Hengelo (Ov)/ NL
Contact:

Re: Understanding the GP2Y10

#28 Post by Ton_vN » 19 Mar 2020, 15:23

Because of it's limitations, the setup with GP2Y10 for me now is playground for experiments.

As a companion to the GP2Y10 + BME280 I fitted a gasmeasuring setup consisting of MiCS6814, ADS1115 and LM35.
Now testing feasability of heating to get the gassensor in better environment, and as side-effect also the dustsensor GP2Y10 will get some 'improved' air.
Using an ESP8266WEMOS+ESPEasy to control the setup, with remote help of Domoticz.
Must be possible to make comparable, local heater control in the ESP8266 under application of 'Rules'.
;-) That's a next experiment ......

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests