Skip to content

Dust Sensor DSM  #1177

Open
Open
@Laboltus

Description

@Laboltus

Hi.

May be I wrong but I guess you mixed something in examples/DustSensorDSM/DustSensorDSM.ino

ratio = (lowpulseoccupancy-endtime+starttime)/(sampletime_ms*10.0); // Integer percentage 0=>100

  1. lowpulseoccupancy is counted in microseconds but endtime+starttime are in milliseconds. You cannot just subtract one from the other.
  2. according to datasheet the formula is Low ratio[%] = t (sec) / 30 (sec)* 100
    so in code (after adjusting units of measure) it must look like this:
    ratio = lowpulseoccupancy/((endtime-starttime)*10.00);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions