Overview
This project measures the amount of alcohol consumed by any person. Using the gas sensor the LED will show the alert or normal to the breath basically it analyzes the human breath and tells the amount of alcohol consumption.
In this breathalyzer, the gas sensor calculates the amount of alcohol and will print the results on LCD and if the amount of alcohol is greater than normal the red LED will glow.
Hardware required
- Arduino Uno R3
- LED
- Resistor
- Jumper Wires
- Gas Sensor
- Buzzer
- LCD
- Potentiometer
Schematic Diagram
Arduino Code :
#include <LiquidCrystal.h>
LiquidCrystal lcd(12 ,11 ,5 ,4 ,3 ,2);
int ledPin = 10;
int sensorPin = A0;
int value;
void setup()
{
Serial.begin(9600);
lcd.begin(16,2);
pinMode(ledPin,OUTPUT);
}
void loop()
{
int value = analogRead(sensorPin);
value = analogRead(A0);
lcd.print("Alcohol Level :");
lcd.print(value-50);
Serial.print(value);
if (value-50 > 400)
{
digitalWrite(ledPin,HIGH);
lcd.setCursor(0,2);
lcd.print("Alert....!!!!");
}
else {
digitalWrite(ledPin,HIGH);
lcd.setCursor(0, 2);
lcd.print("...Normal...");
}
delay(500);
lcd.clear();
}
Precautions
- Connections should be done properly.
- Arduino is case Sensitive so code accordingly.
- Give different and appropriate colors to the wires.
- Use resistors for sensors and LED.