Components Required –
Circuit Connections –
Fig. 2: Prototype of Arduino Based Alcohol Detector
The circuit is based on Arduino Pro Mini. The MQ-3 sensor, LCD display, Servo motor and LED are connected to the Arduino board. The circuit connections are as follow –
How the circuit works –
Fig. 4: Image of Arduino based Alcohol Detector Circuit Displaying Alcohol Level
Once the device is powered on by attaching a battery, the Arduino sketch starts running. It loads the required Arduino libraries and initializes LCD display. Some initial messages are displayed on the LCD. The Arduino starts detecting analog voltage from the sensor and converts it to a digital value using inbuilt Analog to Digital convertor. The reading is displayed on the LCD screen which by default remains to zero.
Programming Guide –
Project Source Code
###
//Program to #include <Servo.h> #include <LiquidCrystal.h> LiquidCrystal lcd(2, 3, 4, 5, 6, 7); int ledPin = 12; int sensorPin = A1; Servo myservo; int pos = 0; int value; void setup() { Serial.begin(9600); lcd.begin(16,2); pinMode(ledPin,OUTPUT); myservo.attach(10); } void loop() { int Value = analogRead(sensorPin); value = analogRead(A1); lcd.print("Alcohollevel:"); lcd.println(value); Serial.println(value); if (Value > 500) { digitalWrite(ledPin,HIGH); lcd.setCursor(0, 2); lcd.print("Alert....!!!"); Serial.print ("Alert"); myservo.write(100); } else { digitalWrite(ledPin,LOW); lcd.setCursor(0, 2); lcd.print("Normal... :)"); Serial.print("Normal"); myservo.write(0); } delay(1000); lcd.clear(); }
###
Project Video
Filed Under: Electronic Projects
Filed Under: Electronic Projects
Questions related to this article?
👉Ask and discuss on Electro-Tech-Online.com and EDAboard.com forums.
Tell Us What You Think!!
You must be logged in to post a comment.