A non-contact intelligent fan control system and control method
Patent Information
- Application Number
- CN202610861042.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-15
- Publication Date
- 2026-09-04
AI Technical Summary
[0002]传统风扇普遍采用机械按键或旋钮实现控制,存在以下不足:接触式操作易沾染灰尘与细菌,在医疗、无尘、潮湿等特殊环境中存在交叉感染风险;手上有水或油污时操作不便;档位式调节无法实现连续调速,控制精度低、体验差;机械按键长期使用易磨损,故障率较高
(1)本发明通过四个漫反射光电传感器组成的阵列,实现挥手启停、控制风扇正反转、单次触发进入/退出定时功能,无需任何物理接触,卫生性好,适用于医疗、无尘、潮湿等特殊环境。
Smart Images

Figure CN122688166A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of fan control technology, specifically to a non-contact intelligent fan control system based on an STM32 microcontroller and employing photoelectric sensing and ultrasonic ranging modules. It can be widely used in industrial production, household use, medical applications, high-speed rail, automobiles, and other fields. Background Technology
[0002] Traditional fans are generally controlled by mechanical buttons or knobs, which have the following drawbacks: contact operation is prone to dust and bacteria, posing a risk of cross-infection in special environments such as medical, cleanroom, and humid environments; it is inconvenient to operate when hands are wet or oily; speed adjustment cannot achieve continuous speed control, resulting in low control precision and poor user experience; mechanical buttons are prone to wear and tear after long-term use, leading to a high failure rate.
[0003] To address the aforementioned issues, several solutions for fan control using non-contact sensors have emerged in the prior art. For example, patent publication number (CN107740780A) discloses an intelligent temperature-controlled fan based on ultrasonic ranging, which includes a temperature sensor module, a button module, a microcontroller minimum system module, a motor drive circuit module, a display module, and an ultrasonic ranging module. The ultrasonic ranging module controls the fan's on / off state based on the distance between the user and the device, and can also control the fan speed based on the distance.
[0004] However, this existing technology still has the following shortcomings. Although the solution uses ultrasonic ranging to achieve contactless power on / off and speed adjustment, it can only control based on a single dimension of distance value. The fan rotation still needs to be switched via a button module, failing to achieve completely contactless forward and reverse control. The timing function also relies on a button module, making it impossible to intuitively set the running time in a contactless manner. Furthermore, while this existing technology uses ultrasonic ranging to control fan speed, its speed adjustment method divides the detected distance into a finite number of intervals corresponding to fixed speeds, which is a segmented speed adjustment and cannot achieve a continuous linear mapping between distance and speed.
[0005] Furthermore, this solution uses a conventional motor drive circuit without specifically designing for PWM frequency, minimum duty cycle, commutation method, etc., which can easily lead to vibration and electromagnetic whine when the fan is running at low speed, and also cause impact noise when switching between forward and reverse directions. The hardware structure also lacks a layered design and physical isolation between strong and weak currents, making it susceptible to electromagnetic interference affecting the stable operation of the control circuit when driving high-power motors. Summary of the Invention
[0006] This invention aims to provide a non-contact intelligent fan control system and its control method, which realizes non-contact hand gesture control, stepless speed regulation, distance mapping speed and time setting, and can display the fan's operating status in real time, improving ease of use, hygiene and intelligence; at the same time, by improving the control method, the fan can operate smoothly with low noise.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: A non-contact intelligent fan control system includes: a main control module 1, a power supply module 2, a diffuse reflection photoelectric sensor 3, an ultrasonic ranging module 4, a DC motor drive module 5, and a display module 6; the main control module 1 is connected to the display module 6, the diffuse reflection photoelectric sensor 3, the ultrasonic ranging module 4, and the DC motor drive module 5 respectively; the output terminal of the DC motor drive module 5 is connected to the fan; and the power supply module 2 supplies power to the above modules.
[0008] Furthermore, the main control module 1 uses an STM32F103 microcontroller; the power supply module 2 includes an AC / DC module and a DC / DC module. The AC / DC module uses a Mean Well IRM-60-12 isolated power supply module to convert AC power to 12V DC power. The DC / DC module includes AMS1117-5.0 and AMS1117-3.3, which convert 12V DC power to 5V DC power and 5V DC power to 3.3V DC power respectively.
[0009] Furthermore, the diffuse reflection photoelectric sensor 3 adopts the E18-D80NK model, which consists of a sensor array composed of 4 diffuse reflection photoelectric sensors; the output signal of the diffuse reflection photoelectric sensor 3 is conditioned to 3.3V by a voltage divider circuit and then input to the main control module 1.
[0010] Furthermore, the diffuse reflection photoelectric sensor array includes a first sensor S1, a second sensor S2, a third sensor S3, and a fourth sensor S4; wherein, triggering the first sensor S1 controls the start and stop of the DC fan 7; sequentially triggering the third sensor S3 and the fourth sensor S4 controls the fan to rotate forward, sequentially triggering the fourth sensor S4 and the third sensor S3 controls the fan to rotate in reverse; and triggering the second sensor S2 controls the entry or exit of the timing function.
[0011] Furthermore, the ultrasonic ranging module 4 adopts the HC-SR04 model, with a ranging range of 2-200cm and a ranging error of ≤1cm; the main control module 4 maps the distance value detected by the ultrasonic ranging module 4 to the fan speed or running time.
[0012] Furthermore, when the fan is in speed regulation mode, the main control module 1 linearly maps the distance value detected by the ultrasonic ranging module 4 within an effective range of 5-30cm to the fan speed. When the detected distance is stable for more than 2 seconds, the fan is controlled to rotate according to the mapped speed to achieve stepless speed regulation. The speed mapping relationship includes: the minimum speed a corresponding to the fan starting or maintaining operation, the rated speed b corresponding to the fan's rated operating point, and the maximum speed c corresponding to the upper limit of the fan's safe operation. Between the minimum speed and the maximum speed, the speed changes linearly with distance. The values of a, b, and c are preset according to the model of the motor used, and a < b < c. When the fan is in timer mode, the main control module 1 maps the distance value L detected by the ultrasonic ranging module 4 within the effective range of 5-30cm to the timer according to a preset segmentation strategy. The segmentation strategy is as follows: 5cm≤L<10cm corresponds to a timer of 0.5 hours, 10cm≤L<15cm corresponds to a timer of 1 hour, 15cm≤L<20cm corresponds to a timer of 2 hours, 20cm≤L<25cm corresponds to a timer of 3 hours, and 25cm≤L≤30cm corresponds to a timer of 4 hours.
[0013] Furthermore, the DC motor drive module 5 uses a DRV8873 chip, with its MODE pin connected to GND, enabling the chip to operate in PH / EN mode; the PH / IN2 pin of the DRV8873 chip is connected to the direction control signal of the main control module 1 to control the fan to rotate forward or backward; the EN / IN1 pin of the DRV8873 chip is connected to the PWM wave output of the main control module 1 to adjust the fan speed; and the OUT1 and OUT2 pins of the DRV8873 chip are connected to the fan.
[0014] Furthermore, the frequency of the PWM wave output by the main control module 1 is 15kHz-20kHz; and when the fan is running at low speed, the duty cycle of the PWM wave is not less than 20%-30%.
[0015] Furthermore, the system also includes a structural shell, which adopts an upper and lower layered structure. The upper layer is a panel, which houses the display module 6, the ultrasonic ranging module 4, and the diffuse reflection photoelectric sensor 3. The lower layer is a circuit layer, which houses the power supply module 2, the DC motor drive module 5, and the main control module 1. The upper and lower layers are connected by positioning holes and support columns. The circuit layer is divided into a high-voltage area and a low-voltage area in terms of device layout and wiring, realizing the separation of high and low voltage.
[0016] The present invention also provides a non-contact intelligent fan control method, comprising the following steps: A: The main control module 1 acquires the trigger signal of the diffuse reflection photoelectric sensor 3 and the distance detection value of the ultrasonic ranging module 4 in real time; B: When a single trigger signal is received from the first sensor S1, the main control module 1 controls the fan to start or stop. C: When the fan is running, if the trigger signal of the fourth sensor S4 is obtained in sequence and then the trigger signal of the third sensor S3 is obtained, the main control module 1 controls the fan to rotate forward; if the trigger signal of the third sensor S3 is obtained in sequence and then the trigger signal of the fourth sensor S4 is obtained, the main control module 1 controls the fan to rotate in reverse. D: When the fan is running in the forward or reverse direction, the main control module 1 reads the distance detection value of the ultrasonic ranging module 4 and linearly maps the distance value to the fan speed within an effective range of 5-30cm. When the same distance value is stable for more than 2 seconds, the main control module 1 outputs a PWM wave with the corresponding duty cycle to the DC motor drive module 5, so that the fan rotates at the mapped speed. E: When a single trigger signal from the second sensor S2 is received, the fan enters the timing mode. The main control chip reads the distance detection value from the ultrasonic ranging module and maps it to a timing time according to a preset segmentation strategy within an effective range of 5-30cm. When the same distance value is stable for more than 2 seconds, the main control module 1 controls the fan to run according to the mapped timing time. When a single trigger signal from the second sensor S2 is received again, the timing mode is exited. F: The main control module 1 controls the display module 6 to display the fan's direction, speed, detection distance, and timing in real time.
[0017] Compared with traditional solutions, the present invention has the following advantages: (1) The present invention uses an array of four diffuse reflection photoelectric sensors to realize the functions of waving to start and stop, controlling the forward and reverse rotation of the fan, and single-trigger entry / exit timing. It does not require any physical contact, has good hygiene, and is suitable for special environments such as medical, dust-free, and humid environments.
[0018] (2) This invention utilizes an ultrasonic ranging module to continuously and linearly map the distance between the hand and the sensor to the fan speed, achieving true stepless speed regulation with high control precision and excellent user experience. Furthermore, by using ultrasonic distance, the timing time is segmented and mapped to 0.5 to 4 hours, making the operation intuitive and requiring no additional buttons.
[0019] (3) The present invention adopts the PH / EN mode of DRV8873, with a PWM frequency of 15-20kHz and a minimum duty cycle of not less than 20%, and adds soft speed reduction processing before commutation, which eliminates fan low-speed vibration, commutation impact and electromagnetic howling, and the operating noise is extremely low.
[0020] (4) The overall structure of the present invention is divided into upper and lower layers, and the strong and weak electrical areas are isolated, which effectively suppresses electromagnetic interference, improves system stability and safety, and facilitates production and maintenance.
[0021] (5) All the components selected in this invention are industrial standard parts. The STM32F103 has a high cost performance and the system response delay is less than 50ms, making it suitable for mass production and teaching applications. Attached Figure Description
[0022] This manual includes the following figures, which illustrate the following: Figure 1 This is a hardware block diagram of the system of the present invention; Figure 2 This is the circuit connection diagram of the system of the present invention; Figure 3 This is a schematic diagram of the system structure of the present invention; Figure 4 This is a flowchart of the method of the present invention; The system comprises: 1. Main control module; 2. Power supply module; 3. Diffuse reflection photoelectric sensor; 4. Ultrasonic ranging module; 5. DC motor drive module; and 6. Display module. Detailed Implementation
[0023] The specific embodiments of the present invention will be further described in detail below with reference to the accompanying drawings, in order to help those skilled in the art to have a more complete, accurate and in-depth understanding of the inventive concept and technical solution of the present invention, and to facilitate its implementation.
[0024] like Figure 1 The diagram shows the hardware connection relationship of a non-contact intelligent fan system according to the present invention, including a main control module 1, a power supply module 2, a diffuse reflection photoelectric sensor 3, an ultrasonic ranging module 4, a DC motor drive module 5, and a display module 6.
[0025] like Figure 2The diagram shows the circuit connection of the system of this invention. The main control module 1 uses an STM32F103C8T6 microcontroller with a working frequency of 72MHz and a core power supply voltage of 3.3V. The power supply module 2 consists of an AC / DC module and a DC / DC module: the AC / DC module uses a Mean Well IRM-60-12 isolated power supply module, with an input AC 100~240V and an output DC 12V / 5A; the DC / DC module uses an AMS1117-5.0 to convert 12V to 5V, and then uses an AMS1117-3.3 to convert 5V to 3.3V, supplying power to the 5V and 3.3V devices respectively. Four E18-D80NK type diffuse reflection photoelectric sensors 3 are used, labeled S1, S2, S3, and S4 respectively. The output signal of each sensor is conditioned from 5V to 3.3V by a voltage divider circuit, and then connected to the GPIO pins PA0, PA1, PA2, and PA3 of the STM32, configured as falling-edge triggered interrupts. The ultrasonic ranging module 4 uses the HC-SR04 model, with a ranging range of 2-200cm and an error ≤1cm. Its Trig pin is connected to PB0, and its Echo pin is connected to PA6, which is the input capture for TIM3 channel 1. The DC motor drive module 5 uses the DRV8873 chip. Its MODE pin is directly connected to GND to make the chip work in PH / EN mode. The VM pin is connected to a 12V DC power supply, and the DVDD pin is connected to 3.3V. The PH / IN2 pin PC13 is used to control the direction of rotation, with a high level corresponding to forward rotation and a low level corresponding to reverse rotation. The EN / IN1 pin is connected to PA8, which is the TIM1 channel 1. The OUT1 and OUT2 pins are connected to the two power lines of the DC fan, respectively. The display module 6 uses a 0.96-inch OLED display screen, which is connected to the SPI2 pin of the STM32 to display the fan's operating status, direction of rotation, speed, detection distance, and timing in real time.
[0026] like Figure 3 The diagram shown is a structural schematic of the invention system. The system adopts a layered structure: the upper panel is equipped with a display module 6, an ultrasonic module 4, and four diffuse reflection photoelectric sensors 3; the lower circuit board is equipped with a power supply module 2, a DC motor drive module 5, and a main control module 1. The lower layer is divided into a high-voltage area and a low-voltage area in terms of device layout and wiring. The high-voltage area and the low-voltage area are isolated by slots to achieve separation of high and low voltage, effectively suppressing electromagnetic interference.
[0027] like Figure 4 The diagram shows the software control flow and method of this embodiment, which specifically includes the following steps.
[0028] Before implementing the method, system initialization is performed first: the system clock is configured to 72MHz, the SysTick timer is initialized, each GPIO mode is configured, TIM1 is initialized for PWM output, TIM3 is initialized for input capture, SPI2 is initialized, and global variables are set: fan operation flag fan_r=0, direction flag fan_d=1, current PWM duty cycle pwm=1125 (corresponding to 25%), timer mode flag timer_m=0, timer remaining seconds timer_r=0, distance stabilization counter distance_s=0, and a circular queue of distance values with a length of 20 is set. Specifically, the fan operation flag 0 indicates stop, and 1 indicates start; the direction flag 0 indicates reverse rotation, and 1 indicates forward rotation; the timer mode flag 0 indicates non-timed operation, and 1 indicates timed operation. After initialization, the main loop is entered.
[0029] A: The main control module 1 receives detection signals from the diffuse reflection photoelectric sensor 3 and the ultrasonic ranging module 4 in real time. Specifically, the main control module 1 captures the trigger signal of the diffuse reflection photoelectric sensor 3 in real time through four external interrupts: PA0 corresponds to S1, PA1 corresponds to S2, PA2 corresponds to S3, and PA3 corresponds to S4. Whenever the sensor output falls, i.e., at the moment of hand blocking, the interrupt service routine is called. After 15ms of debouncing, the valid trigger is confirmed, and the trigger source and timestamp are recorded. At the same time, the main control module 1 actively triggers ultrasonic ranging every 100ms in the main loop, outputting a high-level pulse. The HC-SR04 module emits ultrasonic waves, and the high-level output width of its Echo pin is proportional to the distance. The TIM3 input capture channel of the STM32 measures the high-level width and calculates the distance value. If the distance is within the effective range of 5cm to 30cm, it is stored in the circular queue for subsequent stability judgment; if it exceeds the range, it is discarded. The main control module 1 continuously obtains the waving action information from the photoelectric sensor and the distance information from the ultrasonic wave.
[0030] B: When the first sensor S1 is triggered, the main control module 1 controls the fan to start or stop. In the interrupt service routine of S1, after confirming a valid trigger, it first determines whether it is currently in timer mode. If it is not in timer mode, the fan operation flag fan_r is toggled. If fan_r changes from 0 to 1, the main control module 1 outputs control signals according to the currently saved PWM and fan_d: setting the TIM1 comparator register to PWM, setting PC13 to the level corresponding to fan_d, and the fan starts running. If fan_r changes from 1 to 0, the main control chip sets the TIM1 comparator register to 0, the PWM output is turned off, and the fan stops rotating.
[0031] C: When the fan is running, if the fourth sensor S3 and the third sensor S4 are triggered sequentially, the main control module 1 controls the fan to rotate forward; if the third sensor S4 and the fourth sensor S3 are triggered sequentially, the main control module 1 controls the fan to rotate in reverse. To achieve direction detection, this embodiment sets pairing logic in the interrupt service routines of S3 and S4. Global variables S3_t and S4_t are defined and initialized to 0, and a 50ms software timer is started. When S3 is triggered, S4_t is set to 1 and the 50ms timer is started; if S4 is triggered within 50ms, it is determined that S3 and S4 are triggered sequentially, and the main control module 1 performs forward rotation operation: first, the current PWM duty cycle is linearly reduced to 25%, delayed for 50ms, fan_d is defined as 1, then PC13 is set to high level, and then the duty cycle is gradually increased to the original target value at a rate of 2% every 10ms. Conversely, if S4 triggers first and S3 is detected within 50ms, it is determined that S4 and S3 are triggered sequentially. The main control module 1 performs a reversal operation, linearly reducing the PWM duty cycle to 25%, delaying for 50ms, defining fan_d=0, setting PC13 to low level, and then slowly increasing the duty cycle to the original target value. If no paired trigger occurs within 50ms, the corresponding flag is cleared.
[0032] D: When the fan is running in forward or reverse rotation and not in timer mode, the main control module 1 reads the distance value detected by the ultrasonic ranging module 4 and linearly maps this distance value to the fan speed to achieve stepless speed regulation. To accommodate the electrical characteristics and mechanical performance of different DC motor models, this embodiment pre-sets three key speed reference parameters: minimum speed a, rated speed b, and maximum speed c. The minimum speed a is the lowest stable speed value at which the fan can run continuously for a long time without stalling, shaking, or overheating; it is higher than the motor's starting speed. The rated speed b is the speed point at which the motor achieves the highest long-term operating efficiency under rated voltage and rated load, and it is also the optimal operating point for balancing the fan's aerodynamic performance and noise. The maximum speed c is the upper limit of the safe speed allowed by the motor and fan impeller structure; exceeding this value may lead to excessive bearing wear, blade deformation, or motor burnout. Since different motor models differ in electrical characteristics, mechanical strength, and heat dissipation capacity, the three speed values a, b, and c need to be calibrated separately according to the actual motor model used and pre-stored in the controller's non-volatile memory. For example, for a low-power small brushless DC fan motor, speeds a can be set to 400 rpm, b to 1800 rpm, and c to 3000 rpm; while for an industrial-grade high-voltage fan motor, speeds a can be set to 800 rpm, b to 3500 rpm, and c to 6000 rpm. When the fan is equipped with different motors, only the corresponding parameter sets need to be loaded; the control algorithm itself does not require any modification. In this embodiment, the distance value L detected by ultrasonic waves is linearly mapped to the speed range [a, c]. Specifically, the highest speed a is set at a distance of 5cm, and the lowest speed c is set at a distance of 30cm. The target speed is calculated linearly for intermediate distances, ensuring that the fan rotates faster the further the hand is from the sensor and slower the hand is closer. Specifically, the speeds a, b, and c are first converted into the corresponding PWM duty cycle lower limit D. min Corresponding minimum speed a, rated duty cycle D rated Duty cycle upper limit D max The corresponding maximum speed c. This embodiment directly adopts a linear mapping from 5cm to 30cm, i.e., the target PWM duty cycle D = D min + (D max - D min ) × (L - 5) / (30 - 5), where L is the stable distance value in cm. Thus, when L = 5cm, D = D min When L=30cm, D=D max(100%). In the main loop, main control module 1 performs distance measurement every 100ms, storing the effective distance value in a circular queue. When the queue is full (20 data points), the average value is calculated and compared with the previous effective distance average. If the absolute difference is ≤1cm, the distance stability counter `distance_s` is incremented by 1; otherwise, it is reset to zero. When `distance_s` reaches 20 and the system is in non-timed mode, speed regulation mapping is triggered. The target PWM duty cycle is calculated, the PWM variable is updated, and immediately written to the comparison register of TIM1, thus continuously and steplessly changing the fan speed. If the same distance value fails to stabilize for 2 seconds during speed regulation, the speed will not be updated to avoid frequent speed jumps caused by hand gestures.
[0033] E: When the second sensor S2 is triggered, the fan enters timer mode. The main control module 1 reads the distance value detected by the ultrasonic ranging module 4 and maps it to a timer according to a preset segmentation strategy. When the distance value stabilizes for more than 2 seconds, the fan is controlled to run according to the mapped timer. When the second sensor S2 is triggered again, the timer mode is exited. In the interrupt service routine of S2, after confirming a valid trigger, the main control module 1 flips the timer mode flag timer_m. If timer_m changes from 0 to 1, the system enters timer mode, the timer icon on the display module 6 starts flashing, and the system waits for the distance to stabilize in order to set the timer. The main control module 1 continues to perform ultrasonic ranging and stability judgment every 100ms. Once the distance remains stable for more than 2 consecutive seconds and timer_m=1, the timing period is mapped according to the following segmented strategy based on the distance L: 5cm≤L<10cm corresponds to 0.5 hours, 10cm≤L<15cm corresponds to 1 hour, 15cm≤L<20cm corresponds to 2 hours, 20cm≤L<25cm corresponds to 3 hours, and 25cm≤L≤30cm corresponds to 4 hours. The main control module 1 sets the remaining seconds of the timing period (timer_r) to the corresponding value and starts the system timer. In this mode, the fan maintains its current speed when entering the timing mode and no longer adjusts its speed in response to distance changes, but distance detection still allows the user to reset the timing period. When timer_r decreases to 0, the main control module 1 automatically stops the fan and clears the timer_m flag. If the user blocks S2 again for a short period during the timing process, the main control chip sets timer_m to 0, clears timer_r, the fan exits the timing mode, reverts to normal stepless speed regulation mode, and continues to run at the current speed.
[0034] F: The main control module 1 controls the display module 6 to display the fan's direction, speed, detection distance, and timing in real time. In the main loop, the display is refreshed every 200ms. The main control module 1 formats the current fan operating status ("Running" or "Stopped") based on `fan_r`, the direction ("Forward" or "Reverse") based on `fan_d`, the speed (converted to duty cycle percentage based on the current PWM_), the effective ultrasonic detection distance, and the remaining time in timing mode into a string, and sends this information to the OLED display via the SPI interface. Users can observe this information at any time and interact with the system.
[0035] Users can start, stop, rotate forward and backward, adjust speed, and enable / disable the timer function of the fan simply by covering or sliding four diffuse reflection photoelectric sensors, without touching any buttons or knobs. This design completely avoids the problem of cross-contamination of dust and bacteria caused by contact operation, making it especially suitable for special occasions such as medical facilities, cleanrooms, and humid environments. Furthermore, it can be operated normally even with wet or oily hands, significantly improving ease of use.
[0036] This embodiment utilizes an ultrasonic ranging module to detect the distance between the hand and the sensor. The main control module linearly maps this distance value to a PWM duty cycle and only updates the speed when the distance remains stable for more than 2 seconds. This prevents false triggering and achieves true continuous stepless speed regulation. Users can obtain any desired speed simply by changing the position of their hand, avoiding the abrupt changes of traditional gear-based adjustments. The control accuracy can reach centimeter-level speed changes.
[0037] The system enters timer mode by briefly blocking the S2 sensor, and then uses ultrasonic distance segmentation to map time intervals ranging from 0.5 to 4 hours, requiring a stable distance of at least 2 seconds to activate. During the timer, the fan maintains its original speed and automatically stops after the countdown ends. Users do not need additional timers or buttons; they can set the timer with just one hand, and can exit the timer at any time by briefly blocking the S2 sensor again. The interaction logic is simple and clear.
[0038] The embodiment also specifically optimized the fan for low-noise and stable operation. The PWM frequency was set to 16kHz, which is outside the 2kHz-5kHz range most sensitive to the human ear. Due to the inductive characteristics of the motor windings, current fluctuations are smoothed, and electromagnetic noise is significantly reduced. Comparative tests showed that the noise sound pressure level at 16kHz was 32dB(A), while it reached 45dB(A) at 1kHz. Second, the minimum PWM duty cycle was set to 25% to ensure continuous current in the motor windings at the lowest speed. Actual tests showed that when the duty cycle was below 20%, the fan blades exhibited periodic vibration, the current waveform was discontinuous, and audible noise was generated; while when the duty cycle was not lower than 25%, the fan rotated smoothly without visible vibration. During forward and reverse switching, a control strategy was adopted to first reduce the duty cycle to 25%, delay for 50ms, switch directions, and then slowly increase the duty cycle, avoiding instantaneous current surges and mechanical impact noise. These measures together ensured that the fan could operate smoothly with low noise under various operating conditions, including low-speed operation and commutation.
[0039] The system adopts a layered structure. The upper panel houses the sensors and display screen, while the lower circuit board centrally houses the power module, drive module, and main control chip. Furthermore, the lower layer physically isolates the high-voltage and low-voltage areas in its layout and wiring. This design effectively suppresses electromagnetic interference from the high-voltage circuit to the low-voltage signal, ensuring that the main control chip can stably acquire sensor signals when driving a high-current motor, significantly improving the system's operational reliability.
[0040] The STM32F103 microcontroller, E18-D80NK photoelectric sensor, HC-SR04 ultrasonic module, and DRV8873 driver chip selected in this embodiment are all industrial standard parts, which are inexpensive and have a stable supply. The entire system has a response latency of less than 50ms, and operations such as waving, distance measurement, and speed adjustment take effect almost instantly. The layered structure facilitates assembly and maintenance, and the separate routing of strong and weak current circuits reduces the difficulty of PCB design, making it suitable for mass production and educational demonstration applications.
[0041] The present invention has been described above by way of example with reference to the accompanying drawings. Obviously, the specific implementation of the present invention is not limited to the above-described manner. Any non-substantial improvements made using the inventive concept and technical solution; or the direct application of the inventive concept and technical solution to other situations without modification, are all within the protection scope of the present invention.
Claims
1. A non-contact intelligent fan control system, characterized in that, include: The main control module (1), power supply module (2), diffuse reflection photoelectric sensor (3), ultrasonic ranging module (4), DC motor drive module (5), and display module (6) are respectively connected to the display module (6), diffuse reflection photoelectric sensor (3), ultrasonic ranging module (4), and DC motor drive module (5). The output end of the DC motor drive module (5) is connected to a fan. The power supply module (2) supplies power to the above modules.
2. The non-contact intelligent fan control system according to claim 1, characterized in that, The main control module (1) adopts an STM32F103 microcontroller; the power supply module (2) includes an AC / DC module and a DC / DC module. The AC / DC module adopts a Mean Well IRM-60-12 isolated power supply module to convert AC power to 12V DC power. The DC / DC module includes AMS1117-5.0 and AMS1117-3.3 to convert 12V DC power to 5V DC power and 5V DC power to 3.3V DC power, respectively.
3. The non-contact intelligent fan control system according to claim 1, characterized in that, The diffuse reflection photoelectric sensor (3) adopts the E18-D80NK model and is composed of a sensor array of 4 diffuse reflection photoelectric sensors. The output signal of the diffuse reflection photoelectric sensor (3) is conditioned to 3.3V by a voltage divider circuit and then input to the main control module (1).
4. The non-contact intelligent fan control system according to claim 3, characterized in that... The diffuse reflection photoelectric sensor array includes a first sensor (S1), a second sensor (S2), a third sensor (S3), and a fourth sensor (S4); wherein, triggering the first sensor (S1) is used to control the start and stop of the fan; triggering the third sensor (S3) and the fourth sensor (S4) in sequence is used to control the fan to rotate forward, and triggering the fourth sensor (S4) and the third sensor (S3) in sequence is used to control the fan to rotate in reverse; triggering the second sensor (S2) controls the entry or exit of the timing function.
5. The non-contact intelligent fan control system according to claim 1, characterized in that, The ultrasonic ranging module (4) adopts the HC-SR04 model, with a ranging range of 2-200cm and a ranging error of ≤1cm; the main control module (1) maps the distance value detected by the ultrasonic ranging module (4) to the fan speed or running time.
6. The non-contact intelligent fan control system according to claim 5, characterized in that, When the fan is in speed regulation mode, the main control module (1) linearly maps the distance value detected by the ultrasonic ranging module (4) within the effective range of 5-30cm to the fan speed. When the detected distance is stable for more than 2 seconds, the fan is controlled to rotate according to the mapped speed to achieve stepless speed regulation. The speed mapping relationship includes: the minimum speed a corresponding to the fan starting or maintaining operation, the rated speed b corresponding to the rated working point of the fan, and the maximum speed c corresponding to the upper limit of the safe operation of the fan. Between the minimum speed and the maximum speed, the speed changes linearly with the distance. The values of a, b, and c are preset according to the model of the motor used, and a < b < c. When the fan is in timed mode, the main control module (1) maps the distance value L detected by the ultrasonic ranging module (4) within the effective range of 5-30cm to the timed time according to the preset segmentation strategy. The segmentation strategy is as follows: 5cm≤L<10cm corresponds to 0.5 hours of timed time, 10cm≤L<15cm corresponds to 1 hour of timed time, 15cm≤L<20cm corresponds to 2 hours of timed time, 20cm≤L<25cm corresponds to 3 hours of timed time, and 25cm≤L≤30cm corresponds to 4 hours of timed time.
7. The non-contact intelligent fan control system according to claim 1, characterized in that, The DC motor drive module (5) uses a DRV8873 chip, with its MODE pin connected to GND, so that the chip works in PH / EN mode; the PH / IN2 pin of the DRV8873 chip is connected to the direction control signal of the main control module (1) to control the fan to rotate forward or backward; the EN / IN1 pin of the DRV8873 chip is connected to the PWM wave output of the main control module (1) to adjust the fan speed; the OUT1 and OUT2 pins of the DRV8873 chip are connected to the DC fan.
8. The non-contact intelligent fan control system according to claim 7, characterized in that, The frequency of the PWM wave output by the main control module (1) is 15kHz-20kHz; and when the fan is running at low speed, the duty cycle of the PWM wave is not less than 20%-30%.
9. The non-contact intelligent fan control system according to claim 1, characterized in that, The system also includes a structural housing, which adopts an upper and lower layered structure. The upper layer is a panel, which houses the display module (6), the ultrasonic ranging module (4), and the diffuse reflection photoelectric sensor (3). The lower layer is a circuit layer, which houses the power supply module (2), the DC motor drive module (5), and the main control module (1). The upper and lower layers are connected by positioning holes and support columns. The circuit layer is divided into a high-voltage area and a low-voltage area in terms of device layout and wiring, so as to achieve separation of high and low voltage.
10. The control method of a non-contact intelligent fan control system according to any one of claims 1-9, characterized in that, Includes the following steps: A: The main control module (1) acquires the trigger signal of the diffuse reflection photoelectric sensor (3) and the distance detection value of the ultrasonic ranging module (4) in real time; B: When a single trigger signal is received from the first sensor (S1), the main control module (1) controls the fan to start or stop; C: When the fan is running, if the trigger signal of the third sensor (S3) is obtained in sequence and then the trigger signal of the fourth sensor (S4) is obtained, the main control module (1) controls the fan to rotate forward; if the trigger signal of the fourth sensor (S4) is obtained in sequence and then the trigger signal of the third sensor (S3) is obtained, the main control module (1) controls the fan to rotate in reverse. D: When the fan is running in the forward or reverse direction, the main control module (1) reads the distance detection value of the ultrasonic ranging module (4) and linearly maps the distance value with the fan speed within the effective range of 5-30cm. When the same distance value is stable for more than 2 seconds, the main control module (1) outputs a PWM wave with the corresponding duty cycle to the DC motor drive module (5) so that the fan rotates at the mapped speed. E: When a single trigger signal from the second sensor (S2) is obtained, the fan enters the timing mode. The main control chip reads the distance detection value from the ultrasonic ranging module and maps it to the timing time according to the preset segmentation strategy within the effective range of 5-30cm. When the same distance value is stable for more than 2 seconds, the main control module (1) controls the fan to run according to the mapped timing time. When a single trigger signal from the second sensor (S2) is obtained again, the timing mode is exited. F: Main control module (1) controls display module (6) to display the fan's rotation direction, speed, detection distance and timing in real time.
Citation Information
Patent Citations
Intelligent temperature-control fan based on ultrasonic distance measurement
CN107740780A