专业版
#第九届立创电赛#非接触式酒精浓度测量仪

创建时间:4周前

57 0

描述

<div class="document"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">注:* 为必填项</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><strong><span style="color: #0093e6;">请在报名阶段填写 ↓</span></strong></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">* 1、项目功能介绍</h3> <p><span style="font-family: 宋体; font-size: 16px;">在传统的酒精浓度检测过程中传感器与溶液需要直接接触,并且测试者常常需要与被测溶液接触。工业中测试的液体大多数是具有一定危险性和腐蚀性,对于测量器件的材料和性能要求比较高,且测试人员在测量过程中存在较高的安全隐患。而非接触式酒精检测不需要直接接触液体,不会造成卫生隐患,易于安装和维护;抗干扰能力强:即使在恶劣的环境下,也能稳定工作,提供准确的信息。因此非接触酒精浓度测量仪具有很高的实用性和安全性。</span></p> <p><span style="font-size: 16px;"><span style="font-family: 宋体;">非接触式酒精检测仪采用光谱分析法,基于朗伯比尔定律,通过光强吸收进行酒精浓度的测量,设计并制作专用的电路与算法进行数据的整合与输出。采用透射近红外光谱测量方案,使用波长为</span><span style="font-family: Times New Roman;">1200nm-1500nm</span><span style="font-family: 宋体;">的</span><span style="font-family: Times New Roman;">LED</span><span style="font-family: 宋体;">红外二极管照射比色皿中的酒精,利用酒精对光强透过率的差异,在比色皿的另一侧用</span><span style="font-family: Times New Roman;">InGaAs</span><span style="font-family: 宋体;">的</span><span style="font-family: Times New Roman;">PIN</span><span style="font-family: 宋体;">二极管探测透射光强,通过转化得到光源的衰减度。使用玻璃酒精密度仪进行酒精浓度的标定,通过大量的实验数据以及理论数据的分析得到最佳的浓度</span><span style="font-family: Times New Roman;">-</span><span style="font-family: 宋体;">衰减度模型,最后通过浓度与温度补偿算法得到最终的浓度值。</span></span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*2、项目属性</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">参加大学生光电设计竞赛全国一等奖</p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">* 3、开源协议</h3> <p>1. <span style="font-family: 宋体;">许可条款</span><br><span style="font-family: 宋体;">本项目采用</span> MIT License <span style="font-family: 宋体;">开源协议。您可以自由使用、复制、修改和分发本项目的代码和文档。</span></p> <p> 2. <span style="font-family: 宋体;">权利声明</span><br><span style="font-family: 宋体;">本项目的所有权利归原作者所有。您在使用本项目时,必须保留原作者的版权声明和许可条款。</span></p> <p>3. <span style="font-family: 宋体;">免责声明</span><br><span style="font-family: 宋体;">本项目按</span><span style="font-family: Times New Roman;">“</span><span style="font-family: 宋体;">现状</span><span style="font-family: Times New Roman;">”</span><span style="font-family: 宋体;">提供,不提供任何明示或暗示的保证。原作者不对因使用本项目而导致的任何直接或间接损失承担责任。</span></p> <p>4. <span style="font-family: 宋体;">贡献</span><br><span style="font-family: 宋体;">欢迎任何形式的贡献。请在提交代码之前,确保遵循本项目的代码风格和贡献指南。</span></p> <p>5. <span style="font-family: 宋体;">其他条款</span><br><span style="font-family: 宋体;">若您修改了本项目的代码并重新发布,请在文档中注明您所做的更改。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><strong><span style="color: #0093e6;">请在竞赛阶段填写 ↓</span></strong></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*4、硬件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p><span style="font-family: 宋体;">硬件总体框架分为红外光源、温度传感器,数据采集模块、显示模块、按键模块、主控模块、电源模块,</span><span style="font-family: Times New Roman;">LED</span><span style="font-family: 宋体;">指示模块。主控模块对温度传感器模块,数据采集模块、显示模块、按键模块进行控制,数据采集模块将电压数据传入到单片机中单片机对数据进行处理和分析得到酒精浓度,再传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示模块中进行显示。温度采集模块将采集到的温度数据传入到单片机中进行数据处理和分析,传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">中显示,根据得到的温度进行温度补偿。如下图</span><span style="font-family: 宋体;">所示。</span></p> <p><span style="font-family: 宋体;">主控模块:对整个系统的工作数据进行处理并发出指令。</span></p> <p><span style="font-family: 宋体;">显示模块:显示温度、电压、酒精浓度信息。</span></p> <p><span style="font-family: 宋体;">数据采集模块:测量实时红外透射光强信息并处理成数字电压信号。</span></p> <p><span style="font-family: 宋体;">温度采集模块:对周围环境温度实时采集并传入单片机。</span></p> <p><span style="font-family: 宋体;">按键模块:设定</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示内容。</span></p> <p><span style="font-family: 宋体;">近红外光源:发出稳定光强的近红外光照射溶液。</span></p> <p><span style="font-family: Times New Roman;">LED</span><span style="font-family: 宋体;">指示模块:指示测试溶液浓度是否超出范围。</span></p> <p><img src="//image.lceda.cn/pullimage/wINgnFjeyfqG4po2sypR5DRtrEnWj2jTWQRmRGq6.jpeg" alt="" width="1328" height="735"></p> <p><span style="font-family: 宋体;">主控采用</span><span style="font-family: Times New Roman;">STM32F103C8T6</span><span style="font-family: 宋体;">型号,进过前期器材选型,该型号芯片可以完全满足项目的开发,外设接口丰富,性价比较高。</span><span style="font-family: Times New Roman;">STM32</span><span style="font-family: 宋体;">的最小系统电路包括时钟电路,复位电路,电源电路以及</span><span style="font-family: Times New Roman;">SWD</span><span style="font-family: 宋体;">下载电路。时钟电路提供一个稳定的时钟信号来驱动单片机内部运行,通常包括一个晶体振荡器和一个时钟分频器。晶体振荡器由</span><span style="font-family: Times New Roman;">8M</span><span style="font-family: 宋体;">的陶瓷晶振产生一个稳定的时钟信号,分频器将这个信号分频成适合单片机内部使用的频率。复位电路包括一个复位电路芯片和一个复位按钮,将单片机初始化为一个已知的状态,确保其正确地启动。</span><span style="font-family: Times New Roman;">STM</span><span style="font-family: 宋体;">的芯片供电电压为</span><span style="font-family: Times New Roman;">3.3V</span><span style="font-family: 宋体;">,是通过</span><span style="font-family: Times New Roman;">LDO</span><span style="font-family: 宋体;">(三端稳压器)输出</span><span style="font-family: Times New Roman;">3.3V</span><span style="font-family: 宋体;">再通过保险丝输出到</span><span style="font-family: Times New Roman;">STM32</span><span style="font-family: 宋体;">。</span></p> <p><span style="font-family: 宋体;">如图</span><span style="font-family: 宋体;">所示,主控芯片的最小系统原理图,</span><span style="font-family: Times New Roman;">STM32F103C8T6</span><span style="font-family: 宋体;">芯片的供电电压正常为</span><span style="font-family: Times New Roman;">3.3V</span><span style="font-family: 宋体;">,需要通过电源滤波电路之后为芯片供电。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/00oKU9fcL5Sant15i24UkuGGLgLHahPoTrbDUr39.jpeg" alt="" width="1232" height="632">近红外光源</span></p> <p><span style="font-family: 宋体;">近红外光源电路采用的是红外发光二极管作为发光源,只需在两端加入驱动电压,二极管就可以发出红外光。由于此二极管的工作电压在</span><span style="font-family: Times New Roman;">1-1.2V</span><span style="font-family: 宋体;">,因此采用</span><span style="font-family: Times New Roman;">1.2V</span><span style="font-family: 宋体;">的电源作为驱动电源,同时,在正级串联一个限流电阻防止电流过大导致二极管损坏,测量二极管工作时的电压在</span><span style="font-family: Times New Roman;">1.15V</span><span style="font-family: 宋体;">左右,再根据二极管的允许电流在</span><span style="font-family: Times New Roman;">20-30mA</span><span style="font-family: 宋体;">之间,计算出限流电阻为</span><span style="font-family: Times New Roman;">1.7</span><span style="font-family: Times New Roman;">Ω</span><span style="font-family: 宋体;">到</span><span style="font-family: Times New Roman;">2.5</span><span style="font-family: 宋体;">Ω之间,通过实验最终选用</span><span style="font-family: Times New Roman;">2</span><span style="font-family: Times New Roman;">Ω</span><span style="font-family: 宋体;">的电阻作为其限流电阻。电路图如图</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/CIC6kWUKIiqx6kXWTWUFZRtKJitm6FosqBN7kmIx.jpeg" alt="" width="228" height="456"></span></p> <p><span style="font-family: 宋体;">数采集处理模块</span></p> <p><span style="font-family: 宋体;">数据采集模块分为传感器模块,信号滤波处理以及</span><span style="font-family: Times New Roman;">ADC</span><span style="font-family: 宋体;">采样三部分。传感器部将光信号转换电压信号,信号滤波处理模块将电压信号中的噪声滤除,输出稳定的电压信号。最后将处理后的模拟信号通过</span><span style="font-family: Times New Roman;">ADC</span><span style="font-family: 宋体;">采样转换为数字信号,传入</span><span style="font-family: Times New Roman;">STM32</span><span style="font-family: 宋体;">中进行数据分析和处理。</span></p> <p><span style="font-family: 宋体;">光电二极管传感器电路将光强转化成电压信号,电路图如图</span><span style="font-family: Times New Roman;">3.18</span><span style="font-family: 宋体;">所示,中间的引脚</span><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">悬空,引脚</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">3</span><span style="font-family: 宋体;">分别为二极管的阳极和阴极,阳极上方连接到</span><span style="font-family: Times New Roman;">3.3V</span><span style="font-family: 宋体;">电源上,同时串联一个限流电阻,同时为了方便进行温度补偿,再串联一个电位器控制输出电压;在其阴级和阳极之间并联一个电容起到信号滤波作用。当光照射到传感器时,电子获得了光子的能量从价带跃迁到导带,从而产生自由电子和空穴,导致暗电流增大,从而使得阳极到阴极之间的正向电流减小,输出电压也就减小。光强越大暗电流就越大,使得电压也就越小,从而实现光强信号到电压信号的转变。</span></p> <p><span style="font-family: 宋体;">信号滤波处理电路由一个运算放大器构成的电压跟随器和一个</span><span style="font-family: Times New Roman;">RC</span><span style="font-family: 宋体;">滤波电路构成(如图</span><span style="font-family: 宋体;">所示)。运算放大器采用</span><span style="font-family: Times New Roman;">LM321MFX</span><span style="font-family: 宋体;">芯片,将该芯片的正输入端和负输入端直接接入到输出端,构成一个电压跟随器,使得输入的电压阻抗极大,减小对信号的损失,保证电压信号不会被其他电路拉低;后面接一个</span><span style="font-family: Times New Roman;">RC</span><span style="font-family: 宋体;">低通滤波电路,可以去除电压信号中的高频噪声,如升压模块的干扰信号。</span></p> <p><span style="font-family: Times New Roman;">ADC</span><span style="font-family: 宋体;">电路采用</span><span style="font-family: Times New Roman;">ADS1115BQDGSRQ1</span><span style="font-family: 宋体;">芯片进行模数转换,该芯片能将模拟量转换成</span><span style="font-family: Times New Roman;">16</span><span style="font-family: 宋体;">为的数字量,传入到单片机中。将</span><span style="font-family: Times New Roman;">ADDR</span><span style="font-family: 宋体;">上拉一个电阻置</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">使得输入数据地址</span><span style="font-family: Times New Roman;">AIN3</span><span style="font-family: 宋体;">,电压信号通过</span><span style="font-family: Times New Roman;">AIN3</span><span style="font-family: 宋体;">引脚输入到芯片中。由</span><span style="font-family: Times New Roman;">ADS1115BQDGSRQ1</span><span style="font-family: 宋体;">芯片采用的是</span><span style="font-family: Times New Roman;">IIC</span><span style="font-family: 宋体;">通信协议进行数据传输,因此引脚</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">在硬件上要上拉一个电阻使得空闲状态下为高电平。</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">引脚输出转换后的数字信号数据,连接到单片机</span><span style="font-family: Times New Roman;">PB9</span><span style="font-family: 宋体;">端口传入到单片机中;</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">引脚为时钟输入引脚,锁定</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">上的数据,将其连接到单片机的</span><span style="font-family: Times New Roman;">PB8</span><span style="font-family: 宋体;">端口,由单片机提供时钟信号。电路图如图</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/H10mAuuxfPWJTb9xK37MYyJE9OYWDTHELfqjg7k5.jpeg" alt="" width="706" height="333"><img src="//image.lceda.cn/pullimage/csz5q7WDD8y7YCAxK8nB4ZtoJWQzpkNB3mAzIPd4.jpeg" alt="" width="298" height="221"><img src="//image.lceda.cn/pullimage/ScVS6iG4Jl0w11rOq7Vho1wTRwTVAOvzDwfURx28.jpeg" alt="" width="295" height="176">OLED驱动电路设计</span></p> <p><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">驱动</span><span style="font-family: Times New Roman;">IC</span><span style="font-family: 宋体;">是</span><span style="font-family: Times New Roman;">SSD1306</span><span style="font-family: 宋体;">,</span><span style="font-family: Times New Roman;">SSD1306</span><span style="font-family: 宋体;">可以通过</span><span style="font-family: Times New Roman;">SPI</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">接口与微控制器进行通信,</span><span style="font-family: Times New Roman;">SPI</span><span style="font-family: 宋体;">接口速度快但需要多个引脚,</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">接口引脚少但速度较慢,由于该项目不需要太高的刷新频率,采用的是</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">接口。</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">总线是一种双向串行通信总线,由两根线构成:</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">(串行数据线)和</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">(串行时钟线)。</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">负责数据的传输,而</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">则负责数据的时序同步。</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">总线上的设备都有一个唯一的地址,通过地址来识别每个设备。</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示屏模块通常有四个引脚分别为</span><span style="font-family: Times New Roman;">VCC</span><span style="font-family: 宋体;">(电源正极)、</span><span style="font-family: Times New Roman;">GND</span><span style="font-family: 宋体;">(电源负极)、</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">(串行时钟线)和</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">(串行数据线)。其中</span><span style="font-family: Times New Roman;">VCC</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">GND</span><span style="font-family: 宋体;">分别连接到单片机的电源正负极,而</span><span style="font-family: Times New Roman;">SCL</span><span style="font-family: 宋体;">和</span><span style="font-family: Times New Roman;">SDA</span><span style="font-family: 宋体;">分别连接到单片机的</span><span style="font-family: Times New Roman;">I2C</span><span style="font-family: 宋体;">总线上。</span></p> <p><span style="font-family: 宋体;">本次设计中使用</span><span style="font-family: Times New Roman;">STM32F103C8T6</span><span style="font-family: 宋体;">单片机的</span><span style="font-family: Times New Roman;">PB10</span><span style="font-family: 宋体;">端口作为时钟输入引脚,</span><span style="font-family: Times New Roman;">PB11</span><span style="font-family: 宋体;">作为数据输入管脚。如图</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/TD4o2mIefmmScAEPx7iRvw87b76nOJ2gR0mik0F7.jpeg" alt="" width="280" height="190"></span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/bgngYxd6x6eJSTivGMFz1IrL7NlHxzXtE4gMT98V.jpeg" alt="" width="229" height="107"></span></p> <p><span style="font-family: 宋体;">硬件电路设计</span></p> <p><span style="font-family: 宋体;">通过电路功能实现逻辑以及电路的复杂程度和元件的尺寸进行布局规划。考虑信号流向和电磁兼容性(</span><span style="font-family: Times New Roman;">EMC</span><span style="font-family: 宋体;">),将元件放置在</span><span style="font-family: Times New Roman;">PCB</span><span style="font-family: 宋体;">板上</span><span style="font-family: 宋体;">。最后连接元件引脚进行布线,对信号路径优化减少干扰,得到</span><span style="font-family: Times New Roman;">PCB</span><span style="font-family: 宋体;">板</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/mZy1E077W8wfA63b4ctPNFr6lZcuFIcH1XO9SqhM.jpeg" alt="" width="1234" height="579"><img src="//image.lceda.cn/pullimage/8r1T3Os7wvlqdDVIhp0dvYuFxrTkC9kLSVBCmGVI.jpeg" alt="" width="1027" height="597"></span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*5、软件部分</h3> <hr class="horizontal-splitline normal-bold-2"> <p><span style="font-family: 宋体;">整体设计</span></p> <p><span style="font-family: 宋体;">程序开始后对各个元器件子程序以及系统进行初始化,打开</span><span style="font-family: Times New Roman;">DS18B20</span><span style="font-family: 宋体;">传感器,对温度数据进行处理后传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">进行显示,处理光电传感器电路收集到的电压信号传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">进行显示。将电压数据转换为酒精浓度,然后判断浓度值是否在量程内,若在超出量程则</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示</span><span style="font-family: Times New Roman;">OVER RANGE</span><span style="font-family: 宋体;">,同时</span><span style="font-family: Times New Roman;">LED1</span><span style="font-family: 宋体;">,</span><span style="font-family: Times New Roman;">LED3</span><span style="font-family: 宋体;">闪烁;若在量程内,设置</span><span style="font-family: Times New Roman;">LED1</span><span style="font-family: 宋体;">,</span><span style="font-family: Times New Roman;">LED3</span><span style="font-family: 宋体;">熄灭,然后扫描按键判断按键值,为</span><span style="font-family: Times New Roman;">0</span><span style="font-family: 宋体;">,直接将数据传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">中显示,为</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">则计算出近</span><span style="font-family: Times New Roman;">50</span><span style="font-family: 宋体;">次浓度的平均值,然后传入</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">中进行显示,最后返回到温度电压采集程序。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/eGG0QdgI3XOaAbuJEQUF7iIYeuKoZMYqgTcpntYI.jpeg" alt=""></span></p> <p><span style="font-family: 宋体;">DS18B20</span></p> <p><span style="font-family: 宋体;">先对</span><span style="font-family: Times New Roman;">DS18B20</span><span style="font-family: 宋体;">进行初始化(端口定义与</span><span style="font-family: Times New Roman;">GPIO</span><span style="font-family: 宋体;">口的工作模式进行设置),通过</span><span style="font-family: Times New Roman;">IIC</span><span style="font-family: 宋体;">通讯协议发送指令打开</span><span style="font-family: Times New Roman;">DS18B20</span><span style="font-family: 宋体;">,读取里面的温度数据,然后对得到的二进制数字温度数据进行转换,得到室内环境温度数据,传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">中显示。最后回到发送打开指令的程序循环。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/03E7saYyCWtPi7OpIzJlPzKO1t3NLt6nLFpNWWUu.jpeg" alt="" width="285" height="800">按键功能程序介绍</span></p> <p><span style="font-family: 宋体;">按键功能主要是对</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示模块的显示内容进行设置,通过此模块可以提高人机交互性,</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">显示内容通过按键进行人为改动。一共有三个按键(</span><span style="font-family: Times New Roman;">KEY0</span><span style="font-family: 宋体;">对应</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">,</span><span style="font-family: Times New Roman;">KEY1</span><span style="font-family: 宋体;">对应</span><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">,</span><span style="font-family: Times New Roman;">KEY3</span><span style="font-family: 宋体;">对应</span><span style="font-family: Times New Roman;">2</span><span style="font-family: 宋体;">),先对按键所连接的</span><span style="font-family: Times New Roman;">IO</span><span style="font-family: 宋体;">口进行设置,按键扫描返回相应值,传入到</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">进行判断。最后回到扫描按键的程序循环。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/qwJE9SHigRLcny2QMzGINYpianLHAt03xLOsAZaJ.jpeg" alt="" width="598" height="1063">OLED显示程序设计</span></p> <p><span style="font-family: 宋体;">先对</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">初始化,设置</span><span style="font-family: Times New Roman;">PB8</span><span style="font-family: 宋体;">、</span><span style="font-family: Times New Roman;">PB9</span><span style="font-family: 宋体;">为开漏输出模式,打开显示屏,通过</span><span style="font-family: Times New Roman;">IIC</span><span style="font-family: 宋体;">通讯协议发送指令设置</span><span style="font-family: Times New Roman;">OLED</span><span style="font-family: 宋体;">的寻址模式为页面寻址,设置显示屏亮度、分辨率等信息,接受数据采集模块的数据并且显示温度和电压数据,设置浓度信息显示到第三排,判断按键值,如果为</span><span style="font-family: Times New Roman;">1</span><span style="font-family: 宋体;">则显示静态浓度平均数据,为</span><span style="font-family: Times New Roman;">0</span><span style="font-family: 宋体;">显示动态浓度数据。最后回到显示数据的程序循环。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/w1SZc9yeEgqXQaNguUAIJgaWjsTZu4KQas3brXS7.jpeg" alt="">LED指示灯模块设计</span></p> <p><span style="font-family: Times New Roman;">LED</span><span style="font-family: 宋体;">指示灯是用来指示测量仪的工作状态,超出量程就闪烁,正常工作下处于熄灭状态。</span></p> <p><span style="font-family: 宋体;"><img src="//image.lceda.cn/pullimage/olAZzyYxwb7mUDboXHjDh6N9WvJIeL6HK4wKkBsK.jpeg" alt="" width="598" height="911"></span></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><a title="工程代码附件" href="https://www.hostize.com/zh/edit/pZX8_AM6Koog89dc3aK_Y" target="_blank">https://www.hostize.com/zh/edit/pZX8_AM6Koog89dc3aK_Y</a></h3> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*6、BOM清单</h3> <hr class="horizontal-splitline normal-bold-2"> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">请输入内容…</span></p> <table style="border-collapse: collapse; width: 1110.03pt;" width="2590"> <tr style="height: 14.10pt;"> <td style="height: 14.10pt; width: 111.00pt;" width="259" height="32">No.</td> <td style="width: 111.00pt;" width="259">Quantity</td> <td style="width: 111.00pt;" width="259">Comment</td> <td style="width: 111.00pt;" width="259">Designator</td> <td style="width: 111.00pt;" width="259">Footprint</td> <td style="width: 111.00pt;" width="259">Value</td> <td style="width: 111.00pt;" width="259">Manufacturer Part</td> <td style="width: 111.00pt;" width="259">Manufacturer</td> <td style="width: 111.00pt;" width="259">Supplier Part</td> <td style="width: 111.00pt;" width="259">Supplier</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">1</td> <td>1</td> <td>10u</td> <td>C1</td> <td>C0805</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">2</td> <td>4</td> <td>10uF</td> <td>C3,C4,C5,C8</td> <td>CAP-SMD_L2.0-W1.2</td> <td> </td> <td>TAJR106K006RNJ</td> <td>Kyocera AVX</td> <td>C132274</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">3</td> <td>1</td> <td>0.1u</td> <td>C6</td> <td>C0805</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">4</td> <td>2</td> <td>0.1u</td> <td>C7,C10</td> <td>C0603</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">5</td> <td>2</td> <td>22u</td> <td>C13,C14</td> <td>C0603</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">6</td> <td>2</td> <td>HX25035-4A</td> <td>CN1,CN4</td> <td>CONN-TH_4P-P2.50_HX25035-4A</td> <td> </td> <td>HX25035-4A</td> <td>HX(红星)</td> <td>C442380</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">7</td> <td>1</td> <td>用户指示灯1</td> <td>LED7</td> <td>LED0805_RED</td> <td> </td> <td>17-21SURC/S530-A3/TR8</td> <td>EVERLIGHT(台湾亿光)</td> <td>C72037</td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">8</td> <td>1</td> <td>用户指示灯2</td> <td>LED8</td> <td>LED0805_RED</td> <td> </td> <td>17-21SURC/S530-A3/TR8</td> <td>EVERLIGHT(台湾亿光)</td> <td>C72037</td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">9</td> <td>1</td> <td>用户指示灯3</td> <td>LED9</td> <td>LED0805_RED</td> <td> </td> <td>17-21SURC/S530-A3/TR8</td> <td>EVERLIGHT(台湾亿光)</td> <td>C72037</td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">10</td> <td>1</td> <td>10Ω</td> <td>R1</td> <td>R0805</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">11</td> <td>1</td> <td>10k</td> <td>R2</td> <td>R0805</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">12</td> <td>1</td> <td>2R</td> <td>R3</td> <td>R0805</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">13</td> <td>1</td> <td>10Ω</td> <td>R5</td> <td>RES-ADJ-TH_3296X</td> <td> </td> <td>3296X-1-100LF</td> <td>BOURNS</td> <td>C111790</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">14</td> <td>3</td> <td>1k</td> <td>R7,R8,R9</td> <td>R0603</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">15</td> <td>1</td> <td>10k</td> <td>RN1</td> <td>RES-ARRAY-SMD_0603-8P-L3.2-W1.6-BL</td> <td> </td> <td>WA06X101JTL</td> <td>WTC</td> <td>C168187</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">16</td> <td>4</td> <td>用户开关2</td> <td>SW1,SW2,SW3,SW4</td> <td>SW-SMD_4P-L4.5-W4.5-P3.00-LS7.0</td> <td> </td> <td>4.5x4.5x7.1 SMD Tactile Switch</td> <td>ReliaPro</td> <td>C28777</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">17</td> <td>1</td> <td>SR-STM32F103C8T6/C6T6-4</td> <td>U1</td> <td>SR-STM32F103C8T6/C6T6-4</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">18</td> <td>1</td> <td>LM321MFX</td> <td>U2</td> <td>SOT-23-5_L2.9-W1.6-P0.95-LS2.8-BL</td> <td> </td> <td>LM321MFX</td> <td>TECH PUBLIC(台舟)</td> <td>C3011196</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">19</td> <td>8</td> <td>焊盘</td> <td>U3,U6,U8,U9,U11,U16,U17,U18</td> <td>异形焊盘</td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">20</td> <td>1</td> <td>AMS1117-1.2RG</td> <td>U4</td> <td>SOT-223-3_L6.4-W3.5-P2.30-LS7.0-BR</td> <td> </td> <td>AMS1117DCY-1.5RG</td> <td>HGC(深圳汉芯)</td> <td>C2977154</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">21</td> <td>1</td> <td>ADS1115BQDGSRQ1</td> <td>U5</td> <td>VSSOP-10_L3.0-W3.0-P0.50-LS4.9-BL</td> <td> </td> <td>ADS1115BQDGSRQ1</td> <td>TI(德州仪器)</td> <td>C2868291</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">22</td> <td>1</td> <td>AMS1117-3.3RG</td> <td>U7</td> <td>SOT-223-3_L6.4-W3.5-P2.30-LS7.0-BR</td> <td> </td> <td>AMS1117DCY-1.5RG</td> <td>HGC(深圳汉芯)</td> <td>C2977154</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">23</td> <td>1</td> <td>SS12D06弯针</td> <td>U10</td> <td>SW-TH_3P-SS12D06-1</td> <td> </td> <td>SS12D06弯针</td> <td>null</td> <td>C9900027365</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">24</td> <td>1</td> <td>4.7uh</td> <td>U13</td> <td>IND-SMD_L4.6-W4.1-A</td> <td> </td> <td>CKST0402-1uH/M</td> <td>CENKER(岑科)</td> <td>C3002592</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">25</td> <td>1</td> <td>PW5100</td> <td>U14</td> <td>SOT-23-5_L2.9-W1.6-P0.95-LS2.8-BL</td> <td> </td> <td>PW5100</td> <td>null</td> <td>C9900000624</td> <td>LCSC</td> </tr> <tr style="height: 14.10pt;"> <td style="height: 14.10pt;" height="32">26</td> <td>1</td> <td>OLED</td> <td>U15</td> <td>OLED-TH_L27.8-W27.2-P2.54_C9900033791</td> <td> </td> <td>HS96L03W2C03</td> <td>HS(汉昇)</td> <td>C5248080</td> <td>LCSC</td> </tr> </table> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">注:项目涉及的BOM清单。在<span style="text-decoration: underline;"><a href="https://lceda.cn/editor" target="_blank">嘉立创EDA</a> </span>生成/上传设计文件后,BOM将自动生成至项目详情;建议包括型号、品牌、名称、封装、采购渠道、用途等内容。具体内容和形式应以表达清楚项目构成为准。 </span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">*7、大赛LOGO验证</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">请上传包含大赛logo的项目图片,logo以丝印形式印刷在PCB上面。</span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="color: #95a5a6; font-size: 14px;">点击zip下载大赛logo标识! <span style="text-decoration: underline;"><a href="https://image.lceda.cn/easyedaResource/images/d1bbfd69f9404f56901a0e7b849b7245.rar" target="_blank">(大赛标识).zip</a></span></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><img src="//image.lceda.cn/pullimage/BEEefULtNIDmE2TYaa9hktXiAoyL4tFY5NgBLAnM.png" alt="" width="1874" height="948"><img src="//image.lceda.cn/pullimage/X53J95BIgNCore8MLL4US1uxEYdxMyMS6lK9GIUE.png" alt="" width="2044" height="1000"></p> <h3 class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;">* 8、演示您的项目并录制成视频上传</h3> <hr class="horizontal-splitline normal-bold-2"> <p style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><a title="立创电赛:《非接触式酒精浓度测量仪》-团队介绍" href="https://www.hostize.com/zh/v/vmb3wiXB81" target="_blank">https://www.hostize.com/zh/v/vmb3wiXB81</a></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"><span style="font-size: 14px;"><a href="/posts/de460543d4cf4dacb5f0326612455578" target="_blank">前往查看更多详情 ></a></span></p> <p class="paragraph text-align-type-left pap-line-1.3 pap-line-rule-auto pap-spacing-before-3pt pap-spacing-after-3pt" style="line-height: 1.8;"> </p> </div>

文档

BOM

暂无

附件

暂无

评论(1)

  • 表情
    emoji
    小嘉工作篇
    小嘉日常篇
  • 图片
成功
工程所有者当前已关闭评论
立创电赛 回复
<p>请上传视频哦<br/>~</p>
goToTop
svg-battery svg-battery-wifi svg-books svg-more svg-paste svg-pencil svg-plant svg-ruler svg-share svg-user svg-logo-cn svg-double-arrow