HOW to Detect Alcohol Content in the Air with Microbit
Overview
In this project, you will learn how to use an analog Alcohol sensor and micro:bit to detect the alcohol content in the air.
Components Required:
-
Micro:bit main board*1
-
Keyestudio Micro bit Sensor V2 Shield*1
-
USB Cable*1
-
keyestudio Analog Alcohol Sensor*1
-
DuPont jumper wire*3
-
Premium Battery Holder 6-cell AA*1
-
1.5V AA Battery*6
Component Introduction
Analog Alcohol Sensor:
This analog sensor-MQ3 is suitable for detecting the alcohol. It can be used in a breath [analyzer]. It has a good selectivity because it has higher sensitivity to alcohol and lower sensitivity to Benzine.
The sensitivity can be adjusted by rotating a potentiometer on the sensor.
It has two signal pins, Analog A0 and Digital D0. The higher the alcohol concentration, the higher the A0 value.
When both alcohol concentration and A0 value reach a certain value, D0 changes from low level to high level,
Connection Diagram
Test Code
Test Results
Wire components up, plug in external power and transfer code to micro:bit,we could adjust potentiometer to make LED1 at the critical point between on and off state, besides, the sensitivity is best.
Open CoolTerm, click Options and select SerialPort, set COM port and baud rate(115200). Click OK and Connect.
We make alcohol gas close to alcohol gas sensor, the analog value gets larger and LED1 becomes brighter, or else, the analog value gets smaller and LED1 turns off.