当前位置:网站首页>Smart fan system based on STM32F103

Smart fan system based on STM32F103

2022-07-19 04:12:00 Embedded advanced road

  • System design objectives

This system can be divided into two modes to run , They are manual mode and automatic mode , meanwhile , After power on and entering the system , There will also be a mode selection interface .

  1. Mode selection : In this interface , You can press the key K1 To control mode selection , The two modes are manual mode and automatic mode ; By pressing the key K2 Can enter mode
  2. Manual mode : In manual mode , Can pass K1 To adjust the speed , Divided into low speed 、 Medium and high speed , Can pass K3 To control whether it is shaking its head .
  3. Automatic mode : In automatic mode , Infrared sensors can be used to detect whether there are people around , Test the temperature and humidity of the surrounding environment through the temperature and humidity sensor , If the conditions are met, the fan will be triggered to run , The wind speed also has a low-speed mode 、 Medium speed mode 、 High speed mode .
  • Specific hardware selection
  1. Master chip

The main control chip is stm32f103c8t6 Minimum system board , Cheapness , It is very suitable for beginners to develop SCM projects , It can be used with bread board , Very suitable for circuit connection .

 

        2. Display module

The display module mainly uses 0.96 Inch OLED The screen . adopt OLED Module to display mode information 、 Temperature information 、 Sweeping information, etc .

 

        3. Temperature and humidity sensor

The temperature and humidity sensor uses DHT11 Temperature and humidity sensor , It is used to collect temperature data and humidity data in automatic mode , Control the speed of the fan .

 

        4. Infrared module      

The infrared module is mainly used to detect whether there are people around , When someone is detected around , The information can be transmitted to the single chip microcomputer to respond , When the temperature reaches the set value , You can control the fan to start rotating .

 

        5. Motor drive circuit

My motor drive circuit uses a high-power diode to drive the motor , In fact, it can also be used L298N To drive , This depends on the components at hand .

        6. The steering gear

I mainly use the steering gear to complete the sweeping mode of the fan , By controlling the duty cycle of the steering gear, the fan can sweep .

        7. The motor

This time, I use the small motor of hollow Cup .

  • Specific software ideas
  1. Mode selection interface

In the selection mode, you can switch the mode by pressing the key , And enter the mode by pressing the key , It uses K1 Press the key to select the mode , It is divided into automatic mode and manual mode ; adopt K2 Enter the selected mode .

 

        2. Manual mode

In manual mode , Press the key to control the rotation and sweeping mode of the fan and the function of exiting the selection interface . In manual mode , Press down K1 Key to accelerate the fan , It is divided into low-speed mode —> Medium speed mode —> High speed mode —> stop it . adopt K3 To control the sweeping , When you press once K3 after , Will enter the sweeping mode , The fan sweeps , Press again K3, Stop sweeping . Press down K4 after , It will exit the manual mode and enter the mode selection interface .

 

        3. Automatic mode

In automatic mode , The system will automatically detect the surrounding environment and decide whether to enter the sweeping mode and turn the fan .

  1. First, it will detect whether there is someone ahead , If no one , Nothing happened ; If anyone , Get into 2.
  2. If there is someone ahead , It will detect whether there is someone on the left , If there is no one and the ambient temperature is greater than 27 degree , The fan turns but does not sweep ; If anyone , Get into 3.
  3. If someone on the left , It will detect whether there is someone on the right , If there is no one and the ambient temperature is greater than 27 degree , The fan rotates and the left half sweeps ; If anyone , And the ambient temperature is greater than 27 degree , The fan turns and 0 C to 180 Du sweeping .
  4. If the ambient temperature is 27 C to 29 Between degrees , The fan speed is in low speed mode , If the ambient temperature is 29 C to 31 Between degrees , The fan speed is in medium speed mode , If the ambient temperature is 31 Over degrees , The fan speed is in high speed mode .

 

  • Connection of components

notes : If you want to achieve the effect of automatic mode , Stick the motor and infrared module on the propeller of the steering gear , In this way, the desired effect in automatic mode can be better achieved .

 

原网站

版权声明
本文为[Embedded advanced road]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/200/202207170329180148.html