Visuino Breathalyzer How to Use the MQ-3 Alcohol Gas Sensor
by RonFrtek in Circuits > Arduino
1725 Views, 6 Favorites, 0 Comments
Visuino Breathalyzer How to Use the MQ-3 Alcohol Gas Sensor
In this tutorial we will use Arduino UNO, OLED Lcd, MQ-3 Alcohol Gas Sensor module, and Visuino to display Alcohol levels on Lcd and set the limit detection. Watch a demonstration video.
What You Will Need
Arduino UNO or any other Arduino
MQ-3 Alcohol Gas Sensor module
OLED Lcd
Breadboard
Jumper wires
Visuino program: Download Visuino
The Circuit
Connect GND from Arduino UNO to breadboard pin (gnd)
Connect 5V pin from Arduino UNO to breadboard pin (positive)
Connect SCL from Arduino UNO to OLED LCD pin (SCL)
Connect SDA from Arduino UNO to OLED LCD pin (SDA)
Connect OLED LCD pin (VCC) to breadboard pin (positive)
Connect OLED LCD pin (GND) to breadboard pin (GND)
Connect MQ-3 Alcohol Gas Sensor module pin (VCC) to breadboard pin (positive)
Connect MQ-3 Alcohol Gas Sensor pin (GND) to breadboard pin (GND)
Connect MQ-3 Alcohol Gas Sensor module pin (A0) to Arduino UNO pin Analog (1)
Start Visuino, and Select the Arduino UNO Board Type
To start programming the Arduino, you will need to have the Arduino IDE installed from here: http://www.arduino.cc/.
Please be aware that there are some critical bugs in Arduino IDE 1.6.6. Make sure that you install 1.6.7 or higher, otherwise this Instructable will not work! If you have not done follow the steps in this Instructable to setup the Arduino IDE to program ESP 8266! The Visuino:https://www.visuino.eu also needs to be installed. Start Visuino as shown in the first picture Click on the "Tools" button on the Arduino component (Picture 1) in Visuino When the dialog appears, select "Arduino UNO" as shown on Picture 2
In Visuino Add Components
- Add 2X "Text Value" component
- Add 2X "Compare Value" component
- Add Display OLED I2C component
- Add "Text Multi Merger" component
- Add "Average Period" component
In Visuino: Set Components
- set text value of "TextValue1" component to "Too Drunk!"
- set text value of "TextValue2" component to "Ok"
- set value of "CompareValue1" component to "0.3" >>This is the detection value, you can set your own value
- set value of "CompareValue2" component to "0.3" >>This is the detection value, you can set your own value
- set CompareType of "CompareValue1" component to "ctBiggerOrEqual"
- set CompareType of "CompareValue2" component to "ctSmaller"
- set Period of "AveragePeriod1" component to "500000" this is equal to 0.5 of a second, it means that the LCD will show the vlue every 0.5s
Double click on DisplayOled1 component
- add Draw text to the left and set text to "Alc Level:"
- add 2X Text field to the left (see picture) and set Y:20 for "text field1" and y:40 for "text field2"
Step 5: in Visuino: Connecting Components
- Connect DisplayOled1 pin[Out I2c] to Arduino I2C pin [in]
- Connect Arduino Analog pin Out [1] to AveragePeriod1 pin[in] and CompareValue1 pin[in] and CompareValue2 pin[in]
- Connect AveragePeriod1 pin[out] to OLED elkements Text Field1 pin [in]
- Connect CompareValue1 pin[out] to TextValue1 pin[clock]
- Connect CompareValue2 pin[out] to TextValue2 pin[clock]
- Connect TextValue1 pin[out] to TextMultiMerger1 pin[0]
- Connect TextValue2 pin[out] to TextMultiMerger1 pin[1]
- Connect TextMultiMerger1 pin[out] to OLED elements Text Field2 pin [in]
Generate, Compile, and Upload the Arduino Code
In Visuino, at the bottom click on the "Build" Tab, make sure the correct port is selected, then click on the "Compile/Build and Upload" button.
Play
If you power the Arduino UNO module, the OLED Lcd will start showing the value of the the MQ-3 Alcohol Gas Sensor. If you put an Alcohol swab or any Alcohol near the sensor it will show the value on the LCD.
Congratulations! You have completed your project with Visuino. Also attached is the Visuino project, that I created for this Instructable. You can download and open it in Visuino: https://www.visuino.eu