งานที่ 1


gas sensor
Alcohol Sensor เป็นเซนเซอร์วัดระยะที่ใช้วัดปริมาณของ Alcohol มี Output ให้เลือกใช้งาน ทั้งแบบ Analog และ Digital โดย Output ของแบบ Digital สามารถกำหนดช่วงการทำงานได้โดยปรับค่าที่ Potentiometer
 การต่อวงจร
Arduino Alcohosensor
5VVCC 
GNDGND 
pin A0A0 
 








โค้ดตัวอย่างการใช้งาน
int mq3_analogPin = A0; // connected to the output pin of MQ3 
void setup()
{
Serial.begin(9600); // open serial at 9600 bps
}
void loop()
{
  // give ample warmup time for readings to stabilize
  int mq3_value = analogRead(mq3_analogPin);
  Serial.println(mq3_value);
  delay(100); //Just here to slow down the output.
}

ความคิดเห็น

บทความที่ได้รับความนิยม