We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3e734d4 commit c146aa2Copy full SHA for c146aa2
libraries/MySensors/examples/DustSensor/DustSensor_SamYoung_DSM501.ino
@@ -97,8 +97,13 @@ void loop()
97
Serial.print("PM10: ");
98
Serial.println(concentrationPM10);
99
Serial.print("\n");
100
+ //ppmv=mg/m3 * (0.08205*Tmp)/Molecular_mass
101
+ //0.08205 = Universal gas constant in atm·m3/(kmol·K)
102
+ int temp=20; //external temperature, if you can replace this with a DHT11 or better
103
+ long ppmv=(concentrationPM10*0.0283168/100/1000) * (0.08205*temp)/0.01;
104
+
105
if ((ceil(concentrationPM10) != lastDUSTPM10)&&((long)concentrationPM10>0)) {
- gw.send(dustMsgPM10.set((long)ceil(concentrationPM10)));
106
+ gw.send(dustMsgPM10.set((long)ppmv));
107
lastDUSTPM10 = ceil(concentrationPM10);
108
}
109
0 commit comments