Digital illuminometer based on 51 single-chip microcomputer

By adopting a modular design based on the STC89C52 microcontroller and TSL-2561 photoelectric sensor, combined with LCD display and audible and visual alarms, the problem of high cost, high power consumption and limited functionality of existing illuminance meters in complex environments is solved. This achieves low-cost, high-sensitivity light intensity monitoring and alarm display, which is suitable for smart agriculture, green buildings and smart homes.

CN224398807UActive Publication Date: 2026-06-23HUNAN INSTITUTE OF ENGINEERING

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Utility models(China)
Current Assignee / Owner
HUNAN INSTITUTE OF ENGINEERING
Filing Date
2025-06-27
Publication Date
2026-06-23

Smart Images

  • Figure CN224398807U_ABST
    Figure CN224398807U_ABST
Patent Text Reader

Abstract

The utility model discloses a digital illuminometer based on 51 singlechip, digital illuminometer includes STC89C52 singlechip, TSL-2561 photoelectric sensor, liquid crystal display circuit, button control circuit, audible -visual alarm circuit and power module, STC89C52 singlechip is connected with TSL-2561 photoelectric sensor, liquid crystal display circuit, button control circuit and audible -visual alarm circuit respectively and carries out communication, power module is connected with STC89C52 singlechip, TSL-2561 photoelectric sensor, liquid crystal display circuit and audible -visual alarm circuit respectively and carries out power supply, power module is portable power supply. The cost and power consumption of this digital illuminometer are low, and the illumination intensity under complex scenes can be continuously monitored for a long time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This utility model belongs to the technical field of illuminance measurement devices, and specifically provides a digital illuminance meter based on a 51 microcontroller. Background Technology

[0002] With the rapid development of information technology, high-precision photometric and digital illuminance measurement technologies have become a crucial foundation for acquiring optoelectronic information. In recent years, breakthroughs in new materials and processes have led to explosive growth in optoelectronic sensor technology, with new products constantly emerging. The new generation of optoelectronic sensors has achieved a qualitative leap in core performance indicators such as measurement accuracy, response speed, and detection sensitivity. They are not only capable of high-precision real-time monitoring of various environmental data but also demonstrate enormous application potential in emerging fields such as smart homes, intelligent transportation, and intelligent communications.

[0003] An illuminance meter (also known as a lux meter or illuminance meter) is an instrument specifically designed to measure illuminance. It is used to measure the degree to which an object is illuminated, that is, the ratio of the luminous flux received by the object's surface to the illuminated area.

[0004] However, existing illuminance meters still have the following drawbacks:

[0005] 1. The measurement range of light intensity is narrow and the sensitivity is low, which cannot meet the requirements of light detection environment under complex conditions.

[0006] 2. The hardware manufacturing cost and power consumption are high, making it impossible to meet the requirements for long-term online monitoring of light intensity.

[0007] 3. It only has a single function for measuring light intensity and does not have a light intensity over-limit alarm display function.

[0008] Therefore, there is an urgent need to design a digital illuminance meter that is low in cost and power consumption and can continuously monitor the light intensity in complex scenarios for a long time. Utility Model Content

[0009] (a) Technical problems to be solved

[0010] Based on this, this utility model proposes a digital illuminance meter based on a 51 microcontroller. The system uses the STC89C52 as the main control chip, providing a stable and reliable control core. The hardware system adopts a modular design, consisting of six functional modules. First, the microcontroller control circuit: serving as the low-power system core and supporting the I2C protocol, it realizes data processing and logic control. Second, the photoelectric sensor: employing a photoelectric sensor adaptable to complex environments and low power consumption, it realizes light intensity acquisition under various complex conditions. Third, the button control circuit: providing a human-machine interface, supporting parameter setting and function switching of light intensity thresholds. Fourth, the audible and visual alarm circuit: providing multiple warnings under abnormal lighting conditions. Fifth, the LCD display circuit: displaying measurement data and system status in real time and intuitively. Finally, the power module: utilizing a portable power supply, it can continuously provide stable and reliable operating voltage to each module for extended periods. The illuminance meter assembled based on the above modules can achieve long-term continuous monitoring of light intensity in complex scenarios, meeting the light monitoring needs of various indoor and outdoor environments for more than 12 hours.

[0011] (II) Technical Solution

[0012] To address the technical challenge of continuously monitoring light intensity in complex scenarios over extended periods, this invention proposes a digital illuminance meter based on a 51 microcontroller. The digital illuminance meter comprises an STC89C52 microcontroller, a TSL-2561 photoelectric sensor, a liquid crystal display circuit, a button control circuit, an audible and visual alarm circuit, and a power supply module. The STC89C52 microcontroller is communicatively connected to the TSL-2561 photoelectric sensor, the liquid crystal display circuit, the button control circuit, and the audible and visual alarm circuit. The power supply module provides power to the STC89C52 microcontroller, the TSL-2561 photoelectric sensor, the liquid crystal display circuit, and the audible and visual alarm circuit. The power supply module is a portable power source.

[0013] Furthermore, the STC89C52 microcontroller includes a main control chip STC89C52, a 12MHz crystal oscillator circuit, and a reset circuit.

[0014] Furthermore, the STC89C52 microcontroller and the TSL-2561 photoelectric sensor establish an I2C communication connection.

[0015] Furthermore, the first pin of the STC89C52 microcontroller is connected to the SCL pin of the TSL-2561 photoelectric sensor, and the second pin of the STC89C52 microcontroller is connected to the SDA pin of the TSL-2561 photoelectric sensor.

[0016] Furthermore, the button control circuit includes three function buttons K1~K3, where K1 is a mode switching button, K2 is an incremental adjustment button, and K3 is a decrement adjustment button.

[0017] Furthermore, the audible and visual alarm circuit includes a buzzer alarm circuit, which uses an 8550 transistor as the driving element of the buzzer. The base of the 8550 transistor is connected to the output I / O port control signal of the STC89C52 microcontroller through a current-limiting resistor. The emitter of the 8550 transistor is connected to the VCC voltage output terminal of the power supply module. The collector of the 8550 transistor directly drives one end of the buzzer, and the other end of the buzzer is grounded.

[0018] Furthermore, the audible and visual alarm circuit includes a signal indicator circuit, which includes a dual LED indicator system using a common anode connection. In the dual LED indicator system, the anodes of LEDs D1 and D2 are connected to the VCC voltage output terminal of the power supply module, while the cathodes of LEDs D1 and D2 are connected to two designated I / O ports of the STC89C52 microcontroller through current-limiting resistors R2 and R3, respectively.

[0019] Furthermore, the liquid crystal display circuit includes an LCD1602 character dot matrix liquid crystal module.

[0020] Furthermore, the 16 pins of the LCD1602 character dot matrix liquid crystal module's display screen adopt a standard connection method: pins 1 and 16 are grounded, pins 2 and 15 are connected to VCC power supply, pin 3 uses an adjustable potentiometer to adjust the display contrast, pins 4-6 are used as control terminals directly connected to the microcontroller's I / O port, and pins 7-14 are used as an 8-bit data bus connected to the microcontroller.

[0021] Furthermore, the portable power source is a power bank, which provides a 5V VCC voltage output via a USB port.

[0022] (III) Beneficial Effects

[0023] Compared with the prior art, the present invention has the following advantages:

[0024] (1) This utility model improves the design of an ultra-low power digital illuminance meter based on a 51 microcontroller, deconstructing the digital illuminance meter into six core functional units: a microcontroller control circuit, an illuminance detection circuit, a button control circuit, an audible and visual alarm circuit, an LCD display circuit, and a power supply module. This design reduces system complexity and provides structured support for functional expansion and maintenance. Through a low-cost hardware architecture (51 microcontroller + digital sensor), modular design thinking, and intelligent functional integration, three major breakthroughs are achieved: ① Adaptability to complex environments: wide range of light intensity and high sensitivity. ② Cost breakthrough: the overall cost is reduced to 1 / 3 of traditional equipment, and the power consumption is low, enabling long-term continuous monitoring of light intensity in complex scenarios. ③ Functional breakthrough: a complete functional chain of measurement, analysis, early warning, and display is integrated into a single device, ultimately providing a mass-producible and easily deployed light environment monitoring terminal for fields such as smart agriculture, green building, and smart home, promoting the popularization of photoelectric detection technology.

[0025] (2) The digital illuminance meter of this utility model also has the advantages of high detection sensitivity, low hardware cost and small size. The TSL-2561 photoelectric sensor has the advantages of wide dynamic range, high sensitivity and low power consumption. The single-chip microcomputer based on STC89C52 is a low power consumption, high performance 8-bit microcontroller with MCS-51 core. The two realize the intelligent interactive system design through I2C communication. It integrates three-in-one technology with other modules and innovatively integrates three major functions: threshold setting, sound and light alarm and LCD display. It breaks through the limitation of traditional illuminance meters that only have single detection, significantly improves the multifunctionality and ease of operation of the device. Finally, the use of a portable power supply as a power module enables it to provide a stable and reliable working voltage for each module for a long time. Attached Figure Description

[0026] The features and advantages of this utility model will be more clearly understood by referring to the accompanying drawings. The drawings are schematic and should not be construed as limiting the utility model in any way. In the drawings:

[0027] Figure 1 This is a structural block diagram of the digital illuminance meter based on the 51 microcontroller in this utility model. The dashed lines in the diagram represent power supply connections, and the solid lines represent data communication connections.

[0028] Figure 2 This utility model Figure 2 Circuit diagram of the STC89C52 microcontroller control circuit.

[0029] Figure 3 This utility model Figure 2 A block diagram of the TSL-2561 photoelectric sensor.

[0030] Figure 4 This utility model Figure 2 Circuit diagram of the button control circuit.

[0031] Figure 5 This utility model Figure 2 Circuit diagram of the buzzer in the sound and light alarm circuit.

[0032] Figure 6 This utility model Figure 2 Circuit diagram of the signal alarm light in the sound and light alarm circuit.

[0033] Figure 7 This utility model Figure 2 LCD1602 LCD interface circuit diagram.

[0034] Figure 8 This utility model Figure 2 Circuit diagram of the power supply module. Detailed Implementation

[0035] To make the above-mentioned objectives, features, and advantages of this utility model more apparent and understandable, the specific embodiments of this utility model are described in detail below with reference to the accompanying drawings. Many specific details are set forth in the following description to provide a full understanding of this utility model. However, this utility model can be implemented in many other ways different from those described herein, and those skilled in the art can make similar modifications without departing from the spirit of this utility model. Therefore, this utility model is not limited to the specific embodiments disclosed below.

[0036] like Figure 1-8 The diagram shown is a structural block diagram of the digital illuminance meter based on the 51 microcontroller in this invention, and the circuit diagram of each module.

[0037] like Figure 1 As shown, this utility model improves upon the design of a digital illuminance meter based on a 51 microcontroller. The digital illuminance meter includes an STC89C52 microcontroller 1, a TSL-2561 photoelectric sensor 2, a liquid crystal display circuit 3, a button control circuit 4, an audible and visual alarm circuit 5, and a power module 6. The STC89C52 microcontroller 1 is communicatively connected to the TSL-2561 photoelectric sensor 2, the liquid crystal display circuit 3, the button control circuit 4, and the audible and visual alarm circuit 5, respectively. The power module 6 is connected to supply power to the STC89C52 microcontroller 1, the TSL-2561 photoelectric sensor 2, the liquid crystal display circuit 3, and the audible and visual alarm circuit 5, respectively. The power module 6 is a portable power source.

[0038] Therefore, it can be seen that this utility model effectively solves the technical problem of long-term continuous monitoring of light intensity in complex scenes by organically combining "STC89C52 microcontroller + TSL-2561 photoelectric sensor + LCD display circuit + button control circuit + sound and light alarm circuit + portable power supply". Moreover, it can freely set the alarm threshold, improve the wide dynamic range and sensitivity of light detection, and can perform light monitoring in complex scenes under day and night conditions. It also reduces the overall power consumption and cost of hardware and can operate continuously for a long time.

[0039] To facilitate understanding of the overall structure of this digital illuminance meter and the advantages of each module, the detailed design process of the six modules will now be introduced.

[0040] (1) STC89C52 microcontroller

[0041] When selecting a microcontroller main control chip, multiple factors such as performance, power consumption, and cost need to be considered comprehensively. Currently, the mainstream microcontrollers on the market include: STMicroelectronics' STM32F103C8T6, Atmel's AT89C51, and STC's STC89C52. A comparison of the advantages and disadvantages of each chip model is shown in Table 1.

[0042] Table 1 Comparison of advantages and disadvantages of main control chips

[0043]

[0044] After comprehensive comparative analysis, this invention ultimately selected the domestically produced STC89C52 chip as the main control unit. This chip maintains a low cost while possessing excellent computing performance and superior energy efficiency, and supports I2C protocol communication. In a photoelectric digital illuminance system, its powerful data processing capabilities ensure the accuracy of illuminance measurement and effectively reduce system errors; simultaneously, its low-power design reduces energy consumption, meeting both system functional requirements and adhering to the green and energy-saving design philosophy. This choice reflects a balance between performance and cost.

[0045] like Figure 2 As shown, the control module of the STC89C52 microcontroller 1 consists of the STC89C52 main control chip, a 12MHz crystal oscillator circuit, and a reset circuit. The design of the microcontroller control module is based on the STC89C52 chip, and its hardware circuit mainly includes three key parts: power supply connection, clock circuit, and reset circuit. In terms of power supply design, pin 40 of the chip is connected to the positive VCC power supply of the power module, and pin 20 needs to be reliably grounded to form a complete circuit. Since the system uses on-chip memory mode, pin 30 (EA / VPP) is connected to the high level VCC, thus ensuring that the microcontroller correctly reads the instruction code from the internal program memory.

[0046] To ensure the timing accuracy of the system, a 12MHz high-precision crystal oscillator (Y1) is used as the clock source, paired with two 30pF ceramic chip capacitors to form a parallel resonant circuit. This oscillation circuit provides a stable clock signal to the microcontroller, ensuring the timing accuracy of instruction execution and data processing. In practical applications, the capacitor values ​​must be strictly matched to the parameters of the crystal oscillator to avoid problems such as frequency drift or difficulty in starting up.

[0047] The reset circuit employs a classic button reset design, allowing direct connection of the VCC power supply to the microcontroller's RST reset pin by pressing the S0 button. This design enables rapid restart in case of system malfunctions or crashes, but careful attention must be paid to the proper execution of the reset operation. Unnecessary resets should be avoided, as each reset causes the program to restart from the beginning, potentially affecting system real-time performance and data integrity. Furthermore, during circuit layout, the reset signal line should be minimized and properly filtered to improve interference immunity.

[0048] Therefore, the STC89C52 microcontroller can preferably be implemented using a minimum system. A minimum system is a hardware configuration consisting of the most basic circuit components, ensuring the normal operation of the microcontroller. The entire control module provides a stable operating environment for the microcontroller system through a carefully designed power network, a precise clock circuit, and a reliable reset mechanism. The optimized design of these basic circuits not only guarantees the system's basic operational functions but also lays the hardware foundation for subsequent functional expansion and performance improvements. In practical applications, these circuits need to be appropriately adjusted according to specific requirements to achieve optimal system performance and stability.

[0049] Furthermore, in order to achieve I2C communication between the STC89C52 microcontroller 1 and the TSL-2561 photoelectric sensor, this invention uses pin 1 and pin 2 of the STC89C52 microcontroller 1 to connect to the SCL pin and SDA pin of the TSL-2561 photoelectric sensor, respectively. In addition, the communication line between the two can also be connected to the positive VCC power supply of the power module through a pull-up resistor, thereby improving the circuit driving capability when realizing I2C bus communication between SCL and SDA.

[0050] (2) TSL-2561 photoelectric sensor

[0051] The TSL-2561 photoelectric sensor 2, as a photoelectric detection circuit, converts light signals into electrical signals to measure ambient light intensity. Light signals transmit information through changes in physical parameters such as intensity and frequency, and can be in analog or digital form; while electrical signals are presented as voltage or current changes over time, and are widely used due to their ease of transmission and processing.

[0052] Common current illuminance detection solutions include circuits using silicon photodiodes, PIN photodiodes, and avalanche photodiodes. This invention selects an ambient light detection module integrating the TSL-2561 chip, primarily based on the following advantages:

[0053] Wide dynamic range: It can detect a wide range of light intensity, from 0.1 lux to 40,000 lux, and can adapt to different environments from weak light to strong light, such as dim indoor lighting environment to bright outdoor sunlight environment, and can accurately measure.

[0054] High sensitivity: It is very sensitive to changes in light and can detect minute changes in light intensity, making it suitable for applications that require precise light detection.

[0055] Programmable gain and integration time: Users can adjust the sensor's gain and integration time according to actual needs to optimize measurement accuracy under different lighting conditions. For example, in low-light environments, the gain and integration time can be increased to improve measurement sensitivity.

[0056] I²C Interface: Uses the I²C communication protocol to transmit data with the microcontroller. This interface method is simple and universal, and is easy to integrate with various development boards.

[0057] Low power consumption: Low operating current, suitable for battery-powered devices, effectively extending device battery life.

[0058] The TSL2561 is an ambient light sensor manufactured by TAOS (now part of Texas Instruments). It senses the intensity of ambient light and incorporates two photodiodes, one sensitive to visible light and the other to infrared light. By processing the output signals from these two photodiodes, the ambient light intensity can be calculated. Furthermore, it converts the light signal into a digital signal, outputting it via an I²C interface for easy connection and communication with an MCS51 microcontroller. The specific circuit structure of the TSL-2561 photoelectric sensor is as follows: Figure 3 As shown, its 4th pin SCL and 6th pin SDA are used to implement I2C communication with the STC89C52 microcontroller's 1st pin (P10) and 2nd pin (P11) respectively. For other functional interfaces, please refer to the datasheet manual for wiring instructions.

[0059] (3) Button control circuit

[0060] The button control circuit 4 uses multiple buttons to adjust the parameters of each module. This design expands upon the existing light measurement function by adding a button control circuit. In microcontroller control systems, buttons typically employ two design schemes: independent and matrix. Independent buttons occupy a dedicated I / O port, offering simplicity and non-interference, but consuming more I / O resources. Matrix keyboards use a row-column structure, supporting up to 16 buttons through 4 row lines and 4 column lines, significantly improving I / O port utilization, but suffer from button interference. Considering this system only requires three function buttons, the simple and reliable independent button scheme is chosen. The specific circuit implementation is as follows... Figure 4 As shown in the figure. This design satisfies the functional requirement of setting the illumination threshold while ensuring the stability and ease of use of the system.

[0061] like Figure 4 As shown, the button control circuit 4 includes three function buttons: K1 is the mode switching button (set / exit), K2 is the incremental adjustment button (+1), and K3 is the decrement adjustment button (-1). In the photoelectric digital illuminance system, the user can enter the threshold setting mode through the K1 button. At this time, the system allows the upper and lower limit alarm values ​​of the illuminance to be adjusted using the K2 (increase) and K3 (decrease) buttons. After completing the threshold setting, pressing the K1 button again will save the settings and return to the normal working mode. This simple three-button design realizes the parameter configuration function and ensures the convenience of operation. The button control circuit can be connected to the three I / O ports of the STC89C52 microcontroller according to specific needs.

[0062] (4) Audible and visual alarm circuit

[0063] The audible and visual alarm circuit 5 consists of two parts: a buzzer alarm circuit for audible alarm and an indicator light circuit for visual alarm. The buzzer alarm circuit is as follows: Figure 5 As shown. The signal indicator circuit is as follows. Figure 6 As shown.

[0064] Figure 5 The circuit uses an 8550 transistor as the driver for the buzzer. When connecting, pay attention to the three electrodes of the driving transistor: the base (B) is connected to the output I / O port of the STC89C52 microcontroller via a current-limiting resistor to control the signal; the emitter (E), marked with an arrow, is connected to the power supply VCC; and the collector (C) directly drives the buzzer. The selected U2 buzzer is an active type, meaning it sounds immediately upon power-on. This design ensures both the simplicity of the driver circuit and the immediate response to the alarm signal. The arrow marking on the emitter provides a clear indication of the transistor pins, while the base resistor effectively controls the drive current.

[0065] Figure 6The signal indicator circuit employs a dual-LED indicator system with a common anode connection. The anodes of both LEDs, D1 and D2, are connected to the VCC power supply (5V) of the power module, while their cathodes are connected to designated I / O ports of the STC89C52 microcontroller via current-limiting resistors R2 and R3, respectively. When the system detects that the ambient light intensity exceeds a preset upper threshold, the corresponding I / O port of the microcontroller outputs a low level to drive D1 to illuminate as an alarm; when the light intensity is below the set lower threshold, D2 illuminates in the same manner as an alarm. This design, by directly controlling the LED cathode potential through the microcontroller and using current-limiting resistors to ensure stable operating current, achieves both bidirectional indication of light intensity exceeding limits and maintains a simple and efficient circuit structure.

[0066] (5) Liquid crystal display circuit

[0067] This invention selects a conventional LCD1602 character dot-matrix liquid crystal module as the liquid crystal display circuit 3, mainly based on its three major advantages: clear and intuitive display, perfectly presenting light intensity data; extremely low power consumption, meeting the energy-saving requirements for long-term system operation; and simple control, requiring only a single-chip microcomputer I / O port for stable driving. As the core display component of the photoelectric digital illuminance system, this liquid crystal module, with its excellent visibility and reliability, provides an ideal display solution for real-time monitoring of light intensity. Its specific interface circuit implementation is as follows... Figure 7 As shown.

[0068] The LCD1602 liquid crystal display is used as the core display module to display various data during the light intensity measurement process in real time. This dual-line character LCD screen can clearly display 16 characters per line, with a total display capacity of 32 characters, fully meeting the system requirements. In terms of hardware connections, the 16 pins of the display adopt a standard connection: pins 1 and 16 are grounded, pins 2 and 15 are connected to VCC power; pin 3 uses an adjustable potentiometer to adjust the display contrast; pins 4-6 are directly connected to the microcontroller's I / O port as control terminals; pins 7-14 are connected to the microcontroller as an 8-bit data bus. Other interfaces of the LCD1602 display circuit are conventionally connected, so details are omitted here. A specially designed contrast adjustment circuit optimizes the display effect by adjusting the potentiometer's voltage division ratio. When the display is unclear or fails to display, simply adjusting the potentiometer quickly resolves the problem. This design ensures display stability while providing flexible adjustment methods, allowing the LCD1602 to achieve optimal display performance in the photoelectric digital illuminance system.

[0069] (6) Power supply module

[0070] There are two common power sources for power module 6: one is dry cell battery power, such as a battery box; the other is portable power supply, such as a power bank. In order to extend the online monitoring time of light intensity as much as possible and reduce the size of the circuit, this utility model chooses portable power supply such as a power bank for three reasons: first, it can be recharged and used repeatedly, which is more environmentally friendly; second, it has a large capacity, which makes the power supply more stable; and third, it is easy to carry and plug and unplug.

[0071] See Figure 8 As shown, the entire system can be powered by a portable power supply. The circuit uses the USB port of the portable power supply for power, and draws 5V DC power from VCC. When the self-locking switch K0 is closed, if the LED D0 can be lit, it indicates that the circuit is working normally.

[0072] Although embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations all fall within the scope defined by the appended claims.

Claims

1. A digital illuminance meter based on a 51 microcontroller, characterized in that, The digital illuminance meter includes an STC89C52 microcontroller, a TSL-2561 photoelectric sensor, an LCD display circuit, a button control circuit, an audible and visual alarm circuit, and a power module. The STC89C52 microcontroller is communicatively connected to the TSL-2561 photoelectric sensor, the LCD display circuit, the button control circuit, and the audible and visual alarm circuit. The power module is a portable power source. The STC89C52 microcontroller includes a main control chip STC89C52, a 12MHz crystal oscillator circuit, and a reset circuit. The STC89C52 microcontroller and the TSL-2561 photoelectric sensor are connected via I2C communication. The first pin of the STC89C52 microcontroller is connected to the SCL pin of the TSL-2561 photoelectric sensor, and the second pin of the STC89C52 microcontroller is connected to the SDA pin of the TSL-2561 photoelectric sensor. The button control circuit includes three function buttons K1~K3, where K1 is the mode switching button, K2 is the incremental adjustment button, and K3 is the decrement adjustment button. The audible and visual alarm circuit includes a buzzer alarm circuit, which uses an 8550 transistor as the driving element of the buzzer. The base of the 8550 transistor is connected to the output I / O port control signal of the STC89C52 microcontroller through a current-limiting resistor. The emitter of the 8550 transistor is connected to the VCC voltage output terminal of the power supply module. The collector of the 8550 transistor directly drives one end of the buzzer, and the other end of the buzzer is grounded. The sound and light alarm circuit includes a signal indicator circuit, which includes a dual LED indicator system using a common anode connection. In the dual LED indicator system, the anodes of LEDs D1 and D2 are connected to the VCC voltage output terminal of the power supply module, and the cathodes of LEDs D1 and D2 are connected to two designated I / O ports of the STC89C52 microcontroller through current limiting resistors R2 and R3, respectively. The liquid crystal display circuit includes an LCD1602 character dot matrix liquid crystal module. The 16 pins of the LCD1602 character dot matrix liquid crystal module's display screen adopt a standard connection method: pins 1 and 16 are grounded, pins 2 and 15 are connected to VCC power supply, pin 3 realizes display contrast adjustment through an adjustable potentiometer, pins 4-6 are used as control terminals and directly connected to the microcontroller I / O port, and pins 7-14 are used as an 8-bit data bus and connected to the microcontroller. The portable power source is a power bank, which provides 5V voltage via a USB port.