รหัสสินค้า | AS00432 |
หมวดหมู่ | Gas Sensors แก๊สเซ็นเซอร์ |
ราคา | 1,595.00 บาท |
สถานะสินค้า | พร้อมส่ง |
จำนวน | ชิ้น |
Based on the electrochemistry principle, this alcohol sensor has been calibrated before the factory. It is characterized by strong anti-interference, high stability, and sensitivity and up to 2 years of service life. The module supports 0.01ppm(10ppb) resolution and 3.3~5.5V wide-range voltage input and works well with mainstream controllers like Arduino, ESP32, and Raspberry Pi. With the easy-to-use Gravity interface and the sample program provided by us, you can conveniently build your alcohol concentration detector using this sensor.
Download the codes into the UNO board and open the serial monitor to check the results.
NOTE:
Connect the sensor with Arduino as shown above. A Gravity I/O expansion board will make it more easier.
Dial the select switch on the sensor to I2C.
The default I2C address is 0x75, ADDRESS_3 in code. If you want to change the address, first configure the hardware I2C address via the DIP switch on the module, and then revise I2C address define ADDRESS_X in the sample code. The relation between DIP switch and I2C address is shown below:
Download and install DFRobot Alcohol Sensor library
Open Arduino IDE, upload the following codes into Arduino UNO.
Open Arduino serial monitor, set baud rate to 9600, then check the result.
``c
/*!
* @file readAlcohol.ino
* @brief Reading Alcohol concentration, A concentration of one part per million (PPM).
* @n step: we must first determine the iic device address, will dial the code switch A0, A1 (ADDRESS_0 for [0 0]), (ADDRESS_1 for [1 0]), (ADDRESS_2 for [0 1]), (ADDRESS_3 for [1 1]).
*
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author ZhixinLiu(zhixin.liu@dfrobot.com)
* @version V1.0
* @date 2020-09-09
* @get from https://www.dfrobot.com
* @url https://github.com/dfrobot/DFRobot_Alcohol
*/
#include "DFRobot_Alcohol.h"
#define COLLECT_NUMBER 5 // collect number, the collection range is 1-100
#define ALCOHOL_I2C_ADDRESS ADDRESS_3
/* iic slave Address, The default is ADDRESS_3
ADDRESS_0 0x72 // i2c device address
ADDRESS_1 0x73
ADDRESS_2 0x74
ADDRESS_3 0x75
*/
DFRobot_Alcohol_I2C Alcohol(&Wire ,ALCOHOL_I2C_ADDRESS);
/*
#ifdef ESP_PLATFORM
// ESP32 user hardware uart
// RX io16
// TX io17
DFRobot_Alcohol_UART Alcohol(&Serial2 ,9600);
#else
// Arduino user software uart
// RX io10
// TX io11
SoftwareSerial mySerial(10 ,11);
DFRobot_Alcohol_UART Alcohol(&mySerial ,9600);
#endif
*/
void setup()
{
Serial.begin(9600);
while(!Alcohol.begin())
{
Serial.println("NO Deivces !");
delay(1000);
}
Serial.println("Device connected successfully !");
/* Set iic mode, active mode or passive mode
MEASURE_MODE_AUTOMATIC // active mode
MEASURE_MODE_PASSIVE // passive mode
*/
Alcohol.SetModes(MEASURE_MODE_AUTOMATIC);
}
void loop()
{
/* Smooth data collection
COLLECT_NUMBER // The collection range is 1-100
*/
float alcoholConcentration = Alcohol.ReadAlcoholData(COLLECT_NUMBER);
if(alcoholConcentration == ERROR)
{
Serial.println("Please check the connection !");
}else{
Serial.print("Alcohol concentration is ");
Serial.print(alcoholConcentration);
Serial.println(" PPM.");
}
delay(1000);
}
Open the serial monitor, preheat 3 minutes and check the final data.
Note:
Connect the sensor with Arduino as shown above. A Gravity I/O expansion board will make it more easier.
Dial the select switch on the sensor to UART.
Download and install DFRobot Alcohol Sensor library
Open Arduino IDE, upload the following codes into Arduino UNO.
Open Arduino serial monitor, set baud rate to 9600, then check the result.
/*!
* @file readAlcohol.ino
* @brief Reading Alcohol concentration, A concentration of one part per million (PPM).
* @n step: we must first determine the iic device address, will dial the code switch A0, A1 (ADDRESS_0 for [0 0]), (ADDRESS_1 for [1 0]), (ADDRESS_2 for [0 1]), (ADDRESS_3 for [1 1]).
*
* @copyright Copyright (c) 2010 DFRobot Co.Ltd (http://www.dfrobot.com)
* @licence The MIT License (MIT)
* @author ZhixinLiu(zhixin.liu@dfrobot.com)
* @version V1.0
* @date 2020-09-09
* @get from https://www.dfrobot.com
* @url https://github.com/dfrobot/DFRobot_Alcohol
*/
#include "DFRobot_Alcohol.h"
#define COLLECT_NUMBER 5 // collect number, the collection range is 1-100
#define ALCOHOL_I2C_ADDRESS ADDRESS_3
/* iic slave Address, The default is ADDRESS_3
ADDRESS_0 0x72 // i2c device address
ADDRESS_1 0x73
ADDRESS_2 0x74
ADDRESS_3 0x75
*/
//DFRobot_Alcohol_I2C Alcohol(&Wire ,ALCOHOL_I2C_ADDRESS);
#ifdef ESP_PLATFORM
// ESP32 user hardware uart
// RX io16
// TX io17
DFRobot_Alcohol_UART Alcohol(&Serial2 ,9600);
#else
// Arduino user software uart
// RX io10
// TX io11
SoftwareSerial mySerial(10 ,11);
DFRobot_Alcohol_UART Alcohol(&mySerial ,9600);
#endif
void setup()
{
Serial.begin(9600);
while(!Alcohol.begin())
{
Serial.println("NO Deivces !");
delay(1000);
}
Serial.println("Device connected successfully !");
/* Set iic mode, active mode or passive mode
MEASURE_MODE_AUTOMATIC // active mode
MEASURE_MODE_PASSIVE // passive mode
*/
Alcohol.SetModes(MEASURE_MODE_AUTOMATIC);
}
void loop()
{
/* Smooth data collection
COLLECT_NUMBER // The collection range is 1-100
*/
float alcoholConcentration = Alcohol.ReadAlcoholData(COLLECT_NUMBER);
if(alcoholConcentration == ERROR)
{
Serial.println("Please check the connection !");
}else{
Serial.print("Alcohol concentration is ");
Serial.print(alcoholConcentration);
Serial.println(" PPM.");
}
delay(1000);
}
Open the serial monitor, preheat 3 minutes and check the final data.
Note:
There two data reading modes for this Alcohol Sensor: aoto-upload and passive reply. It is default to auto-upload, and users can alter it in Codes.
Revise the parameter in the parentheses to adjust the data sending mode.
“MEASURE_MODE_AUTOMATIC” is auto-upload mode. The sensor automatically uploads parameter every 1 second in this mode.
”MEASURE_MODE_PASSIVE“ is passive reply mode. The sensor feedbacks parameter only when the function is called in this mode.
Alcohol.SetModes(MEASURE_MODE_AUTOMATIC);
/*
MEASURE_MODE_AUTOMATIC // Auto-upload
MEASURE_MODE_PASSIVE // Passive Reply
*/
The data of alcohol sensor can be read by the function “ReadAlcoholData()”. Before outputing, this function will take the average of the data in data collect array “COLLECT_NUMBER”. The default size of that array is 5, and it can be adjusted within 1~100 in the code “#define COLLET_NUMBER 5".
#define COLLECT_NUMBER 5
Alcohol.ReadAlcoholData(COLLECT_NUMBER);
/*
COLLECT_NUMBER // The collection range is 1-100
*/
By UART communication protocol, the SEN0376 Alcohol sensor can be connected to any controllers with UART for data reading and sensor configuration.
Baud Rate | 9600 |
---|---|
Data bit | 8 |
Check | 1 |
The sensor has two communication modes: auto-upload and passive reply. The default one is auto-upload, and the sensor sends the alcohol concentration every 1 second in this mode.
Data format in auto-upload mode:
Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 | Byte8 |
---|---|---|---|---|---|---|---|---|
Start | Gas Name C2H5OH |
Unit (ppb) |
Decimal digit None |
Gas Concentration High |
Gas Concentration Low |
Full-scale High |
Full-scale Low |
Check |
0xFF | 0x17 | 0x04 | 0x00 | 0x00 | 0x25 | 0x13 | 0x88 | 0x25 |
Note:Gas Concentration(PPB)=Gas Concentration High*256+Gas Concentration Low. When converted in PPM: PPM= PPB/1000.
In passive reply mode, the commands to re-switch to auto-upload mode are as follows:
Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 | Byte8 |
---|---|---|---|---|---|---|---|---|
Start | None | Swtich command | Auto-upload | none | none | none | none | Check |
0xFF | 0x01 | 0x78 | 0x40 | 0x00 | 0x00 | 0x00 | 0x00 | 0x47 |
The commands to switch to passive-reply mode and read concentration in this mode:
Switch to passive-reply mode:
Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 | Byte8 |
---|---|---|---|---|---|---|---|---|
Start | None | Switch command | passive-reply | None | None | None | None | Check |
0xFF | 0x01 | 0x78 | 0x41 | 0x00 | 0x00 | 0x00 | 0x00 | 0x46 |
Read gas concentration:
Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 | Byte8 |
---|---|---|---|---|---|---|---|---|
Start | None | Command | None | None | None | None | None | Check |
0xFF | 0x01 | 0x86 | 0x00 | 0x00 | 0x00 | 0x00 | 0x20 | 0x79 |
Data format in passive-reply mode:
Byte0 | Byte1 | Byte2 | Byte3 | Byte4 | Byte5 | Byte6 | Byte7 | Byte8 |
---|---|---|---|---|---|---|---|---|
Start | Command | None | None | None | None | Gas concentration High(ppb) |
Gas concentration Low(ppb) |
Check |
0xFF | 0x86 | 0x00 | 0x00 | 0x00 | 0x00 | 0x00 | 0x20 | 0x5A |
Gas concentration(PPB)=Gas concetration High*256+Gas concentration Low
Checksum= (Reverse(Byte1 + Byte2 + ··· ··· +Byte7) + 1
Reference Sample Program:
/******************************************************************
* Name: unsigned char FucCheckSum(uchar *i,ucharln)
* Function:checksum(Reverse the sum of 1\2\3\4\5\6\7 of sending and receiveing, then plus 1)
* Description:Sum up the elements from the first to the second to last in the array, reverse the sum and then plus 1 (There should be more than 2 elements).
******************************************************************/
unsigned char FucCheckSum(unsigned char *i,unsigned char ln)
{
unsigned char j,tempq=0;
i+=1;
for(j=0;j<(ln-2);j++)
{
tempq+=*i;
i++;
}
tempq=(~tempq)+1;
return(tempq);
}
Due to the electrochemical principle, the sensor performance may be influenced by other gases, shown as below:
Gas | Concentration/PPM | Equivalent concentration of ethanol |
---|---|---|
Benzene | 10 | 0.1 |
Toluene | 10 | 0.46 |
Acetic acid | 200 | 0.52 |
Hydrogen sulfide | 50 | 3 |
Carbon monoxide | 200 | 0.64 |
ชำระเงินค่าสินค้าโดยการโอนเงินเข้าบัญชีธนาคาร KBANK, SCB, BBL,TMB
กรุณาเก็บหลักฐานการโอนเงินของท่านไว้เพื่อแจ้งการชำระเงินด้วยค่ะ
ท่านสามารถแจ้งการชำระเงินผ่านระบบอัตโนมัติได้โดย Click Link ข้างล่างค่ะ
https://www.arduitronics.com/informpayment
หน้าที่เข้าชม | 15,375,197 ครั้ง |
ผู้ชมทั้งหมด | 5,878,275 ครั้ง |
เปิดร้าน | 21 พ.ค. 2556 |
ร้านค้าอัพเดท | 5 ก.ย. 2568 |