kdke 发表于 2014-3-27 14:25:59

用Arduino和MQ-3制作酒精浓度探测器

本帖最后由 kdke 于 2014-3-27 14:33 编辑

原文:http://www.leikeji.com/forum.php?mod=viewthread&tid=302&extra=page%3D1

http://www.leikeji.com/data/attachment/forum/201403/27/015501z0uy54vl1l5fw5z4.jpg.thumb.jpg
在上篇文章发表后有了很多更新,这一次我们使用MQ-3酒精气体传感器、SparkFun插线板连接做一个Arduino酒精探测器。
MQ-3是一款加热型酒精探测器,输出信号为模拟信号(取决传感器预热时间参考值为150 - 1023之间),不管你做何用途,都采用Arduino标准代码。

连线及安装:
http://www.leikeji.com/data/attachment/forum/201403/27/020555r8da2e27d3ee3ed2.png
http://www.leikeji.com/data/attachment/forum/201403/27/020236mkk05c4c0gv4of2l.jpg


如果有时间,你可以在正常呼出气体测出一个数值,具体到百分比、血液中的酒精浓度。因为传感器因个差异读数会有所不同,这需要通过Arduino程序校准MQ-3读出的数值,虽然我不能帮你校准这些数值,但可以给你最好建议:通过几个浓度不同的酒精的瓶子来调试。使用中对着传感器呼出气体,但不要弄湿传感器!

代码:
01.int mq3_analogPin = A0; // connected to the output pin of MQ3

02.

03.void setup(){

04.Serial.begin(9600); // open serial at 9600 bps

05.}

06.

07.void loop()

08.{

09.// give ample warmup time for readings to stabilize

10.

11.int mq3_value = analogRead(mq3_analogPin);

12.Serial.println(mq3_value);

13.

14.delay(100); //Just here to slow down the output.

15.}
复制代码

arduino, 教程











mq3-arduino-hookup-400x219.png

asdfcgdc 发表于 2015-7-19 15:25:29

图片无法显示
页: [1]
查看完整版本: 用Arduino和MQ-3制作酒精浓度探测器