MIDE CALIDAD DELA AIRE CON MUCHA PRESICION

Dependencies:   mbed

/media/uploads/tony63/pm25.jpg

MEDIDOR DE CALIDAD DEL AIRE MODELO: PMS5303 MUY PRECISO MIDE EL PM-2.5 y OTRAS ESCALAS DE PARTÍCULAS A DIFERENCIA DE LOS OTROS SENSORES, EN ESTA UNIDAD

CABLE ROJO ES +VCC CABLE NEGRO ES GND CABLE AMARILLO ES RX CABLE VERDE ES TX

LOS DATOS SE PRESENTAN EN UNA TERMINAL VIRTUAL SERIAL DE WINDOWS.

SOLO REQUIERE CONECTAR CUATRO PINES ANTERIORES EL CONECTOR DE LA IMAGEN SE DISEÑO EN UNA IMPRESORA 3D Y SE PEGO A LOS CABLES CON CIANOACRILATO TIPO FLEXIBLE. /media/uploads/tony63/cn25.png/media/uploads/tony63/pm25b.png

Files at this revision

API Documentation at this revision

Comitter:
tony63
Date:
Mon May 27 05:08:09 2019 +0000
Commit message:
MEDIDOR DE CALIDAD DEL AIRE

Changed in this revision

PMS1003.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r 0cefe4d28e60 PMS1003.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/PMS1003.lib	Mon May 27 05:08:09 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/jonfer/code/PMS1003/#afde174c0557
diff -r 000000000000 -r 0cefe4d28e60 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon May 27 05:08:09 2019 +0000
@@ -0,0 +1,33 @@
+/*******************************************************************************
+* Referencias
+* [1] https://www.dfrobot.com/wiki/index.php/PM2.5_laser_dust_sensor_SKU:SEN0177
+*******************************************************************************/
+#include "mbed.h"
+#include "pms1003.h"
+ 
+#define LENG 31   //0x42 + 31 bytes equal to 32 bytes
+char buf[LENG];
+ 
+Serial *pc     = new Serial(USBTX, USBRX); // tx, rx
+Serial *device = new Serial(PTE0, PTE1);   // tx, rx
+pms1003 *PM = new pms1003();
+ 
+int main() {
+    while(1) {
+        if(device->readable()) {//if 1
+            //pc.putc(device.getc());
+            if ( device->getc() == 0x42){//if 2
+                device->gets(buf,LENG);
+                
+                if(buf[0] == 0x4d){//if 3
+                
+                    PM->setPM(buf);
+                    pc->printf("*******************************\n");
+                    pc->printf("PM_1.0:%4d [ug/m3]\n",PM->get_PM01Value());
+                    pc->printf("PM_2.5:%4d [ug/m3]\n",PM->get_PM2_5Value());
+                    pc->printf("PM__10:%4d [ug/m3]\n",PM->get_PM10Value());
+                }//if 3
+            }//if 2         
+        }//if 1        
+    }//while
+}// main
\ No newline at end of file
diff -r 000000000000 -r 0cefe4d28e60 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon May 27 05:08:09 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file