Arduino Alcohol Detector Circuit Board

Published  March 27, 2020   5
S Saddam
Author
Arduino Alcohol Detector Circuit

In this project, I am going to Interface an Alcohol Sensor with Arduino. Here I have designed an Arduino Shield PCB using EASYEDA online PCB simulator and designer. Arduino Alcohol Detector will detect the alcohol level in breath and by using some calculations in code we can calculate the alcohol level in breath or blood and can trigger some alarm.

 

Components Required:

  1. Arduino UNO
  2. Alcohol detector Arduino shield from JLCPCB
  3. Alcohol Sensor (MQ3)
  4. Resistor 10K
  5. Resistor 1K
  6. 16x2 LCD
  7. Power Supply
  8. 10k POT
  9. LED
  10. LM358
  11. Burgstips
  12. Push button

Components for Arduino Alcohol Detector Circuit

 

Circuit Diagram and Explanation:

Arduino Alcohol Detector Circuit diagram

In this Arduino Alcohol Detector Shield we have used a MQ3 sensor to detect present alcohol level in the breath. A 16x2 LCD is used for displaying the PPM Value of alcohol. And an LM358 IC for converting alcohol level sensor output to digital (this function is optional). A buzzer is also place for indicating high alcohol level.

 

Circuit Diagram for this Arduino Alcohol Sensor Project is given above. We have a comparator circuit for comparing output voltage of Alcohol Sensor with preset voltage (output connected at pin D7). Alcohol sensor output is also connected at an analog pin of Arduino (A0). Buzzer is connected at Pin D9. And LCD connections are same as Arduino LCD examples that are available in Arduino IDE (12, 11, 5, 4, 3, 2). A push button also used here for start taking reading from Alcohol Sensor connected at digital pin D6 of Arduino. Remaining connections are shown in the circuit diagram.

Note: In the circuit, we need to short all the three pin of J2 header to calculate PPM.

For designing Alcohol Detector Shield for Arduino we have used EasyEDA, in which first we have designed a Schematic and then converted that into the PCB layout by Auto Routing feature of EasyEDA. Complete Process is explained below.

 

 

Calculations for Alcohol Level:

According to MQ3 datasheet, alcohol in clean air is 0.04 mg/L.                         

So we power the circuit and find the output voltage of MQ3 sensor in room air (I assume my room has clean air) so I got 0.60 voltage. It means when the sensor is giving 0.60v in the clean air then alcohol will be 0.04 mg/L.

Now we can find a multiplier by dividing alcohol by output voltage in clean air and we get

Multiplier = 0.40/0.60
Multiplier = 0.67

Now we have a formula for calculating alcohol (may be far away from the accurate or actual calculation. These are not standard calculations)

Alcohol = 0.67 * v .

Where v is the output voltage of alcohol sensor.

Note: This calculation is not accurate or standard.

 

Now we know the least driving limit while drinking alcohol is around 0.5mg/L. But in our calculation, we are getting around 0.40 mg/L in clean air so that we have set a threshold of alcohol while driving 0.80mg/L (just for Demonstration). 

 

MQ3 Sensor: 

MQ3 alcohol gas sensor is made by using SnO2 material which has less conductivity in clean air. Whenever it comes nearby alcohol gas its starts conducting highly according to the gas concentration. So user can sense the difference of output voltage using any microcontroller and can detect the presence of Alcohol.  This is low cost and a suitable sensor for many applications for alcohol detection. This sensor has a long life and good sensitivity. Some of the applications that can be made by using this sensor are Alcohol gas alarm, portable alcohol detector, gas alarms, Breathalyzer etc.

MQ3-Alcohol gas sensor

 

Circuit and PCB Design using EasyEDA:

To design this Arduino Alcohol Project Circuit, we have chosen the online EDA tool called EasyEDA. I have previously used EasyEDA many times and found it very convenient to use since it has a good collection of footprints and its open-source. Check here our all the PCB projects. After designing the PCB, we can order the PCB samples by their low cost PCB fabrication services. They also offer component sourcing service where they have a large stock of electronic components and users can order their required components along with the PCB order.

While designing your circuits and PCBs, you can also make your circuit and PCB designs public so that other users can copy or edit them and can take benefit from there, we have also made our whole Circuit and PCB layouts public for this Arduino Alcohol Detector, check the below link:

https://easyeda.com/circuitdigest/Alcohol_Detector-6b80abe350df4526b21be4999638a36b

 

You can view any Layer (Top, Bottom, Topsilk, bottomsilk etc) of the PCB by selecting the layer form the ‘Layers’ Window.

Alcohol Detector Circuit PCB Top layer

You can also view the PCB, how it will look after fabrication using the Photo View button in EasyEDA:

Arduino Alcohol Detector Circuit PCB

 

Calculating and Ordering Samples online:

After completing the design of this Arduino Alcohol Project PCB, you can order the PCB through JLCPCB.com. To order the PCB from JLCPCB, you need Gerber File. To download Gerber files of your PCB just click the Fabrication Output button in EasyEDA editor page, then download from the EasyEDA PCB order page.

Now go to JLCPCB.com and click on Quote Now or Buy Now button, then you can select the number of PCBs you want to order, how many copper layers you need, the PCB thickness, copper weight, and even the PCB color, like the snapshot shown below:

Buy your printed PCB from JLCPCB

ordering pcb from jlcpcb upload gerber file

After you have selected all of the options, click “Save to Cart” and then you will be taken to the page where you can upload your Gerber File which we have downloaded from EasyEDA. Upload your Gerber file and click “Save to Cart”. And finally click on Checkout Securely to complete your order, then you will get your PCBs a few days later. They are fabricating the PCB at very low rate which is $2. Their build time is also very less which is 48 hours with DHL delivery of 3-5 days, basically you will get your PCBs within a week of ordering.

Arduino Alcohol Detector Circuit PCB detailed dimension

 

After few days of ordering PCB’s I got the PCB samples in nice packaging as shown in below pictures. 

JLCPCB Box

Packed PCB received from JLCPCB

 

And after getting these pieces I have soldered all the required components over the PCB,

Arduino Alcohol Detector Circuit PCB soldering

Soldered PCB with components

Now we just need to attach LCD to the Shield and place this Alcohol Detector Shield over the Arduino. Align the Pins of this Shield with the Arduino and firmly press it over the Arduino. Now just upload the code to the Arduino and power on the circuit and you are done! Your Alcohol Detector is ready to test. 

Arduino Alcohol Detector Circuit in action

Code

#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);

#define sensor A0
#define led 13
#define buz 9
void setup() 
{
  Serial.begin(9600);
  lcd.begin(16,2);
  lcd.print("Alcohol Detector");
  lcd.setCursor(0,1);
  lcd.print(" Circuit Digest ");
  delay(2000);
  pinMode(sensor, INPUT);
  pinMode(buz, OUTPUT);
  pinMode(led, OUTPUT);
  lcd.clear();
}

void loop() 
{
  float adcValue=0;
  for(int i=0;i<10;i++)
  {
    adcValue+= analogRead(sensor);
    delay(10);
  }
    float v= (adcValue/10) * (5.0/1024.0);
    float mgL= 0.67 * v;
    Serial.print("BAC:");
    Serial.print(mgL);
    Serial.print(" mg/L");
    lcd.setCursor(0,0);
    lcd.print("BAC: ");
    lcd.print(mgL,4);
    lcd.print(" mg/L        ");
    lcd.setCursor(0,1);
    if(mgL > 0.8)
    { 
      lcd.print("Drunk   ");
      Serial.println("    Drunk");
      digitalWrite(buz, HIGH);
      digitalWrite(led, HIGH);
    }
    else
    {
      lcd.print("Normal  ");
      Serial.println("    Normal");
      digitalWrite(buz, LOW);
      digitalWrite(led, LOW);
    }

    delay(100);
    
}

Video

Tags
Have any question realated to this Article?

Ask Our Community Members

Comments