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.
- Arduino UNO
- Alcohol detector Arduino shield from JLCPCB
- Alcohol Sensor (MQ3)
- Resistor 10K
- Resistor 1K
- 16x2 LCD
- Power Supply
- 10k POT
- Push button
Circuit Diagram and Explanation:
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 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.
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:
You can view any Layer (Top, Bottom, Topsilk, bottomsilk etc) of the PCB by selecting the layer form the ‘Layers’ Window.
You can also view the PCB, how it will look after fabrication using the Photo View button in EasyEDA:
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:
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.
After few days of ordering PCB’s I got the PCB samples in nice packaging as shown in below pictures.
And after getting these pieces I have soldered all the required components over the PCB,
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.
#define sensor A0
#define led 13
#define buz 9
lcd.print(" Circuit Digest ");
float v= (adcValue/10) * (5.0/1024.0);
float mgL= 0.67 * v;
lcd.print(" mg/L ");
if(mgL > 0.8)