找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
查看: 17029|回复: 35
收起左侧

发个PM2.5检测 带BH1750FVI光照、DHT11温湿度 12864屏的51单片机制作 含程序

  [复制链接]
ID:169459 发表于 2017-3-21 10:48 | 显示全部楼层 |阅读模式
  现在空气污染很严重,尤其是北方地区,所以某一个宝买了一套PM2.5、光照、温湿度及时间一体的散件,自己做了成品。
IMG_20170321_103909.jpg

时钟芯片DS1302,精度一般般,准备换DS3231了。
温湿度芯片DHT11,这个精度更差,准备换DHT22
光照芯片BH1750FVI。
单片机89C52
屏幕是串口并口通用的12864屏

PM2.5检测原理图:
0.png

0.png

单片机源程序:
  1. #include <reg52.h>
  2. #include <intrins.h>
  3. #include "12864.h"
  4. #include "ds1302.h"


  5. typedef   unsigned char BYTE;
  6. typedef   unsigned short WORD;

  7. uint wendu=0;                 //温度变量
  8. uint shidu=0;                  //湿度变量
  9. uint pm25=0;                 //pm2.5变量


  10. uint stwendu=30;                 //温度报警变量
  11. uint stguang=100;                  //光照报警变量
  12. uint stpm25=100;                 //pm2.5报警变量

  13. uchar  hor,min,sec;                 //时分秒
  14. uchar  initial_time[]={0x00,0x00,0x00};                 //时分秒设定
  15. unsigned int guangzhao=0;          //光照变量
  16. float xdata guang=0;                  //光照变量




  17. sbit    DQ=P1^0;        //DHT11         单片机引脚

  18. sbit          SCL=P2^0;      //IIC时钟引脚定义                   读取光照用
  19. sbit          SDA=P2^1;      //IIC数据引脚定义


  20. sbit          k1=P3^2;      //+   按键
  21. sbit          k2=P3^3;      //-
  22. sbit          k3=P3^4;      //设置


  23. sbit          led1=P1^5;      //wendu baojing
  24. sbit          led2=P1^6;      // guangzhao baojing
  25. sbit          led3=P1^7;      //pm2.5baojing

  26. sbit          fmq=P0^0;      //pm2.5baojing

  27. uchar   BUF[8];                         //接收数据缓存区  

  28. unsigned  char xdata dat[6];                                  //串口变量 用于读取pm2.5
  29. unsigned char  k=0;
  30. unsigned char flagcom=0;


  31. unsigned char  xdata    ge,shi,bai,qian,wan;            //显示变量


  32. #define          SlaveAddress   0x46 //定义器件在IIC总线中的从地址,根据ALT  ADDRESS地址引脚不同修改
  33.                               //ALT  ADDRESS引脚接地时地址为0x46,接电源时地址为0x3A

  34. //*****************************************长延时*****************************************
  35. void Delay(unsigned int s)
  36. {
  37.         unsigned int i;
  38.         for(i=0; i<s; i++);
  39.         for(i=0; i<s; i++);
  40. }

  41. void Delay5us()
  42. {
  43.     _nop_();_nop_();_nop_();_nop_();
  44.     _nop_();_nop_();_nop_();_nop_();
  45.         _nop_();_nop_();_nop_();_nop_();
  46.         _nop_();_nop_();_nop_();_nop_();
  47. }

  48. void Delay5ms()
  49. {
  50.     WORD n = 560;

  51.     while (n--);
  52. }
  53. //**************************延时函数

  54. void delay_ms(unsigned int k)        
  55. {                                                
  56. unsigned int i,j;                                
  57. for(i=0;i<k;i++)
  58. {                        
  59. for(j=0;j<121;j++)                        
  60. {;}}                                                
  61. }
  62. //温湿度读取
  63. //初始化DTH11
  64. bit Init_DTH11()
  65. {
  66.   bit flag;
  67.   uchar num;
  68.   DQ=0;
  69.   delay_ms(20);   // >18ms
  70.   DQ=1;
  71.   for(num=0;num<10;num++);   // 20-40us    34.7us
  72.   for(num=0;num<12;num++);
  73.   flag=DQ;
  74.   for(num=0;num<11;num++); //DTH响应80us
  75.   for(num=0;num<24;num++);    //DTH拉高80us
  76.   return flag;
  77. }
  78. //****************************读DTH11数据
  79. uchar DTH11_RD_CHAR()
  80. {
  81.   uchar byte=0;
  82.   uchar num;
  83.   uchar num1;
  84.   while(DQ==1);
  85.   for(num1=0;num1<8;num1++)
  86.   {
  87.    while(DQ==0);
  88.    byte<<=1;     //高位在前
  89.    for(num=0;DQ==1;num++);
  90.    if(num<10)
  91.     byte|=0x00;
  92.    else
  93.     byte|=0x01;
  94.   }
  95.   return byte;
  96. }
  97. //******************************读取DTH11温度和湿度
  98. void  DTH11_DUSHU()
  99. {
  100.   uchar num;
  101.   if(Init_DTH11()==0)
  102.   {
  103.   shidu=DTH11_RD_CHAR();   //
  104.    DTH11_RD_CHAR();
  105.   wendu=DTH11_RD_CHAR();
  106. //        tem=30;
  107.    DTH11_RD_CHAR();
  108.    DTH11_RD_CHAR();
  109.    for(num=0;num<17;num++);  //最后BIT输出后拉低总线50us
  110.    DQ=1;
  111.   }
  112. }



  113. //********************************iic 光照///////////////////////////////////////////
  114. //***************************************************************************************
  115. /**************************************
  116. 起始信号
  117. **************************************/
  118. void BH1750_Start()
  119. {
  120.     SDA = 1;                    //拉高数据线
  121.     SCL = 1;                    //拉高时钟线
  122.     Delay5us();                 //延时
  123.     SDA = 0;                    //产生下降沿
  124.     Delay5us();                 //延时
  125.     SCL = 0;                    //拉低时钟线
  126. }

  127. /**************************************
  128. 停止信号
  129. **************************************/
  130. void BH1750_Stop()
  131. {
  132.     SDA = 0;                    //拉低数据线
  133.     SCL = 1;                    //拉高时钟线
  134.     Delay5us();                 //延时
  135.     SDA = 1;                    //产生上升沿
  136.     Delay5us();                 //延时
  137. }

  138. /**************************************
  139. 发送应答信号
  140. 入口参数:ack (0:ACK 1:NAK)
  141. **************************************/
  142. void BH1750_SendACK(bit ack)
  143. {
  144.     SDA = ack;                  //写应答信号
  145.     SCL = 1;                    //拉高时钟线
  146.     Delay5us();                 //延时
  147.     SCL = 0;                    //拉低时钟线
  148.     Delay5us();                 //延时
  149. }

  150. /**************************************
  151. 接收应答信号
  152. **************************************/
  153. bit BH1750_RecvACK()
  154. {
  155.     SCL = 1;                    //拉高时钟线
  156.     Delay5us();                 //延时
  157.     CY = SDA;                   //读应答信号
  158.     SCL = 0;                    //拉低时钟线
  159.     Delay5us();                 //延时

  160.     return CY;
  161. }

  162. /**************************************
  163. 向IIC总线发送一个字节数据
  164. **************************************/
  165. void BH1750_SendByte(BYTE dat)
  166. {
  167.     BYTE i;

  168.     for (i=0; i<8; i++)         //8位计数器
  169.     {
  170.         dat <<= 1;              //移出数据的最高位
  171.         SDA = CY;               //送数据口
  172.         SCL = 1;                //拉高时钟线
  173.         Delay5us();             //延时
  174.         SCL = 0;                //拉低时钟线
  175.         Delay5us();             //延时
  176.     }
  177.     BH1750_RecvACK();
  178. }

  179. /**************************************
  180. 从IIC总线接收一个字节数据
  181. **************************************/
  182. BYTE BH1750_RecvByte()
  183. {
  184.     BYTE i;
  185.     BYTE dat = 0;

  186.     SDA = 1;                    //使能内部上拉,准备读取数据,
  187.     for (i=0; i<8; i++)         //8位计数器
  188.     {
  189.         dat <<= 1;
  190.         SCL = 1;                //拉高时钟线
  191.         Delay5us();             //延时
  192.         dat |= SDA;             //读数据               
  193.         SCL = 0;                //拉低时钟线
  194.         Delay5us();             //延时
  195.     }
  196.     return dat;
  197. }

  198. //*********************************

  199. void Single_Write_BH1750(uchar REG_Address)
  200. {
  201.     BH1750_Start();                  //起始信号
  202.     BH1750_SendByte(SlaveAddress);   //发送设备地址+写信号
  203.     BH1750_SendByte(REG_Address);    //内部寄存器地址,请参考中文pdf22页
  204.   //  BH1750_SendByte(REG_data);       //内部寄存器数据,请参考中文pdf22页
  205.     BH1750_Stop();                   //发送停止信号
  206. }

  207. //********单字节读取*****************************************
  208. /*
  209. uchar Single_Read_BH1750(uchar REG_Address)
  210. {  uchar REG_data;
  211.     BH1750_Start();                          //起始信号
  212.     BH1750_SendByte(SlaveAddress);           //发送设备地址+写信号
  213.     BH1750_SendByte(REG_Address);                   //发送存储单元地址,从0开始        
  214.     BH1750_Start();                          //起始信号
  215.     BH1750_SendByte(SlaveAddress+1);         //发送设备地址+读信号
  216.     REG_data=BH1750_RecvByte();              //读出寄存器数据
  217.         BH1750_SendACK(1);   
  218.         BH1750_Stop();                           //停止信号
  219.     return REG_data;
  220. }
  221. */
  222. //*********************************************************
  223. //
  224. //连续读出BH1750内部数据
  225. //
  226. //*********************************************************
  227. void Multiple_read_BH1750(void)
  228. {   uchar i;        
  229.     BH1750_Start();                          //起始信号
  230.     BH1750_SendByte(SlaveAddress+1);         //发送设备地址+读信号
  231.         
  232.          for (i=0; i<3; i++)                      //连续读取6个地址数据,存储中BUF
  233.     {
  234.         BUF[i] = BH1750_RecvByte();          //BUF[0]存储0x32地址中的数据
  235.         if (i == 3)
  236.         {

  237.            BH1750_SendACK(1);                //最后一个数据需要回NOACK
  238.         }
  239.         else
  240.         {               
  241.           BH1750_SendACK(0);                //回应ACK
  242.        }
  243.    }

  244.     BH1750_Stop();                          //停止信号
  245.     Delay5ms();
  246. }


  247. //初始化BH1750,根据需要请参考pdf进行修改****
  248. void Init_BH1750()
  249. {
  250.    Single_Write_BH1750(0x01);  

  251. }




  252. void conversion(unsigned int temp_data)  //  数据转换出 个,十,百,千,万
  253. {  
  254.     wan=temp_data/10000 ;
  255.          qian=temp_data%10000/1000;
  256.         bai=temp_data%1000/100;
  257.         shi= temp_data%100/10;
  258.         ge=        temp_data%10;
  259. }



  260. /********************************************************************
  261. du1302 读取时间
  262. ***********************************************************************/



  263. void du_ds1302()
  264. {
  265.     uchar k;
  266.         
  267. //   uchar taddr = 0x81;
  268.   // for (k=0; k<3; k++)
  269. //   {
  270.   //      now_time[k] = read_data_ds1302(taddr);/*格式为: 秒 分 时 日 月 星期 年 */
  271.   //      taddr+= 2;
  272. //   }

  273.    k= read_data_ds1302(0x81);
  274.    k=bcd16(k);
  275.    if(k<60) sec=k;
  276.    if(k>=60){write_data_ds1302(0x8e,0x00); write_data_ds1302(0x80,0);write_data_ds1302(0x8e,0x80);  }
  277.    k= read_data_ds1302(0x83);
  278.    k=bcd16(k);
  279.    if(k<60)min=k;
  280.    k=read_data_ds1302(0x85);
  281.    k=bcd16(k);
  282.    if(k<24) hor=k;



  283. }
  284. void xianshishijian()                                 //显示时间
  285. {


  286. LCD_Setaddress(1,1);

  287. print("时间");
  288. LCD_write_dat(':');
  289. LCD_write_dat(hor/10+0x30);  
  290. LCD_write_dat(hor%10+0x30);
  291. LCD_write_dat('-');
  292. LCD_write_dat(min/10+0x30);  
  293. LCD_write_dat(min%10+0x30);
  294. LCD_write_dat('-');
  295. LCD_write_dat(sec/10+0x30);  
  296. LCD_write_dat(sec%10+0x30);


  297. }


  298. xianshiwsd()//显示温湿度

  299. {

  300.           LCD_Setaddress(2,1);
  301.          //if(wendu>=99)wendu=99;
  302.    print("温度");
  303.    LCD_write_dat(':');
  304.    LCD_write_dat(wendu/10+0x30);  
  305.    LCD_write_dat(wendu%10+0x30);
  306.          LCD_write_dat(' ');
  307.          LCD_Setaddress(2,5);
  308.          print("湿度");
  309.    LCD_write_dat(':');
  310.    LCD_write_dat(shidu/10+0x30);  
  311.    LCD_write_dat(shidu%10+0x30);
  312.          LCD_write_dat('%');
  313.            // LCD_write_dat(' ');



  314. }

  315. void xianshipm()                   //显示pm2.5
  316. {
  317.           if(pm25>=999)pm25=999;
  318.    LCD_Setaddress(3,1);

  319.    print("PM2.5");
  320.    LCD_write_dat(':');
  321.          LCD_write_dat(pm25/100+0x30);
  322.    LCD_write_dat(pm25%100/10+0x30);  
  323.    LCD_write_dat(pm25%10+0x30);
  324.          LCD_write_dat('u');
  325.          LCD_write_dat('g');
  326.          LCD_write_dat('/');
  327.    LCD_write_dat('m');
  328.    LCD_write_dat('3');
  329.          LCD_write_dat(' ');
  330.          LCD_write_dat(' ');

  331. }

  332. void xianshiguangzhao()                           //显示光照
  333. {
  334.    LCD_Setaddress(4,1);
  335.    print("光照");
  336.    LCD_write_dat(':');
  337.    LCD_write_dat(wan+0x30);
  338.    LCD_write_dat(qian+0x30);  
  339.    LCD_write_dat(bai+0x30);
  340.          LCD_write_dat(shi+0x30);
  341.    LCD_write_dat(ge+0x30);
  342.          LCD_write_dat(' ');
  343.          LCD_write_dat('L');
  344.    LCD_write_dat('X');

  345. }





  346. void baojing()
  347. {

  348.   if(wendu>stwendu) led1=0;
  349.   else  led1=1;
  350.   if(guang<stguang)  led2=0;
  351.   else led2=1;
  352.   if(pm25>stpm25)
  353.   {
  354.           led3=0;
  355.           fmq=0;
  356.   
  357.   
  358.   }
  359.   else
  360.   {
  361.   led3=1;
  362.   fmq=1;
  363.   }

  364. }





  365. //////////////////////串口、、、、、、、、、、、、、用来读取 pm2.5/////////////////////////////////////////////////



  366. void UartInit(void)                //2400bps@11.0592MHz
  367. {

  368.   SCON = 0x50;            //8-bit variable UART
  369.         PCON=0X00;
  370.   TMOD = 0x20;            //Set Timer1 as 8-bit auto reload mode
  371.   TH1 = TL1 = 0XF4; //Set auto-reload vaule
  372.   TR1 = 1;                //Timer1 start run



  373.   ES = 0;                 //Enable UART interrupt
  374.   EA = 0;                 //Open master interrupt switch
  375. }

  376. void SendByte(unsigned char dat)
  377. {
  378. SBUF = dat;
  379. while(!TI);
  380.        TI = 0;
  381. }




  382. void UART_SER (void) interrupt 4                                 
  383. {
  384.    
  385.         uint aa;
  386.         if (RI)
  387.     {
  388.         RI = 0;             //Clear receive interrupt flag
  389.         
  390.         dat[k]= SBUF;          //P0 show UART data

  391.                 if(dat[0]!=0xaa) k=0;
  392.                 else k++;           
  393.             if((dat[0]==0xaa)&&(k>5))                                                        //读取pm2.5数据
  394.                 {
  395.                
  396.                     ES=0;
  397.                           EA=0;
  398.                     aa=dat[1]*255+dat[2];
  399.                           if(aa!=0) pm25=aa;
  400.                           flagcom=0;
  401.                            Delay(2000);
  402.                         
  403.                           k=0;

  404.                 }
  405.      }




  406.     if (TI)
  407.     {
  408.         TI = 0;             //Clear transmit interrupt flag

  409.     }


  410. }






  411. //************************************主函数************************************************************
  412. void main(void)
  413. {


  414.         uint flaga=0;                                                  //pm2.5传感器 串口无法读取时正常显示其它数据标志
  415.         unsigned char  aa;                      //按键切换标志
  416.                                                                                  //上电延时
  417.         Delay(6000);                                                 //初始化时钟
  418.   init_ds1302();                                                //时钟初始化
  419.          LCD_draw_clr();                                                //屏幕复位
  420.         k1=1;                                                                //按键引脚拉高
  421.         k2=1;
  422.         k3=1;
  423.         Init_BH1750();                      //初始化BH1750

  424.         flagcom=0;                                                           //串口中断 标志
  425.         UartInit()        ;
  426.         aa=0;
  427.         while(1)
  428.         {
  429.         

  430.                   if(k3==0)                                                                 //设置按键计数
  431.                   {
  432.                    Delay(10000);
  433.                           if(k3==0)
  434.                         {
  435.                         
  436.                           aa++;
  437.                           Delay(2000);
  438.                         }
  439.                   
  440.                   }



  441.                  if((flagcom==0)&(aa==0))                                                 //循环读取数据  flagcom 串口中断标志 aa按键标志

  442.                  {
  443.                Delay(500);
  444.                du_ds1302() ;                                //读取1302时间
  445.                      Delay(500);
  446.          xianshishijian();                         //显示时间
  447.             
  448.         
  449.                       Delay(2000);
  450.                      DTH11_DUSHU();                                   //温度湿度读取
  451.          Delay(100);
  452.         
  453.                      xianshiwsd();                                  // 显示温度湿度
  454.                      Delay(1000);
  455.                      xianshipm();                                  //显示pm2.5
  456.                      Delay(1000);
  457.                      Single_Write_BH1750(0x01);   // 读取 光照
  458.          Single_Write_BH1750(0x10);   // H- resolution mode
  459.                      Delay(180);          //延时

  460.          Multiple_Read_BH1750();       //连续读出数据,存储在BUF中
  461.                      guangzhao=BUF[0];
  462.          guangzhao=(guangzhao<<8)+BUF[1];//合成数据
  463.                      guang=(float)guangzhao/1.2;
  464.                      conversion(guang) ;
  465.          xianshiguangzhao();                                //显示光照
  466.                      baojing();                        //报警函数
  467.                

  468.                     Delay(500);
  469.                     flaga=0;
  470.                     flagcom=1;
  471.                     ES=1;
  472.                     EA=1;
  473.                     Delay(500);
  474.                  }

  475.                 Delay(500);
  476.                 flaga++;


  477.                 if(flaga>=10)
  478.                 {
  479.                   flagcom=0;
  480.                   flaga=0;
  481.                
  482.                 }



  483.             //设置baojingzhi


  484.                  


  485.                
  486.            if(aa>5) aa=0;

  487.             if(aa==1)
  488.           {
  489.                   Delay(5000)        ;
  490.                   LCD_Setaddress(1,1);
  491.               print("      设置    ");

  492.                   LCD_Setaddress(2,1);
  493.               print("温度报警:");
  494.         
  495.                   conversion(stwendu);
  496.                  
  497.                   LCD_write_dat(shi+0x30);
  498.           LCD_write_dat(ge+0x30);
  499.               LCD_write_dat(' ');
  500.                   LCD_write_dat(' ');
  501.                   LCD_write_dat(' ');
  502.                   LCD_write_dat(' ');
  503.                   LCD_write_dat(' ');
  504.                     LCD_Setaddress(3,1);
  505.               print("               ");
  506.                   LCD_Setaddress(4,1);
  507.               print("                ");

  508.                    if(k1==0)
  509.                   {        Delay(500)        ;
  510.                    if(k1==0)
  511.                    {
  512.                             stwendu++;
  513.                    }
  514.                    }

  515.                      if(k2==0)
  516.                   {        Delay(500)        ;
  517.                    if(k2==0)
  518.                    {
  519.                             stwendu--;
  520.                    }

  521.                    }
  522.         
  523.           }


  524.           if(aa==2)
  525.           {

  526.                   LCD_Setaddress(1,1);
  527.               print("      设置    ");

  528.                   LCD_Setaddress(2,1);
  529.               print("光照报警:");
  530.         
  531.                   conversion(stguang);
  532.                   LCD_write_dat(wan+0x30);
  533.                   LCD_write_dat(qian+0x30);
  534.                   LCD_write_dat(bai+0x30);
  535.                   LCD_write_dat(shi+0x30);
  536.           LCD_write_dat(ge+0x30);
  537.               LCD_write_dat(' ');
  538.                     LCD_Setaddress(3,1);
  539.               print("               ");
  540.                   LCD_Setaddress(4,1);
  541.               print("                ");

  542.                    if(k1==0)
  543.                   {        Delay(500)        ;
  544.                    if(k1==0)
  545.                    {
  546.                             stguang++;
  547.                    }
  548.                    }

  549.                      if(k2==0)
  550.                   {        Delay(500)        ;
  551.                    if(k2==0)
  552.                    {
  553.                             stguang--;
  554.                    }

  555.                    }
  556.         
  557.           }

  558.              if(aa==3)
  559.           {

  560.                   LCD_Setaddress(1,1);
  561.               print("      设置    ");

  562.                   LCD_Setaddress(2,1);
  563.               print("PM2.5 ");
  564.                   LCD_Setaddress(2,4);
  565.               print("报警:");


  566. …………余下代码请下载附件…………
复制代码

原理图等资料:
SHEET1.pdf (289.29 KB, 下载次数: 145)

评分

参与人数 2黑币 +10 收起 理由
二狗有春天 + 5 共享资料的黑币奖励!
QY-12345678 + 5 很给力!

查看全部评分

回复

使用道具 举报

ID:171746 发表于 2017-4-9 21:39 | 显示全部楼层
下来做一个。
回复

使用道具 举报

ID:18572 发表于 2017-4-10 16:32 | 显示全部楼层
下载的看不到啊!在下载还要扣币啊
回复

使用道具 举报

ID:171746 发表于 2017-4-16 07:38 | 显示全部楼层
请问:夏普GP2Y10模块怎样接线?谢谢
回复

使用道具 举报

ID:171746 发表于 2017-4-18 09:38 | 显示全部楼层
夏普GP2Y10模块怎样接线?谢谢
回复

使用道具 举报

ID:171746 发表于 2017-4-18 09:38 | 显示全部楼层
lucq7896 发表于 2017-4-16 07:38
请问:夏普GP2Y10模块怎样接线?谢谢

夏普GP2Y10模块怎样接线?
回复

使用道具 举报

ID:171746 发表于 2017-4-20 14:46 | 显示全部楼层
请问:夏普PM2.5模块是怎么接线?能介绍一下吗?
回复

使用道具 举报

ID:161033 发表于 2017-4-20 22:36 | 显示全部楼层
感谢,分要的太多了。
回复

使用道具 举报

ID:192611 发表于 2017-4-23 11:10 | 显示全部楼层
你好,能加一下qq吗,495268118
回复

使用道具 举报

ID:192611 发表于 2017-4-23 11:12 | 显示全部楼层
你好,能加一下qq吗
回复

使用道具 举报

ID:190794 发表于 2017-4-23 20:31 | 显示全部楼层
感觉写的不错,希望可以多聊聊
回复

使用道具 举报

ID:171746 发表于 2017-4-28 13:57 | 显示全部楼层
有做成功的吗?  我做的就PM2.5不显示。
回复

使用道具 举报

ID:198294 发表于 2017-5-8 19:00 | 显示全部楼层
感谢,分要的太多了
回复

使用道具 举报

ID:198390 发表于 2017-5-8 22:10 | 显示全部楼层
下来做毕业设计。
回复

使用道具 举报

ID:199653 发表于 2017-5-22 22:41 | 显示全部楼层
不错不错下载来看看
回复

使用道具 举报

ID:171746 发表于 2017-5-26 16:13 | 显示全部楼层
我做了个,不知为什么PM2.5没有显示,其他都正常。求帮忙。
回复

使用道具 举报

ID:205205 发表于 2017-5-26 20:29 | 显示全部楼层
赞!跟着楼主学习学习!
回复

使用道具 举报

ID:169459 发表于 2017-7-3 15:07 | 显示全部楼层
lucq7896 发表于 2017-4-16 07:38
请问:夏普GP2Y10模块怎样接线?谢谢

只接3根线,+5V  GND 和数据到单片机
回复

使用道具 举报

ID:169459 发表于 2017-7-4 09:28 | 显示全部楼层

不知道PM2.5模块怎么接线的请看这图
回复

使用道具 举报

ID:169459 发表于 2017-7-4 09:30 | 显示全部楼层
lucq7896 发表于 2017-4-18 09:38
夏普GP2Y10模块怎样接线?

回复里已上传实物图,请参照楼下回复
回复

使用道具 举报

ID:169459 发表于 2017-7-4 09:30 | 显示全部楼层
至尊宝123 发表于 2017-4-23 11:10
你好,能加一下qq吗,495268118

回复里已上传实物图,请参照楼下回复的图片
回复

使用道具 举报

ID:218453 发表于 2017-7-10 11:24 | 显示全部楼层
没有黑币怎么破- -
回复

使用道具 举报

ID:75222 发表于 2017-7-18 16:06 | 显示全部楼层
我要赚黑币,顶一个
回复

使用道具 举报

ID:220722 发表于 2017-7-19 14:02 | 显示全部楼层
你好,原理图里面的J1 ISP是什么东西呢?
回复

使用道具 举报

ID:232331 发表于 2017-9-20 18:53 | 显示全部楼层
请问一下12864是怎么接线的,P0.0不是已经接了蜂鸣器了吗
回复

使用道具 举报

ID:146874 发表于 2017-9-29 12:07 | 显示全部楼层
感谢分享 正在学这个
回复

使用道具 举报

ID:146874 发表于 2017-10-6 11:58 | 显示全部楼层
非常好的参考资料,感谢分享
回复

使用道具 举报

ID:237343 发表于 2017-10-8 16:35 | 显示全部楼层
程序很给力
回复

使用道具 举报

ID:146874 发表于 2017-10-9 18:42 | 显示全部楼层
挺不错的参考材料,感谢楼主
回复

使用道具 举报

ID:481853 发表于 2019-3-24 10:46 来自手机 | 显示全部楼层
这个gp2y 后面的型号是多少   我网上看的都是模拟量需要da转换
回复

使用道具 举报

ID:483827 发表于 2019-3-26 10:53 | 显示全部楼层
lucq7896 发表于 2017-5-26 16:13
我做了个,不知为什么PM2.5没有显示,其他都正常。求帮忙。

您好 问题解决了吗   我也遇到了这个问题
回复

使用道具 举报

ID:599670 发表于 2020-5-29 13:49 | 显示全部楼层
这个功能不错,这个换成手机查看最好了。
回复

使用道具 举报

ID:659888 发表于 2020-5-30 08:32 | 显示全部楼层
谢谢,幸好有你!
回复

使用道具 举报

ID:61088 发表于 2020-10-27 15:57 | 显示全部楼层

赞!跟着楼主学习学习!
回复

使用道具 举报

ID:918154 发表于 2021-5-19 09:48 | 显示全部楼层
有人做好了吗,求指导
回复

使用道具 举报

ID:574799 发表于 2021-6-19 20:55 | 显示全部楼层
12864第15脚应该是VCC
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

手机版|小黑屋|51黑电子论坛 |51黑电子论坛6群 QQ 管理员QQ:125739409;技术交流QQ群281945664

Powered by 单片机教程网

快速回复 返回顶部 返回列表