0

So I wired Sharp Dust Sensor with Arduino Mega with below fritzing:

enter image description here

the connector cable only connects to the dust sensor as you can seee the image below:

enter image description here however looking at other example projects the same dust sensor has wiring inverted. I followed the hookup and the code as given here: https://www.elecrow.com/wiki/index.php?title=Dust_Sensor-_GP2Y1010AU0F

but I get the result without having to connect the green wire to A0 and Yellow wire connected to D2

Raw Signal Value (0-1023): 346.00 - Voltage: 1.69 - Dust Density: 0.19
Raw Signal Value (0-1023): 394.00 - Voltage: 1.92 - Dust Density: 0.23
Raw Signal Value (0-1023): 398.00 - Voltage: 1.94 - Dust Density: 0.23
Raw Signal Value (0-1023): 408.00 - Voltage: 1.99 - Dust Density: 0.24
Raw Signal Value (0-1023): 433.00 - Voltage: 2.11 - Dust Density: 0.26
Raw Signal Value (0-1023): 468.00 - Voltage: 2.29 - Dust Density: 0.29

if I connect the yellow to A0 And green to D2 then I get below result.

Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1020.00 - Voltage: 4.98 - Dust Density: 0.75
Raw Signal Value (0-1023): 1020.00 - Voltage: 4.98 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1022.00 - Voltage: 4.99 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1020.00 - Voltage: 4.98 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1022.00 - Voltage: 4.99 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1023.00 - Voltage: 5.00 - Dust Density: 0.75
Raw Signal Value (0-1023): 1005.00 - Voltage: 4.91 - Dust Density: 0.73
Raw Signal Value (0-1023): 952.00 - Voltage: 4.65 - Dust Density: 0.69
Raw Signal Value (0-1023): 712.00 - Voltage: 3.48 - Dust Density: 0.49
Raw Signal Value (0-1023): 631.00 - Voltage: 3.08 - Dust Density: 0.42
Raw Signal Value (0-1023): 559.00 - Voltage: 2.73 - Dust Density: 0.36
Raw Signal Value (0-1023): 504.00 - Voltage: 2.46 - Dust Density: 0.32
Raw Signal Value (0-1023): 463.00 - Voltage: 2.26 - Dust Density: 0.28
Raw Signal Value (0-1023): 431.00 - Voltage: 2.10 - Dust Density: 0.26
Raw Signal Value (0-1023): 409.00 - Voltage: 2.00 - Dust Density: 0.24
Raw Signal Value (0-1023): 430.00 - Voltage: 2.10 - Dust Density: 0.26
Raw Signal Value (0-1023): 413.00 - Voltage: 2.02 - Dust Density: 0.24
Raw Signal Value (0-1023): 377.00 - Voltage: 1.84 - Dust Density: 0.21
Raw Signal Value (0-1023): 453.00 - Voltage: 2.21 - Dust Density: 0.28
Raw Signal Value (0-1023): 368.00 - Voltage: 1.80 - Dust Density: 0.21
Raw Signal Value (0-1023): 367.00 - Voltage: 1.79 - Dust Density: 0.20
Raw Signal Value (0-1023): 364.00 - Voltage: 1.78 - Dust Density: 0.20
Raw Signal Value (0-1023): 361.00 - Voltage: 1.76 - Dust Density: 0.20
Raw Signal Value (0-1023): 357.00 - Voltage: 1.74 - Dust Density: 0.20
Raw Signal Value (0-1023): 356.00 - Voltage: 1.74 - Dust Density: 0.20
Raw Signal Value (0-1023): 358.00 - Voltage: 1.75 - Dust Density: 0.20
Raw Signal Value (0-1023): 357.00 - Voltage: 1.74 - Dust Density: 0.20
Raw Signal Value (0-1023): 345.00 - Voltage: 1.68 - Dust Density: 0.19
Raw Signal Value (0-1023): 309.00 - Voltage: 1.51 - Dust Density: 0.16
Raw Signal Value (0-1023): 375.00 - Voltage: 1.83 - Dust Density: 0.21
Raw Signal Value (0-1023): 395.00 - Voltage: 1.93 - Dust Density: 0.23
Raw Signal Value (0-1023): 421.00 - Voltage: 2.06 - Dust Density: 0.25
Raw Signal Value (0-1023): 441.00 - Voltage: 2.15 - Dust Density: 0.27
Raw Signal Value (0-1023): 343.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 352.00 - Voltage: 1.72 - Dust Density: 0.19
Raw Signal Value (0-1023): 341.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 339.00 - Voltage: 1.66 - Dust Density: 0.18
Raw Signal Value (0-1023): 342.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 307.00 - Voltage: 1.50 - Dust Density: 0.15
Raw Signal Value (0-1023): 335.00 - Voltage: 1.64 - Dust Density: 0.18
Raw Signal Value (0-1023): 343.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 348.00 - Voltage: 1.70 - Dust Density: 0.19
Raw Signal Value (0-1023): 351.00 - Voltage: 1.71 - Dust Density: 0.19
Raw Signal Value (0-1023): 355.00 - Voltage: 1.73 - Dust Density: 0.19
Raw Signal Value (0-1023): 359.00 - Voltage: 1.75 - Dust Density: 0.20
Raw Signal Value (0-1023): 456.00 - Voltage: 2.23 - Dust Density: 0.28
Raw Signal Value (0-1023): 477.00 - Voltage: 2.33 - Dust Density: 0.30
Raw Signal Value (0-1023): 392.00 - Voltage: 1.91 - Dust Density: 0.23
Raw Signal Value (0-1023): 443.00 - Voltage: 2.16 - Dust Density: 0.27
Raw Signal Value (0-1023): 419.00 - Voltage: 2.05 - Dust Density: 0.25
Raw Signal Value (0-1023): 379.00 - Voltage: 1.85 - Dust Density: 0.21
Raw Signal Value (0-1023): 292.00 - Voltage: 1.43 - Dust Density: 0.14
Raw Signal Value (0-1023): 341.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 311.00 - Voltage: 1.52 - Dust Density: 0.16
Raw Signal Value (0-1023): 307.00 - Voltage: 1.50 - Dust Density: 0.15
Raw Signal Value (0-1023): 284.00 - Voltage: 1.39 - Dust Density: 0.14
Raw Signal Value (0-1023): 322.00 - Voltage: 1.57 - Dust Density: 0.17
Raw Signal Value (0-1023): 309.00 - Voltage: 1.51 - Dust Density: 0.16
Raw Signal Value (0-1023): 331.00 - Voltage: 1.62 - Dust Density: 0.17
Raw Signal Value (0-1023): 326.00 - Voltage: 1.59 - Dust Density: 0.17
Raw Signal Value (0-1023): 304.00 - Voltage: 1.48 - Dust Density: 0.15
Raw Signal Value (0-1023): 340.00 - Voltage: 1.66 - Dust Density: 0.18
Raw Signal Value (0-1023): 385.00 - Voltage: 1.88 - Dust Density: 0.22
Raw Signal Value (0-1023): 399.00 - Voltage: 1.95 - Dust Density: 0.23
Raw Signal Value (0-1023): 420.00 - Voltage: 2.05 - Dust Density: 0.25
Raw Signal Value (0-1023): 448.00 - Voltage: 2.19 - Dust Density: 0.27
Raw Signal Value (0-1023): 479.00 - Voltage: 2.34 - Dust Density: 0.30
Raw Signal Value (0-1023): 424.00 - Voltage: 2.07 - Dust Density: 0.25
Raw Signal Value (0-1023): 438.00 - Voltage: 2.14 - Dust Density: 0.26
Raw Signal Value (0-1023): 438.00 - Voltage: 2.14 - Dust Density: 0.26
Raw Signal Value (0-1023): 330.00 - Voltage: 1.61 - Dust Density: 0.17
Raw Signal Value (0-1023): 352.00 - Voltage: 1.72 - Dust Density: 0.19
Raw Signal Value (0-1023): 350.00 - Voltage: 1.71 - Dust Density: 0.19
Raw Signal Value (0-1023): 343.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 314.00 - Voltage: 1.53 - Dust Density: 0.16
Raw Signal Value (0-1023): 305.00 - Voltage: 1.49 - Dust Density: 0.15
Raw Signal Value (0-1023): 306.00 - Voltage: 1.49 - Dust Density: 0.15
Raw Signal Value (0-1023): 317.00 - Voltage: 1.55 - Dust Density: 0.16
Raw Signal Value (0-1023): 341.00 - Voltage: 1.67 - Dust Density: 0.18
Raw Signal Value (0-1023): 361.00 - Voltage: 1.76 - Dust Density: 0.20
Raw Signal Value (0-1023): 384.00 - Voltage: 1.88 - Dust Density: 0.22
Raw Signal Value (0-1023): 417.00 - Voltage: 2.04 - Dust Density: 0.25
Raw Signal Value (0-1023): 435.00 - Voltage: 2.12 - Dust Density: 0.26
Raw Signal Value (0-1023): 446.00 - Voltage: 2.18 - Dust Density: 0.27
Raw Signal Value (0-1023): 310.00 - Voltage: 1.51 - Dust Density: 0.16
Raw Signal Value (0-1023): 462.00 - Voltage: 2.26 - Dust Density: 0.28
Raw Signal Value (0-1023): 432.00 - Voltage: 2.11 - Dust Density: 0.26
Raw Signal Value (0-1023): 391.00 - Voltage: 1.91 - Dust Density: 0.22
Raw Signal Value (0-1023): 339.00 - Voltage: 1.66 - Dust Density: 0.18
Raw Signal Value (0-1023): 324.00 - Voltage: 1.58 - Dust Density: 0.17
Raw Signal Value (0-1023): 306.00 - Voltage: 1.49 - Dust Density: 0.15
Raw Signal Value (0-1023): 294.00 - Voltage: 1.44 - Dust Density: 0.14
Raw Signal Value (0-1023): 283.00 - Voltage: 1.38 - Dust Density: 0.13
Raw Signal Value (0-1023): 274.00 - Voltage: 1.34 - Dust Density: 0.13

If I connect the green wire to A0 and Yellow wire to D2 I get below result

Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10
Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10
Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10
Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10
Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10
Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10

I am not really sure whether I am getting the correct result or not, and have I hooked up correctly.

1

The outline diagram shows the connection order:

enter image description here

As you can see from the image in the second row pin 1 is closest to the edge of the unit. In your image that is red. So following those down and matching them to the "Terminal Configuration":

  1. V-LED = Red (Connect to 5V via resistor)
  2. LED-GND = Black (GND)
  3. LED = Yellow (D2)
  4. S-GND = White (GND)
  5. Vo = Green (A0)
  6. Vcc = Blue (Connect direct to 5V)
| improve this answer | |
  • connecting this way gives this result: Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10 Raw Signal Value (0-1023): 0.00 - Voltage: 0.00 - Dust Density: -0.10 – Ciasto piekarz Oct 23 '17 at 13:31
  • The way you wired it before may have killed the IR LED through over-current... – Majenko Oct 23 '17 at 13:32
  • is IR LED replaceable manually by soldering ? – Ciasto piekarz Oct 23 '17 at 13:47
  • If you can get to it, possibly. Unlikely though for a novice. – Majenko Oct 23 '17 at 13:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.