Intelligent fan system based on STM32

By designing an intelligent fan system based on STM32, integrating multiple sensors and voice recognition modules, the problem of simple existing fan functions is solved, and intelligent, personalized and efficient fan control is realized.

CN119393357APending Publication Date: 2025-02-07YUNNAN ELEPHANT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411531738.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-30
Publication Date
2025-02-07

AI Technical Summary

Technical Problem

The existing fan functions are simple and cannot meet the needs of intelligence, personalization and efficiency in modern smart home environments.

Method used

Design an intelligent fan system based on STM32, integrating voice recognition module, temperature sensor module, infrared sensor module, etc., and combining multiple sensor data through algorithms to achieve comprehensive perception of the environment and intelligently adjust the working status of the fan.

Benefits of technology

It realizes intelligent control of the fan, and has functions such as automatic adjustment of wind speed, human body recognition mode, voice control and lighting control, improving user experience and convenience of use.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119393357A_ABST
    Figure CN119393357A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of fans, and particularly discloses an STM32-based intelligent fan system which comprises an STM32 single-chip microcomputer, a voice recognition module, a temperature sensor module, a display screen module, an infrared sensor module, a direct-current fan, a lamplight module, a power supply control module and a key module, and the voice recognition module is electrically connected with the GPIO end of the STM32 single-chip microcomputer; the temperature sensor module is electrically connected with a GPIO (General Purpose Input / Output) end of the STM32 single chip microcomputer through a temperature sensor module circuit; the display screen module is electrically connected with the STM32 single-chip microcomputer through the display circuit. The output port of the infrared sensor module is connected with the PA6 end of the STM32 single-chip microcomputer. The direct current fan is electrically connected with the GPIO end of the STM32 single-chip microcomputer. The light module is electrically connected with the STM32 single-chip microcomputer through the light control circuit. The power supply control module supplies power to the STM32 single-chip microcomputer through the single-chip microcomputer power supply circuit.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of fan technology, and in particular to an intelligent fan system based on STM32. Background Art

[0002] With the rapid development of information technology, the smart home industry has developed rapidly, but the functions of many fans on the market are still simple and cannot meet the needs of intelligence, personalization and efficiency in modern smart home environments. Summary of the invention

[0003] The purpose of this application is to provide an STM32-based intelligent fan system to solve the problem that the fan function in the prior art is still simple and cannot meet the needs of intelligence, personalization and efficiency in a modern smart home environment.

[0004] To achieve the above purpose, the embodiment of the present application provides an STM32-based intelligent fan system, including: an STM32 single-chip microcomputer, a voice recognition module, a temperature sensor module, a display module, an infrared sensor module, a DC fan, a lighting module, a power control module, and a button module, wherein:

[0005] The speech recognition module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer;

[0006] The temperature sensor module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer through a temperature sensor module circuit;

[0007] The display screen module is electrically connected to the STM32 single-chip microcomputer through a display circuit;

[0008] The output port of the infrared sensor module is connected to the PA6 terminal of the STM32 microcontroller;

[0009] The DC fan is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer;

[0010] The lighting module is electrically connected to the STM32 single-chip microcomputer through a lighting control circuit;

[0011] The power control module supplies power to the STM32 single-chip microcomputer through the single-chip microcomputer power supply circuit.

[0012] Optionally, the single-chip microcomputer power supply circuit includes capacitor C1, capacitor C2, capacitor C3, capacitor C4, and a voltage stabilizing chip, wherein the first end of the capacitor C1 and the first end of the capacitor C2 are both connected to the power output end of the power control module and the VIN end and CE end of the voltage stabilizing chip, the second end of the capacitor C1 and the second end of the capacitor C2 are both connected to the VSS end of the voltage stabilizing chip and grounded, the first end of the capacitor C3 and the first end of the capacitor C4 are both connected to the VOUT end of the voltage stabilizing chip and the VCC end of the single-chip microcomputer power supply circuit, the VCC end of the single-chip microcomputer power supply circuit is connected to the VDD end of the STM32 single-chip microcomputer, and the second end of the capacitor C3 and the second end of the capacitor C4 are both grounded.

[0013] Optionally, it also includes:

[0014] A reset circuit, wherein the reset circuit module is connected to the NRST terminal of the STM32 single-chip microcomputer.

[0015] Optionally, the reset circuit includes a capacitor C5, a resistor R4, and a reset switch, wherein the first end of the resistor R4 is connected to the VCC end of the microcontroller power supply circuit, the second end of the resistor R4 is connected to the first end of the capacitor C5 and the first end of the reset switch, the second end of the capacitor C5 and the second end of the reset switch are both grounded, and the first end of the reset switch is connected to the NRST end of the STM32 microcontroller.

[0016] Optionally, the lighting control circuit includes: a diode D1, a relay, a transistor Q1, and a resistor R9, wherein the cathode of the diode D1, the first end of the relay coil, and the first end of the relay contact are all connected to the VCC end of the single-chip power supply circuit, the anode of the diode D1 and the second end of the relay coil are connected to the emitter of the transistor Q1, the base of the transistor Q1 is connected to the first end of the resistor R9, the second end of the resistor R9 is connected to the PB7 end of the STM32 single-chip microcomputer, the collector of the transistor Q1 is grounded, and the second end of the relay contact is connected to the interface end of the lighting module.

[0017] Optionally, the temperature sensor module circuit includes: a resistor R10, a first end of the resistor R10 is respectively connected to the PB6 end of the STM32 microcontroller and the DQ end of the temperature sensor, and a second end of the resistor R10 is connected to the VCC end of the microcontroller power supply circuit.

[0018] Optionally, the display circuit includes: capacitor C23, capacitor C24, capacitor C25, capacitor C26, capacitor C27, capacitor C28, resistor R16, resistor R17, resistor R18, resistor R19, R20, wherein two ends of the capacitor C23 are respectively connected to the C2P end and C2N end of the display screen module, two ends of the capacitor C24 are respectively connected to the C1P end and C1N end of the display screen module, one end of the capacitor C25 is connected to the VBAT end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C25 is grounded, one end of the capacitor C26 is connected to the VDD end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C26 is grounded, and one end of the resistor R16 is connected to the BS end of the display screen module. 1 end, the other end of the resistor R16 is grounded, one end of the resistor R17 is connected to the D / C end of the display screen module, and the other end of the resistor R17 is grounded, one end of the resistor R18 is connected to the D0 end of the display screen module, and the other end of the resistor R18 is connected to the VCC end of the single-chip power supply circuit, one end of the resistor R19 is connected to the D1 and D2 ends of the display screen module, and the other end of the resistor R19 is connected to the VCC end of the single-chip power supply circuit, one end of the resistor R20 is connected to the IREF end of the display screen module, and the other end of the resistor R20 is grounded, one end of the capacitor C27 is connected to the VCOMH end of the display screen module, and the other end of the capacitor C27 is grounded, one end of the capacitor C28 is connected to the VCC end of the display screen module, and the other end of the capacitor C28 is grounded.

[0019] Optionally, the voice recognition module is internally provided with an LD3320 chip and an STC11L08XE single-chip microcomputer, and the voice recognition module is integrated with a microphone port and a sound output interface;

[0020] The temperature sensor module is provided with a DS18B20 programmable digital temperature sensor;

[0021] The display screen module is provided with a 4-pin OLED screen, and the OLED screen includes GND, VCC, SCL and SDA terminals, wherein the GND terminal of the OLED screen is grounded, the VCC terminal of the OLED screen is connected to the VCC terminal of the microcontroller power supply circuit, the SCL terminal of the OLED screen is connected to the PA0 terminal of the STM32 microcontroller, and the SDA terminal of the OLED screen is connected to the PA1 terminal of the STM32 microcontroller;

[0022] The infrared sensor module is provided with an infrared tube sensor;

[0023] The DC fan is a 5V powered DC fan;

[0024] The lighting module is provided with a 5V powered LED lamp;

[0025] The key module is provided with a light touch switch;

[0026] The power control module supplies power to the minimum system board of the STM32 single-chip microcomputer through a 5V micro USB port.

[0027] The embodiments of the present application have the following advantages:

[0028] Compared with the existing technology, the STM32-based smart fan system provided by the above technical solution integrates multiple sensor data such as temperature sensors, infrared sensors, and voice recognition modules. Through algorithm fusion, it realizes comprehensive perception of the environment and intelligently adjusts the working state of the fan. The smart fan system includes three working modes. In manual mode, the fan is controlled by buttons and voice. In automatic mode, the fan position changes according to the ambient temperature. In human recognition mode, the fan starts when a person appears in front of the fan, and the fan automatically turns off when the person leaves.

[0029] In manual mode, the lights, fan switches, fan gears and timing functions are controlled by buttons. A more advanced voice recognition function is also provided. The voice recognition system can accurately identify commands and control the operation of fans and lights.

[0030] In automatic mode, the fan automatically adjusts the gear according to the temperature detected by the temperature sensor: it increases the gear when the temperature rises and decreases the gear when the temperature drops.

[0031] The human recognition mode starts the fan when a human body is detected by the infrared sensor. If no human body is detected within 5 seconds, the fan automatically turns off. BRIEF DESCRIPTION OF THE DRAWINGS

[0032] In order to more clearly illustrate the implementation methods of the present application or the technical solutions in the prior art, the following briefly introduces the drawings required for the implementation methods or the description of the prior art. Obviously, the drawings described below are only exemplary, and for ordinary technicians in this field, other implementation drawings can be derived from the provided drawings without creative work.

[0033] Figure 1 A system structure diagram of an STM32-based intelligent fan system provided for at least one embodiment of the present application;

[0034] Figure 2 A schematic diagram of a power supply circuit of an STM32 microcontroller of an STM32-based intelligent fan system provided in at least one embodiment of the present application;

[0035] Figure 3 A schematic diagram of a reset circuit of an STM32-based intelligent fan system provided in at least one embodiment of the present application;

[0036] Figure 4 A schematic diagram of a lighting control circuit of an STM32-based intelligent fan system provided in at least one embodiment of the present application;

[0037] Figure 5 A schematic diagram of a temperature sensor module circuit of an STM32-based intelligent fan system provided by at least one embodiment of the present application;

[0038] Figure 6 A schematic circuit diagram of an infrared sensor module of an STM32-based intelligent fan system provided by at least one embodiment of the present application;

[0039] Figure 7 A schematic diagram of a display circuit of an STM32-based intelligent fan system provided in at least one embodiment of the present application;

[0040] Figure 8 A system program flow chart of an STM32-based intelligent fan system provided for at least one embodiment of the present application;

[0041] Fig. 9 A flowchart of automatic fan gear selection of an STM32-based intelligent fan system is provided for at least one embodiment of the present application. DETAILED DESCRIPTION

[0042] The following is a description of the implementation of the present application by specific specific embodiments. People familiar with the technology can easily understand other advantages and effects of the present application from the contents disclosed in this specification. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in the field without creative work are within the scope of protection of the present application.

[0043] In the description of this application, it should be noted that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two components. For ordinary technicians in this field, the specific meanings of the above terms in this application can be understood according to specific circumstances.

[0044] In addition, the technical features involved in the different embodiments of the present application described below can be combined with each other as long as they do not conflict with each other.

[0045] The present application embodiment provides a smart fan system based on STM32, referring to Figure 1, including: STM32 microcontroller, voice recognition module, temperature sensor module, display module, infrared sensor module, DC fan, lighting module, power control module and other functional modules.

[0046] Specifically, the core control chip selected for the intelligent fan system design of this embodiment is the STM32F103C8T6 based on the Cortex-M3 core, that is, the STM32 single-chip microcomputer, which is a high-performance, highly compatible, easy-to-develop, low-power 32-bit flash memory microcontroller product with real-time digital signal processing.

[0047] The speech recognition module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer.

[0048] In some embodiments, the speech recognition module is internally provided with an LD3320 chip and a STC11L08XE single-chip microcomputer, and the speech recognition module is integrated with external circuits such as a microphone port and a sound output interface.

[0049] Specifically, the LD3320 chip is designed by ICRoute. The chip can perform non-specific speech recognition through a special algorithm. Speech recognition does not require prior training and recording. Speech recognition can be completed as long as the corresponding keywords are spoken. It is very convenient to use.

[0050] When speech recognition starts, the module's microphone receives surrounding sounds. These sounds are not necessarily sounds with keywords, but may also be meaningless sounds. The speech recognition chip decomposes the received sounds spectrally, extracts the corresponding frequencies based on the sound features, and then matches the keywords with the chip database. Different keywords will be scored, and the one with the highest score will be selected as the output.

[0051] The temperature sensor module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer through a temperature sensor module circuit.

[0052] In some embodiments, in order to detect the ambient temperature, the temperature sensor module of the system is provided with a DS18B20 programmable digital temperature sensor, which has the advantages of strong anti-interference ability, low price, and easy use. The temperature measurement result of the temperature sensor module is obtained through the characteristics of the internal precision crystal oscillator vibration frequency changing with temperature. The temperature sensor contains an independent measurement chip inside, and the chip has a built-in storage unit, including a 64-bit ROM and a 9-byte RAM. The 64-bit ROM is used to store the product code, and the first two bytes of the 9-byte RAM are used to save the temperature information.

[0053] The high degree of integration of the temperature sensor DS18B20 greatly reduces the error factors of external amplifier conversion circuits, and the measured temperature error is very small. The detected temperature value can be converted into a digital value and directly output inside the device, which facilitates system programming. The detailed parameters of the temperature sensor are as follows:

[0054] (1) When the DS18B20 temperature sensor is connected to a microprocessor, only one line is needed to achieve two-way communication between the microprocessor and the DS18B20.

[0055] (2) Operating voltage range: 1.8V~5.5V.

[0056] (3) Temperature measurement range: -55~+125℃, the default temperature measurement resolution is 0.5℃.

[0057] (4) A 9- to 12-bit digital reading mode can be achieved.

[0058] (5) Multiple sensors can be connected in parallel on a bus to measure the temperature of multiple locations.

[0059] (6) The sensor will not be damaged due to reverse power connection.

[0060] The display screen module is electrically connected to the STM32 single-chip microcomputer through a display circuit.

[0061] In some embodiments, the display module has a 4-pin 9.6-inch OLED screen.

[0062] Specifically, this is a new type of screen technology with the characteristics of self-luminescence, and has the advantages of large viewing angle, low power consumption, and high contrast. Compared with LCD screens, OLED has better display effects, lower power consumption, and is suitable for small systems. The OLED screen supports 3.3V~5V power supply, so there is no need to modify the module circuit. The OLED screen contains 4 pins, namely GND, VCC, SCL and SDA, wherein the GND end of the OLED screen is grounded, the VCC end of the OLED screen is connected to the VCC end of the microcontroller power supply circuit, the SCL end of the OLED screen is connected to the PA0 end of the STM32 microcontroller, and the SDA end of the OLED screen is connected to the PA1 end of the STM32 microcontroller. The OLED screen can display characters, numbers, Chinese characters, etc. as needed, and is simple and convenient to use.

[0063] The output port of the infrared sensor module is connected to the PA6 terminal of the STM32 single-chip microcomputer.

[0064] Specifically, the operating voltage of the infrared sensor module is 3.3V to 5V, and the infrared sensor module will continuously output low-level information when detecting a human body.

[0065] In some embodiments, the infrared sensor module is provided with an infrared pair sensor for detecting a human body.

[0066] Specifically, the infrared pair tube sensor has the characteristics of small interference, easy assembly, and convenient use. The infrared pair tube sensor is composed of an infrared transmitting tube and a photosensitive receiving tube. When the infrared pair tube sensor is working, the transmitting tube will emit infrared rays that are invisible to the human eye. When the detection direction encounters an obstacle, the infrared rays will be reflected back and received by the receiving tube. After being processed by the LM393 comparator circuit, the output indicator light will light up, and the OUT port will output a low-level digital signal.

[0067] The DC fan is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer.

[0068] The DC fan is a 5V powered DC fan, which is a small fan that is safer to use and can be easily controlled by a single chip microcomputer.

[0069] Specifically, the DC fan uses PWM wave to control the fan speed, so the DC fan can have multiple gear options, and you can adjust the appropriate speed according to your needs. The DC fan has very little noise, which will not affect work and rest when used, and makes voice recognition more reliable and accurate.

[0070] The lighting module is electrically connected to the STM32 single-chip microcomputer via a lighting control circuit.

[0071] In some embodiments, the light module is provided with a 5V powered LED lamp for lighting. The scientific name of LED is light emitting diode. This luminous material is made of various compounds such as N, P, As, etc. When electrons and holes meet, light can be generated. This light can have various colors. In this embodiment, a white LED lamp is selected.

[0072] Specifically, the light selected by the light module can be used for reading at night, or for decorating the home environment, etc., which can meet most lighting needs. Adding the lighting function to the smart fan enriches the product function and can also save the space occupied by the desk lamp. The smart fan system contains a button specifically for controlling the light. In addition to the button, the light can also be controlled by voice. Just say keywords such as turn on the light, turn off the light, etc. to control the light operation.

[0073] In some embodiments, the button module is provided with a touch switch.

[0074] Specifically, a spring is provided inside the key of the key module. Such a key only needs to apply a very small force to close the switch. When the hand is released, the key will automatically bounce back. It has a good hand feel, a sense of segmentation, and a crisp sound, which is easy to distinguish.

[0075] Touch switches are widely used in remote controls, toys, household appliances, etc. There are many factors that affect the use of touch buttons, mainly the corrosion resistance, lifespan, and pressing feel of the switch. In order to reduce contact resistance, general switches use silver plating to silver-plate the base material of the button pins.

[0076] The quality of the spring determines the feel of the key. Currently, the most commonly used technology is Japanese stamping technology. Keys using this technology can withstand tens of thousands of presses, are very durable and feel very good. The design uses 7 keys to form an independent key, and each key directly uses the IO port line to form a single keyboard circuit, which is flexible in configuration and very convenient in software design.

[0077] The power control module supplies power to the STM32 single-chip microcomputer through the single-chip microcomputer power supply circuit.

[0078] Specifically, the power control module supplies power to the minimum system board of the STM32 single-chip microcomputer through a 5V micro USB port.

[0079] Specifically, because the STM32 chip requires a 3.3V voltage to work properly, the linear regulator on the minimum system board is used to convert the 5V voltage into 3.3V. This linear regulator is very low in cost and can be purchased for only a few cents. It is very small and can be easily installed on other devices. It has very little noise when working and a reliable and stable output current, so it is very suitable for use in a single-chip computer system.

[0080] In some embodiments, the single-chip microcomputer power supply circuit includes capacitor C1, capacitor C2, capacitor C3, capacitor C4, and a voltage stabilizing chip, wherein the first end of the capacitor C1 and the first end of the capacitor C2 are both connected to the power output end of the power control module and the VIN end and CE end of the voltage stabilizing chip, the second end of the capacitor C1 and the second end of the capacitor C2 are both connected to the VSS end of the voltage stabilizing chip and grounded, the first end of the capacitor C3 and the first end of the capacitor C4 are both connected to the VOUT end of the voltage stabilizing chip and the VCC end of the single-chip microcomputer power supply circuit, the VCC end of the single-chip microcomputer power supply circuit is connected to the VDD end of the STM32 single-chip microcomputer, and the second end of the capacitor C3 and the second end of the capacitor C4 are both grounded.

[0081] Specifically, the normal operating voltage of the STM32 microcontroller is 2.0~3.6V. When the power is off, the VBAT pin provides power for the RTC and backup registers. A stable and good power supply is the basis for realizing various functions. The design uses micro USB to power the system board. The power supply voltage is 5V. The minimum system board contains the ME6211 voltage regulator chip, which can convert the 5V voltage to 3.3V. The output current is 100MA. C1, C2, C3, and C4 are all filter capacitors, which filter out the AC part of the current, making the current smoother. The power supply circuit design is as follows: Figure 2 shown.

[0082] In some embodiments, it also includes: a reset circuit, wherein the reset circuit module is connected to the NRST terminal of the STM32 microcontroller.

[0083] The reset circuit includes a capacitor C5, a resistor R4, and a reset switch, wherein the first end of the resistor R4 is connected to the VCC end of the microcontroller power supply circuit, the second end of the resistor R4 is connected to the first end of the capacitor C5 and the first end of the reset switch, the second end of the capacitor C5 and the second end of the reset switch are both grounded, and the first end of the reset switch is connected to the NRST end of the STM32 microcontroller.

[0084] Specifically, the reset circuit can realize the initialization of the STM32 microcontroller. The stable operation of the system requires power-on reset and button reset. The circuit in the figure is a low-level reset circuit. When the power is turned on, the voltage across the capacitor cannot change suddenly, so NRST is a low-level reset. Then the capacitor is slowly charged, and the voltage at the NRST end slowly increases. When it rises to a certain high level, the STM32 microcontroller starts to work normally.

[0085] When the reset switch RST is pressed, NRST becomes low again to reset. The reset circuit is an indispensable part of the system. Figure 3 shown.

[0086] In some embodiments, the lighting control circuit includes: a diode D1, a relay, a transistor Q1, and a resistor R9, wherein the cathode of the diode D1, the first end of the relay coil, and the first end of the relay contact are all connected to the VCC end of the single-chip power supply circuit, the anode of the diode D1 and the second end of the relay coil are connected to the emitter of the transistor Q1, the base of the transistor Q1 is connected to the first end of the resistor R9, the second end of the resistor R9 is connected to the PB7 end of the STM32 single-chip microcomputer, the collector of the transistor Q1 is grounded, and the second end of the relay contact is connected to the interface end of the lighting module.

[0087] Specifically, refer to Figure 4, the light needs a 5V voltage supply, and the STM32 microcontroller outputs a maximum voltage of 3.3V, so a relay and a transistor are needed to control the circuit, so that weak current can control strong current. Generally, when the moving contact K1 and the normally closed pin are closed, the light does not work. When the STM32 microcontroller IO port outputs a signal, the relay generates a magnetic effect to attract the armature, the moving contact K1 and the normally open contact are closed, and the light turns on.

[0088] When the light stops working, in order to prevent the back electromotive force of the relay from damaging the relay, a freewheeling diode is connected in parallel to protect the relay. Figure 4 shown.

[0089] In some embodiments, the temperature sensor module circuit includes: a resistor R10, a first end of the resistor R10 is respectively connected to the PB6 end of the STM32 microcontroller and the DQ end of the temperature sensor, and a second end of the resistor R10 is connected to the VCC end of the microcontroller power supply circuit.

[0090] Specifically, refer to Figure 5 DS18B20 intelligent temperature sensor is a new generation of intelligent temperature sensor adapted to microprocessors. All sensor components and conversion circuits are integrated in a transistor-shaped integrated circuit, which can directly read data. The DQ port of the temperature sensor is connected to the PB6 pin of the microcontroller. The temperature sensor circuit is as follows: Figure 5 shown.

[0091] In some embodiments, the infrared sensor circuit is used to connect the infrared sensor module and the STM32 microcontroller. The infrared sensor module is powered by 3.3V, and the output port of the infrared sensor module is connected to the PA6 terminal of the STM32 microcontroller. Figure 6 shown.

[0092] In some embodiments, the display circuit includes: capacitor C23, capacitor C24, capacitor C25, capacitor C26, capacitor C27, capacitor C28, resistor R16, resistor R17, resistor R18, resistor R19, R20, wherein two ends of the capacitor C23 are respectively connected to the C2P end and C2N end of the display screen module, two ends of the capacitor C24 are respectively connected to the C1P end and C1N end of the display screen module, one end of the capacitor C25 is connected to the VBAT end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C25 is grounded, one end of the capacitor C26 is connected to the VDD end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C26 is grounded, one end of the resistor R16 is connected to the VDD end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C26 is grounded, and one end of the resistor R16 is connected to the The BS1 terminal is connected to the BS1 terminal, the other end of the resistor R16 is grounded, one end of the resistor R17 is connected to the D / C terminal of the display screen module, and the other end of the resistor R17 is grounded, one end of the resistor R18 is connected to the D0 terminal of the display screen module, and the other end of the resistor R18 is connected to the VCC terminal of the single-chip power supply circuit, one end of the resistor R19 is connected to the D1 and D2 terminals of the display screen module, and the other end of the resistor R19 is connected to the VCC terminal of the single-chip power supply circuit, one end of the resistor R20 is connected to the IREF terminal of the display screen module, and the other end of the resistor R20 is grounded, one end of the capacitor C27 is connected to the VCOMH terminal of the display screen module, and the other end of the capacitor C27 is grounded, one end of the capacitor C28 is connected to the VCC terminal of the display screen module, and the other end of the capacitor C28 is grounded.

[0093] Specifically, the 4-pin 0.96-inch OLED screen used in this system has a resolution of 128x64, which means that it has so many pixels, all of which can emit light by themselves, and then the corresponding pixels can be lit up through the program to form the text or pattern you want.

[0094] Specifically, the OLED screen uses I2C communication mode, the STM32 microcontroller is used as the host input, and the OLED screen is used as the slave to receive information. The software simulates the I2C communication mode, PA0 is set as the clock line, and PA1 is set as the data line. Data transmission is performed according to the level information of the clock line, and the data line is used to transmit information. Display circuit Figure 7 shown.

[0095] In some embodiments, the fan system is programmed using C language. In addition to the main program, there are multiple subroutines that perform temperature reading, motor control, timing setting, etc. The fan has three modes: human recognition mode, manual mode, and automatic mode. The system program flow is as follows: Figure 8 shown.

[0096] Specifically, the motor is set to be controlled by the PWM wave generated by the timer TIM4. First, use the TIM4 timer initialized by Timer4_Init(0,7200) to set the timer so that TIM4_CH4 outputs the PWM wave. The TIM_Set Compare4(TIM_Type Def*TIMx,uint16_t Compare4) function can adjust the duty cycle of the output PWM wave to achieve the effect of controlling the fan gear position.

[0097] In automatic mode, the fan position changes according to the ambient temperature detected by the temperature sensor, and the fan will not work when the sensor detects that the ambient temperature is below 20°C. In the temperature reading program, first use DS18B20_Init() to initialize DS18B20, enable the IO clock, set the IO port and detect whether the sensor exists according to the timing. If the sensor exists, the temperature value is output through DS18B20_Get_Temp(). The main function of the microcontroller will always read the temperature value detected by the sensor and change the fan to the corresponding position according to the corresponding temperature value. The fan position automatic selection process is as follows: Fig. 9 shown.

[0098] The fan is in manual mode by default when it is started. In manual mode, the fan can be controlled by voice and buttons. Before using the button, use Init_Key_Pin() to initialize the button IO and set the IO to pull-up input mode. In the main function, the While(1) loop is used to perform button input judgment. When a button is pressed, the pin where the button is located is grounded. The microcontroller determines which button is pressed by reading the level change of the IO port and performs the corresponding operation. In order to eliminate the influence of the mechanical jitter of the button on the judgment, when the button is detected to be pressed, the delay_ms(10) function will be used to delay 10ms before judging the level of the IO port again.

[0099] The LD3320 chip of the speech recognition module communicates with the STM32 microcontroller using SPI. The program of the speech recognition module is compiled inside the module. Before use, the LD3320 speech recognition chip register is set in the STM32 microcontroller program, the keywords are saved in a two-dimensional array in the form of strings, and a corresponding identification code is set for each keyword.

[0100] The main function first initializes the system, initializes the STM32 microcontroller, resets the LD3320 chip to activate its internal DSP, and repeatedly starts the ASR (non-specific person speech recognition technology) recognition of the speech recognition module. When the sound is recognized, the Process Int0() function is used to interrupt, read the identification code in the LD3320 register and return to the LD_Get Result() function, select the speech recognition result according to the speech recognition code, and output low-level information on the corresponding pin. STM32 performs corresponding operations on the fan system according to the level information received from different pins.

[0101] In summary, the intelligent fan system provided in the embodiment of the present application is based on the STM32 microcontroller and has the following functions: automatic control, adjusting the fan speed according to the external temperature; human body detection, automatically turning on when approaching and automatically turning off when leaving; sound control, using the LD3320 voice chip to recognize commands to control the fan; light control, controlling the light through voice or buttons; sleep timing, automatically turning off the fan after setting the timing.

[0102] The smart fan system provides three working modes: the automatic mode detects changes in ambient temperature through a temperature sensor and automatically adjusts the fan speed to optimize the effect; the manual mode allows the fan settings to be adjusted through buttons or voice control; the human recognition mode automatically starts when a person is detected approaching. The additional timing function supports setting the automatic shutdown time, bringing users a smarter and more convenient use experience.

[0103] Compared with the existing intelligent fan system, the STM32-based intelligent fan system may have the following advantages:

[0104] Higher integration: By leveraging the powerful peripheral support capabilities of STM32, more functions can be integrated into a single chip, reducing the complexity of peripheral circuits and reducing costs.

[0105] Lower power consumption: STM32 has a variety of low-power modes, which allows the smart fan to maintain low energy consumption even in standby mode.

[0106] Better user experience: Improve user convenience and usage experience through optimized human-computer interaction interface design and more intelligent control logic.

[0107] Better scalability: STM32 supports multiple communication interfaces (such as UART, SPI, I2C, etc.), allowing the system to easily exchange data with other smart devices or cloud platforms, enhancing the scalability and interoperability of the system.

[0108] Higher security: STM32 provides a variety of security features, such as encryption engine, secure boot, etc., which help protect the system's data security and personal privacy.

[0109] Through these improvements, the STM32-based smart fan system can better meet the needs of intelligence, personalization and efficiency in modern smart home environments.

[0110] By integrating multiple sensors (such as temperature sensors, voice recognition, human presence detection, etc.), the function of automatically adjusting the wind speed according to environmental changes is realized, providing a more natural and comfortable wind feeling experience; through precise motor control algorithms, such as PID control, the fan speed can be dynamically adjusted to avoid unnecessary energy waste. When it detects that no one is present, it automatically enters energy-saving mode or shuts down, saving energy and power.

[0111] The STM32-based smart fan system can not only meet the current market demand for smart home products, but also continue to evolve in the future with technological advances and changes in technical standards, becoming an important part of the smart home ecosystem.

[0112] Note that, unless otherwise directly stated, all features disclosed in this specification (including any attached claims, abstracts and drawings) may be replaced by alternative features for achieving the same, equivalent or similar purposes. Therefore, unless otherwise explicitly stated, each feature disclosed is only an example of a group of equivalent or similar features. Where used, further, preferably, further and more preferably are simple beginnings for elaborating another embodiment based on the aforementioned embodiment, and the content of the further, preferably, further or more preferably followed by the combination with the aforementioned embodiment constitutes a complete construction of another embodiment. Several further, preferably, further or more preferably settings following the same embodiment can be arbitrarily combined to form another embodiment.

[0113] In the implementation of functions and steps, the corresponding functions and steps in various embodiments may also occur in a different order than shown. For example, two consecutive functions and steps may actually be performed or implemented substantially in parallel, and they may sometimes be performed or implemented in the opposite order, depending on the functions involved.

[0114] Although the present application has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements may be made to the present application. Therefore, these modifications or improvements made without departing from the spirit of the present application all fall within the scope of protection claimed in the present application.

Claims

1. An intelligent fan system based on STM32, characterized in that: include: STM32 microcontroller, voice recognition module, temperature sensor module, display module, infrared sensor module, DC fan, lighting module, power control module, key module, among which, The speech recognition module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer; The temperature sensor module is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer through a temperature sensor module circuit; The display screen module is electrically connected to the STM32 single-chip microcomputer through a display circuit; The output port of the infrared sensor module is connected to the PA6 terminal of the STM32 microcontroller; The DC fan is electrically connected to the GPIO terminal of the STM32 single-chip microcomputer; The lighting module is electrically connected to the STM32 single-chip microcomputer through a lighting control circuit; The power control module supplies power to the STM32 single-chip microcomputer through the single-chip microcomputer power supply circuit.

2. The STM32-based intelligent fan system according to claim 1, characterized in that: The single-chip microcomputer power supply circuit includes capacitor C1, capacitor C2, capacitor C3, capacitor C4, and a voltage stabilizing chip, wherein the first end of the capacitor C1 and the first end of the capacitor C2 are both connected to the power output end of the power control module and the VIN end and CE end of the voltage stabilizing chip, the second end of the capacitor C1 and the second end of the capacitor C2 are both connected to the VSS end of the voltage stabilizing chip and grounded, the first end of the capacitor C3 and the first end of the capacitor C4 are both connected to the VOUT end of the voltage stabilizing chip and the VCC end of the single-chip microcomputer power supply circuit, the VCC end of the single-chip microcomputer power supply circuit is connected to the VDD end of the STM32 single-chip microcomputer, and the second end of the capacitor C3 and the second end of the capacitor C4 are both grounded.

3. The STM32-based intelligent fan system according to claim 2, characterized in that: Also includes: A reset circuit, wherein the reset circuit module is connected to the NRST terminal of the STM32 single-chip microcomputer.

4. The STM32-based intelligent fan system according to claim 3, characterized in that: The reset circuit includes a capacitor C5, a resistor R4, and a reset switch, wherein the first end of the resistor R4 is connected to the VCC end of the microcontroller power supply circuit, the second end of the resistor R4 is connected to the first end of the capacitor C5 and the first end of the reset switch, the second end of the capacitor C5 and the second end of the reset switch are both grounded, and the first end of the reset switch is connected to the NRST end of the STM32 microcontroller.

5. The STM32-based intelligent fan system according to claim 2, characterized in that: The lighting control circuit includes: a diode D1, a relay, a transistor Q1, and a resistor R9, wherein the cathode of the diode D1, the first end of the relay coil, and the first end of the relay contact are all connected to the VCC end of the single-chip power supply circuit, the anode of the diode D1 and the second end of the relay coil are connected to the emitter of the transistor Q1, the base of the transistor Q1 is connected to the first end of the resistor R9, the second end of the resistor R9 is connected to the PB7 end of the STM32 single-chip computer, the collector of the transistor Q1 is grounded, and the second end of the relay contact is connected to the interface end of the lighting module.

6. The STM32-based intelligent fan system according to claim 2, characterized in that: The temperature sensor module circuit includes: a resistor R10, a first end of the resistor R10 is respectively connected to the PB6 end of the STM32 single-chip microcomputer and the DQ end of the temperature sensor, and a second end of the resistor R10 is connected to the VCC end of the single-chip microcomputer power supply circuit.

7. The STM32-based intelligent fan system according to claim 1, characterized in that: The display circuit includes: capacitor C23, capacitor C24, capacitor C25, capacitor C26, capacitor C27, capacitor C28, resistor R16, resistor R17, resistor R18, resistor R19, R20, wherein two ends of the capacitor C23 are respectively connected to the C2P end and C2N end of the display screen module, two ends of the capacitor C24 are respectively connected to the C1P end and C1N end of the display screen module, one end of the capacitor C25 is connected to the VBAT end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C25 is grounded, one end of the capacitor C26 is connected to the VDD end of the display screen module and the VCC end of the single-chip power supply circuit, the other end of the capacitor C26 is grounded, one end of the resistor R16 is connected to the BS1 end of the display screen module The resistor R16 is connected to the D / C terminal of the display screen module, and the other end of the resistor R17 is grounded. One end of the resistor R18 is connected to the D0 terminal of the display screen module, and the other end of the resistor R18 is connected to the VCC terminal of the single-chip power supply circuit. One end of the resistor R19 is connected to the D1 and D2 terminals of the display screen module, and the other end of the resistor R19 is connected to the VCC terminal of the single-chip power supply circuit. One end of the resistor R20 is connected to the IREF terminal of the display screen module, and the other end of the resistor R20 is grounded. One end of the capacitor C27 is connected to the VCOMH terminal of the display screen module, and the other end of the capacitor C27 is grounded. One end of the capacitor C28 is connected to the VCC terminal of the display screen module, and the other end of the capacitor C28 is grounded.

8. The STM32-based intelligent fan system according to claim 1, characterized in that: The voice recognition module is internally provided with an LD3320 chip and an STC11L08XE single-chip microcomputer, and the voice recognition module is integrated with a microphone port and a sound output interface; The temperature sensor module is provided with a DS18B20 programmable digital temperature sensor; The display screen module is provided with a 4-pin OLED screen, and the OLED screen includes GND, VCC, SCL and SDA terminals, wherein the GND terminal of the OLED screen is grounded, the VCC terminal of the OLED screen is connected to the VCC terminal of the microcontroller power supply circuit, the SCL terminal of the OLED screen is connected to the PA0 terminal of the STM32 microcontroller, and the SDA terminal of the OLED screen is connected to the PA1 terminal of the STM32 microcontroller; The infrared sensor module is provided with an infrared tube sensor; The DC fan is a 5V powered DC fan; The lighting module is provided with a 5V powered LED lamp; The key module is provided with a light touch switch; The power control module supplies power to the minimum system board of the STM32 single-chip microcomputer through a 5V micro USB port.