Shenzhen ZTRON Microelectronics Co., Ltd
Telephone
0755-8299 4126

MCU

SCM Alcohol Detection System


Design of Alcohol Detection System Based on Single Chip Microcomputer


There are a large number of railway employees. Before each new employee enters the job, relevant departments will provide relevant entry training for them. During the training, it is clearly pointed out that the staff are not allowed to drink alcohol before work to prevent various accidents. Article 390 of the "Railway Technical Regulations" stipulates that relevant railway operators must take full rest before taking over shifts. Drinking alcohol is strictly prohibited. If there is any violation, the tasks they undertake will be stopped immediately. In the "Road Traffic Safety", the punishment for drinking has been stipulated accordingly. In order to protect the life safety of employees and prevent the occurrence of drunken work, an alcohol detector based on STC89C52 single-chip microcomputer is designed, which can detect the alcohol concentration of employees before they work.


The alcohol concentration detector is based on the minimum system of single-chip microcomputer and alcohol sensor. It has sound and light alarm function and LCD display function, and uses assembly language to realize its software function. A variety of different workplaces. At the same time, the alcohol concentration detector also has the advantages of simple structure, reliable performance, convenient portability, and low power consumption, which can attract more market attention.


1. The overall structure design of the alcohol detection system


The alcohol detection system is mainly composed of the minimum system of single chip microcomputer, liquid crystal display module, power module, buzzer alarm module, indicator light module, key module, alcohol gas sensor module and analog-to-digital conversion module. The alcohol sensor is connected to the channel 1 port of the analog-to-digital conversion chip by means of resistive voltage division. When the alcohol sensor detects the alcohol concentration in the air, the alcohol concentration can be displayed on the liquid crystal display through the operation and processing of the single-chip microcomputer. The alarm threshold of the alcohol concentration can be set by pressing the button. When the alcohol concentration in the air is detected to exceed the standard, the buzzer will sound an alarm and the indicator light will start to flash.


2.The design of the main hardware circuit of the alcohol detection system


2.1 Design of the minimum system of single chip microcomputer


The minimum single-chip microcomputer system plays an overall role in the entire alcohol detection system. It needs to detect various parameters such as the keyboard and temperature sensor, and at the same time drive the LCD to display related parameters. This article selects STC89C52 single-chip microcomputer as the main control chip of the system to design the minimum system of single-chip microcomputer. It is mainly composed of STC89C52 microcontroller, reset circuit and clock circuit.


2.2 Design of A/D Analog-to-Digital Converter


Most of the sensors transmit continuously changing analog quantities. After the analog quantities are converted into electrical signals by the sensor, they need A/D conversion to convert them into digital signals before they can be input into the digital system for processing and control. What this article chooses is the ADC0832 analog-to-digital converter, which has the advantages of small size, strong compatibility, and high cost performance.


2.3 Design of the sensor


There are two general types of gas sensors: semiconductor gas sensors and electrochemical gas sensors. Semiconductor sensors have the advantages of simple structure, high sensitivity, and good dynamic performance. Moreover, semiconductors are sensitive materials, and it is easy to realize sensor intelligence and integration. Therefore, the MQ-3 semiconductor alcohol gas sensor is selected in this design.


2.4 Design of liquid crystal display module


There are usually two types of liquid crystal displays commonly used in single-chip microcomputers, one is LCD12864 liquid crystal display, and the other is LCD1602 liquid crystal display. LCD1602 is a character liquid crystal display, and its main control chip is HD44780 or other compatible chips. LCD12864 liquid crystal display is a graphic dot matrix display, in addition to ordinary characters, it can also display images and Chinese characters. This article is mainly used to display the concentration of alcohol, and the LCD1602 display can fully meet the requirements of use.


2.5 Design of sound and light alarm circuit


The alarm circuit of the alcohol detection system is driven by a PNP S8550 triode. When the output of the single-chip microcomputer is low level, the triode is turned on, the buzzer sends out an alarm, and the indicator light flashes; when the output of the single-chip microcomputer is high level, the triode is cut off, the buzzer stops alarming, and the indicator light goes out.


3. Alcohol detection system program flow design and simulation analysis


3.1 Program flow design


The program flow for designing the alcohol detection system is as follows: program initialization is performed first, and after the program initialization is completed, the sensor is preheated. The sensor must be preheated first, because the MQ-3 semiconductor resistive alcohol sensor has not been powered on for a period of time, and when the power is turned on again, the sensor cannot immediately collect alcohol concentration information normally, and it takes a period of time to warm up. Then the system will enter the monitoring state to detect the alcohol concentration in the air. After the alcohol concentration information is converted and processed by ADC0832, it is analyzed and processed by the single-chip microcomputer, and the current alcohol concentration is displayed on the LCD1602 liquid crystal screen, and the alarm is activated when the alcohol concentration exceeds the set value.


3.2 Simulation Analysis


Next, start to simulate and analyze the alcohol detection system. When the concentration range is 10-1000ppm, the MQ-3 alcohol sensor can convert the detected alcohol concentration value into a voltage signal, which is processed by the STC89C52 microcontroller and the concentration is displayed on the LCD1602. In the process of simulating the alcohol monitoring system, the comparison between the input value and the set threshold can be changed through the sliding rheostat circuit. If the detected value is greater than the set value, the alarm circuit will send out an alarm.


The simulation results are shown in Figure 1. In this simulation, the threshold is set to 10%, and the detected alcohol concentration is 14%, the system sounds an alarm, and the D2 light starts to flash.


Through the simulation analysis of the alcohol detection system, it can be seen that the alcohol detection system designed in this paper can realize its alarm function in theory, and basically meets the design requirements.


4. Experimental verification of alcohol detection system


Next, the designed alcohol detection system is experimentally verified to observe that it can meet the requirements of normal use.


Purchase the required components and weld the alcohol detector shown in Figure 2. Set the alcohol concentration alarm threshold to 10%, then open a bottle of wine, put the bottle close to the alcohol detector, the alcohol detector detects that the alcohol concentration in the air is 14%, greater than 10%, the buzzer starts to alarm, and the indicator light starts blinking.


It can be seen from experiments that when the alcohol concentration in the air exceeds the set threshold, the alcohol detector will give an audible and visual alarm; when the alcohol in the air slowly volatilizes below 10%, the alarm ends. It shows that the alcohol detection system designed in this paper can meet the requirements of use.


Summarize


(1) By analyzing the working principle of the alcohol detection system, its overall structure and internal circuit are designed in detail, and an alcohol detector that can meet the requirements of use is designed. (2) Programming and simulating the alcohol detection system, it is found that when the detected alcohol concentration exceeds the set threshold, an alarm will occur, which verifies the theoretical correctness of the alcohol detection system designed in this paper. (3) Carry out experimental tests on the designed alcohol detector. When the alcohol concentration in the air exceeds the standard, the alcohol detector will send out a sound and light alarm, which shows that the alcohol detector designed in this paper has practical value and can be used for railway workers to go to work Alcohol concentration test before.


The above is the design method of the single-chip alcohol detection system introduced by Shenzhen Zuchuang Microelectronics Co., Ltd. for you. We have rich experience in customized development of smart electronic products, can evaluate the development cycle and IC price as soon as possible, and can also calculate the PCBA quotation. We are the agent of Sonix MCU and Yingguang MCU agent, selling and developing MCU and voice IC solutions of Sonix and Yingguang. We act as an agent and develop ICs and solutions of Jieli, Ankai, Quanzhi, realtek and other series, and also develop BLE Bluetooth IC, dual-mode Bluetooth module, wifi module, and Internet of Things module. We have hardware design and software development capabilities. Covering circuit design, PCB design, single-chip microcomputer development, software custom development, APP custom development, WeChat official account development, voice recognition technology, Bluetooth development, wifi technology, etc. It can also undertake the research and development of smart electronic products, the design of household appliances, the development of beauty equipment, the development of Internet of Things applications, the design of smart home solutions, the development of TWS earphones, the development of Bluetooth earphone speakers, the development of children's toys, and the development of electronic education products.

  • TOP