蓝猫淘气

[Training Camp_Advanced Class] Internet of Things Smart Fan (Renovation)

 
Overview

Design reasons

The electric fan at home is decades old and has never been laid off. Since there were no chips at that time, the fan's timing used a gear structure. The timing sound at night was very annoying, and there was also a speed adjustment. It also has a mechanical rotating structure. If you have to get down from the bed and turn the knob to control it, (lazy~), so I plan to add some intelligent elements to it, such as software timing, mobile phone remote speed adjustment, etc.

design requirements

  1. Has mobile phone remote control function
  2. Four-speed speed adjustment (off, low, medium, high)
  3. Timing function (saving costs, connecting to the server via mobile phone for timing)
  4. Can be controlled through Xiaoai classmates
  5. The original fan structure is retained and can be used normally even when not connected to the Internet (important)

Solution implementation & device selection


  • Using ESP8266-12F as the main control chip, mobile phone network remote control can be realized. In addition, 8266 can be programmed and controlled using Arduino IDE, which makes development very simple and fast. In addition, since this solution uses digital interfaces and does not require analog interfaces, the 12F IO port is sufficient and cost-effective. IIC interfaces can also be reserved. Connect to multiple sensors or OLEDs.
  • Using "Blinker" can quickly realize Xiaoai control and timing functions, shortening the development time cycle. The interface UI is highly personalized and can be built according to your favorite style. It supports Arduino IDE development.
  • A four-way relay is used to switch gears. In fact, only three channels are used. The fourth channel was originally planned to have a fan shaking head, but the fan head needs to be removed and is not used for the time being. The design has been reserved. Choose AC250V 3A as the relay. The power of ordinary household appliances can be tolerated. Since the fan is not an electrical appliance that often needs to be switched on and off, you can choose a cheaper one.
  • Use the AC220V to DC5V module to power the ESP8266 and the relay. No external battery is needed, and the fan power can be used directly. This part involves strong current voltage reduction, and many protections need to be considered, such as short-circuit protection and over-current protection. Due to limited capabilities, the module is used , to prevent design errors from damaging components and fans (important).
  • An IIC interface is reserved to expand temperature and humidity sensors or OLEDs. Add more intelligent elements! ! !
  • A master switch of the controller is reserved. If your family does not know how to use it, you can turn off the controller switch to save power and use it as an ordinary manual speed fan.

Debugging process

After disassembling the fan, I found that the principle of the electric fan is: Fan schematic diagram.jpg consider if the speed adjustment gear is screwed to the high speed when the mobile phone remote control is at low speed, that is, Fan schematic modification.jpg will there be an accident or danger? Because the internal motor speed adjustment principle is not very clear. I understand. After consulting the teacher, I learned that the internal speed regulation structure of the motor is as follows Reactor method.jpg

Tap method.jpg

  • Therefore, when the relay is connected to low speed, if it is turned to high speed by hand, it will run at high speed and no danger will occur. (Then do it with confidence~)

After searching for information, I found that the shaking head function is not an electrical structure, but a mechanical structure, so the fourth relay is planned to be changed to a night light function. Internal structure of fan shaking head.jpg

  • During welding, I found that the 3D preview model of the terminal block was opposite to the actual model. There was no big impact, but the silk screen printing was uneven. . . Then the components are slightly misaligned and a little squeezed.

Model comparison.jpg

  • When connecting the data cable, I found that the MIC-USB I chose this time was not very strong after welding. I should choose another USB socket with a large horn socket.

Finished product display

Finished product photo.jpg

Finished product 2.jpgFinished product.jpg

Design experience

I learned a lot about wiring layout through this training camp. Before, I just thought that DRC would be fine (haha). Place it randomly and route the wires at will. If you can’t get through, just make a via hole. If you can’t get through, just go around in a big circle. Later, I learned from Song Gong, Zhou Gong and other classmates in the group that USB should use differential signal lines. It is not necessary to lay copper on one side of the relay. It is best to dig a slot between the neutral line and the live line. If the welding space allows, weld the power supply device first, and then do a test. If everything is normal, weld the control chip and other devices. (Before, it was all welded together, and as soon as it was connected to electricity... it often overturned). I feel that this training camp is a transformation for me. From playing with building blocks by connecting various modules with bread lines, I now arrange all the required devices on a board reasonably and delete the unused ones on the previous modules. device, which not only saves space but also improves stability. One step closer to being a real design engineer.

V1.1 version

It is expected to start working on and optimizing the design after returning to school after August 20th.

  1. Improve the packaging of MIC-USB and use a stronger one
  2. Adjust the position of the terminal block so that it can be placed normally
  3. Adjust the main switch so that it can control the power supply from the USB and the power supply from the buck module
  4. Add a freewheeling diode to the relay and a capacitor to the relay power supply location.
  5. Optimize the layout and reduce the size as much as possible
  6. Optimize routing

V1.2 version

Updated on August 25th. It was found that the pin is at a high level at the moment of power-on. Because the relay is also triggered by a high level, it will flash. To ensure safety, an inverter is added to each relay. Correspondingly, it is also necessary to change the program and adjust it to output a low level to meet the conditions. By searching for information, we learned that the instantaneous voltage level of the ESP-12F pin when it is powered on is as follows:

GPIO-X PIN-X initial state initial level
GPIO0 Pin15 input pull-up H
GPIO2 Pin14 input pull-up H
GPIO4 Pin16 input dropdown L
GPIO5 Pin24 input dropdown L
GPIO12 Pin10 input pull-up H
GPIO13 Pin12 input pull-up H
GPIO14 Pin9 input pull-up H
GPIO15 Pin13 input pull-up H
GPIO16 Pin8 Output set high H
参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2024-11-15 02:56:00

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号