Sunday, 21 June 2015

Alcohol sensor (MQ3) interfacing..¡¡¡

Heyyy..now am here to explain the "interfacing of alcohol sensor to popular ARDUINO. It's very easy.
Alcohol sensor simply mq3 sensor is analog sensor which outputs the voltage.o/p of the sensor is fed to analog pin of ARDUINO..
Here Is the pic how the sensor looks
It contains six pins so we to work for sometime to make this six pins as three pins i.e VCC,GND,Vout.below fig shows how to connect this sensor To ARDUINO board




Now we have 3 pins for the sensor,connect VCC to 5V,GND to GND pin of ARDUINO and data to any analog pin of arduino
Just dump the below Sketch to ur board and observe the output of the sensor in serial moniter

Here is the code
void setup() {
  // initialize serial communication at 9600 bits per second:
  Serial.begin(9600);
}

// the loop routine runs over and over again forever:
void loop() {
  // read the input on analog pin 0:
  int sensorValue = analogRead(A0);
  // Convert the analog reading (which goes from 0 - 1023) to a voltage (0 - 5V):
  float voltage = sensorValue * (5.0 / 1023.0);
  // print out the value you read:
  Serial.println(voltage);
}

So final conclusion is that we can this sensor for breath analyzer ,automatic ignition off in cars etc..i hope u understand.
Thank you 



If u have any queries ping me at facebook.com/winrap57

No comments:

Post a Comment