1fy07h 发表于 2024-8-18 04:45:35

低代码容易实现MQ-3酒精探测传感器数据采集


    <h1 style="color: black; text-align: left; margin-bottom: 10px;"><strong style="color: blue;">MQ-3酒精探测传感器(AD电压)</strong></h1>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">提示:本教程参考自 FlexLua 官网 ShineBlink 学习板<span style="color: black;">教育</span>资料。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">前言:半导体式传感器和电化学传感器概念科普</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">半导体传感器和电化学传感器的区别. <strong style="color: blue;">半导体传感器</strong>因其<strong style="color: blue;">简单低价</strong><span style="color: black;">已然</span>得到广泛应用,<span style="color: black;">然则</span>又<span style="color: black;">由于</span>它的<strong style="color: blue;"><span style="color: black;">选取</span>性差和稳定性<span style="color: black;">不睬</span>想</strong><span style="color: black;">日前</span>还只是在民用级别<span style="color: black;">运用</span>。而<strong style="color: blue;">电化学传感器</strong>因其<strong style="color: blue;">良好的<span style="color: black;">选取</span>性</strong>和<strong style="color: blue;">高灵敏度</strong>被广泛应用在几乎所有工业场合。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">半导体式原理:</strong>半导体式气体传感器是依据金属氧化物半导体材料,在空气中,在遇到当空气的氧化还原状态<span style="color: black;">出现</span>变化时,半导体才料的电导率会<span style="color: black;">出现</span>相应的变化,<span style="color: black;">例如</span>:当空气中弥漫<span style="color: black;">必定</span>浓度的酒精蒸汽时,二氧化锡半导体材料的电导率会<span style="color: black;">上升</span>,电阻下降;而这种变化的幅度与气体的浓度直接<span style="color: black;">关联</span>,这<span style="color: black;">便是</span>半导体式气体传感器!<span style="color: black;">咱们</span>家庭排油烟机下面的电子鼻<span style="color: black;">便是</span><span style="color: black;">运用</span>的这种传感器。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">电化学式原理</strong>:电化学式气体传感器是依据气体的电化学氧化和还原的原理制备的,他的原理是与<span style="color: black;">咱们</span>的电池几乎相同。<span style="color: black;">例如</span>,<span style="color: black;">咱们</span>检测一氧化碳,CO在电解池的阳极被氧化成二氧化碳,而电解电流与CO的浓度<span style="color: black;">相关</span>。电化学传感器准确而灵敏,<span style="color: black;">然则</span>,<span style="color: black;">因为</span><span style="color: black;">海量</span><span style="color: black;">运用</span>贵金属,<span style="color: black;">另一</span>制作工艺<span style="color: black;">繁杂</span>,<span style="color: black;">因此呢</span>价格较高。气体探测器检测原理的核心部件是传感器按传感器划分有催化燃烧式传感器电化学传感器半导体传感器红外传感器和光离子传感器.催化燃烧式传感器属于高温传感器,其工作原理是气敏材料(如Pt电热丝等)在通电状态下,可燃性气体氧化燃烧<span style="color: black;">或</span>在催化剂<span style="color: black;">功效</span>下氧化燃烧,电热丝<span style="color: black;">因为</span>燃烧而升温,从而使其电阻值<span style="color: black;">出现</span>变化。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">1、</span>传感器介绍</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">MQ-3酒精传感器所<span style="color: black;">运用</span>的气敏材料是在清洁空气中电导率较低的二氧化锡(SnO2)。当酒精传感器所处环境中存在酒精蒸汽时,气体传感器的电导率随空气中酒精气体浓度的<span style="color: black;">增多</span>而增大。<span style="color: black;">运用</span>简单的电路<span style="color: black;">就可</span>将电导率的变化转换为与该气体浓度相对应的输出信号。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">MQ-3半导体酒精传感器对酒精的灵敏度高,<span style="color: black;">能够</span>抵抗汽油、烟雾、水蒸气的干扰。这种气体传感器可检测多种浓度酒精气氛,是一款适合多种应用的低成本传感器。 </p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q9.itc.cn/images01/20240515/3d22cebf4c22411b90632b3435c769ef.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">传感器参数:</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q4.itc.cn/images01/20240515/d75cb14b09d0456e9700b18dbfb4adc7.jpeg" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">3、</span>传感器模块介绍</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• <span style="color: black;">拥有</span>信号输出指示</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• 双路信号输出(模拟量AO输出及TTL电平DO输出)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• TTL输出有效信号为低电平。(当输出低电平时信号灯亮)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• 模拟量输出0~5V电压,浓度越高电压越高。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">1. 外观结构</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q0.itc.cn/images01/20240515/068678cedaa1453a8b4c33e75107b67b.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">2. 电路原理图</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q4.itc.cn/images01/20240515/1640666b55ed44108f7b3400f132309f.jpeg" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">这儿</span><span style="color: black;">咱们</span>只检测AO输出的电压模拟量信号,<span style="color: black;">由于</span>该电压信号<span style="color: black;">能够</span>反映酒精浓度<span style="color: black;">体积</span>。<span style="color: black;">针对</span>DO引脚则<span style="color: black;">运用</span>起来更简单,当酒精浓度大于<span style="color: black;">经过</span>电位器阻值设定的触发阙时,DO输出低电平。<span style="color: black;">倘若</span><span style="color: black;">研发</span>者感兴趣的话<span style="color: black;">能够</span>用Core<span style="color: black;">供给</span>的GPIO库函数来实现,<span style="color: black;">这儿</span>就不<span style="color: black;">触及</span>了。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">3、</span>接线图</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q7.itc.cn/images01/20240515/5d3d984aee3e4b07a39bb20b21540e0e.jpeg" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">4、</span>材料<span style="color: black;">名单</span></strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• MQ-3酒精浓度探测传感器模块</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">5、</span>完整代码</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--配置Core的USB口以虚拟串口模式工作,<span style="color: black;">这般</span>print()输出的内容就<span style="color: black;">能够</span>在电脑串口终端上<span style="color: black;">表示</span>了</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">LIB_UsbConfig("CDC")</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--配置AD电压采集功能,最大值采样值4096对应3.6V输入电压</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--当通道采集满1个点时缓存满,<span style="color: black;">每一个</span>点的采集时间间隔为300ms</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">LIB_ADConfig(1,300000)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--<span style="color: black;">起始</span>大循环</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">while</strong>(GC(1) == <strong style="color: blue;">true</strong>)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">do</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--每隔300ms<span style="color: black;">查找</span>A0通道<span style="color: black;">是不是</span>转换完成</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--<span style="color: black;">研发</span>者<span style="color: black;">亦</span><span style="color: black;">能够</span>将传感器接至A1-A3中的任一通道,<span style="color: black;">亦</span><span style="color: black;">能够</span>多个通道接多个传感器,用法都和下面<span style="color: black;">同样</span></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">LIB_DelayMs(300)</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">A0_full_flag, A0_buf = LIB_ADCheckBufFull("A0")</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">if</strong> A0_full_flag == 1 <strong style="color: blue;">then</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">--打印输出A0通道的AD采样值以及对应的电压值</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">print(string.format("A0=%04d Voltage=%.2fv", A0_buf, A0_buf*3.6/4096.0))</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">end</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">end</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">倘若</span>感兴趣,上面代码中<span style="color: black;">显现</span>的LIB开头的库函数<span style="color: black;">能够</span>在 API文档 中<span style="color: black;">经过</span>Ctrl+F<span style="color: black;">查找</span>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">6、</span>实验过程及结论</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">过程</span>一:上电后二十秒内,等待传感器加热时传感器的输出值</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q5.itc.cn/images01/20240515/4c6c87384cd842b0bd54f16eb5dc7fe6.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">过程</span>二:二十秒加热器过后无酒精状态时传感器的输出值</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q1.itc.cn/images01/20240515/8e769a4bf12c452183c69f59391b8a16.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">过程</span>三:在传感器<span style="color: black;">周边</span>喷洒酒精喷雾时传感器的输出值</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q2.itc.cn/images01/20240515/916f1078a7f44a19b8ed71ec49af2acf.jpeg" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q9.itc.cn/images01/20240515/df804e7b181d480ebbd01bd083be46ff.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">过程</span>四:喷洒酒精喷雾30秒后传感器的输出值</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q6.itc.cn/images01/20240515/d3ee050c5e064933a741cf8841827bf5.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;"><span style="color: black;">过程</span>五:喷洒酒精喷雾90秒后传感器的输出值</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><img src="//q8.itc.cn/images01/20240515/f99e7a6a70ed49daa3260928a1d6fa2e.png" style="width: 50%; margin-bottom: 20px;"></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">结论:</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• 传感器发热是<span style="color: black;">由于</span>里面的电阻丝<span style="color: black;">必须</span>加热,属于正常<span style="color: black;">状况</span>,但<span style="color: black;">倘若</span>非常烫手就可能是<span style="color: black;">反常</span><span style="color: black;">状况</span>了。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• 传感器上电后<span style="color: black;">必须</span>大概20秒的加热时间,之后<span style="color: black;">才可</span>正常<span style="color: black;">测绘</span>。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">• 酒精浓度越高,传感器输出的电压值越大。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><strong style="color: blue;">附:其他和MQ-3类似的半导体式气体传感器</strong></p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;">其他的半导体式气体传感器和MQ-3传感器原理类似,可参考<span style="color: black;">根据</span>上面<span style="color: black;">文案</span>中的内容来<span style="color: black;">研发</span>,但每种传感器的<span style="color: black;">区别</span>处还需您在官网查阅<span style="color: black;">关联</span><span style="color: black;">制品</span>说明书。</p>
    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><a style="color: black;"><span style="color: black;">返回<span style="color: black;">外链论坛:www.fok120.com</span>,查看<span style="color: black;">更加多</span></span></a></p>

    <p style="font-size: 16px; color: black; line-height: 40px; text-align: left; margin-bottom: 15px;"><span style="color: black;">责任编辑:网友投稿</span></p>




听听海 发表于 2024-9-10 02:07:36

i免费外链发布平台 http://www.fok120.com/

j8typz 发表于 6 天前

说得好啊!我在外链论坛打滚这么多年,所谓阅人无数,就算没有见过猪走路,也总明白猪肉是啥味道的。

m5k1umn 发表于 6 天前

你的话语真是温暖如春,让我心生感激。
页: [1]
查看完整版本: 低代码容易实现MQ-3酒精探测传感器数据采集