An expansion board that turns your idle fan into a smart fan that can be connected to HASS and HomeKit.
This project is drawn using KiCAD. It is recommended to download the attachment and modify it later.
Use an IO of esp8266 to output soft pwm, use ir2104 to receive this pwm and drive the mos tube to supply power and speed adjustment to the fan.
The materials used are somewhat luxurious. . You can use a transistor to drive a mos tube. The actual current of the mos tube is not large (12V power supply, no load, 0.037A, full speed, 0.210A). You can choose a mos tube with a lower rated current.
The following is a simple access tutorial (for details, please refer to the official documentation of ESPHome and HomeAssistant)
First install ESPHome. It is recommended to use Linux+docker. Drag an image. For docker, remember to map the USB serial port into it.
Enter the ESPHome backend, IP: 6052
➕Create a new device in the lower left corner. It is recommended to select NodeMcu for Device Type.
Then EDIT and add the code at the bottom
output:
- platform: esp8266_pwm
pin: 2
frequency: 30000 Hz
id: pwm_output
fan:
- platform: speed
output: pwm_output
name: "Fan"
speed:
low: 0.5
medium: 0.7
high: 0.9
Explain the following code briefly. The pwm frequency is 30k because sound will be heard at 20k and below. The low gear selects 50% duty cycle to prevent the duty cycle from being too low and the fan cannot spin. The high gear selects 90% duty cycle because 100 % can’t be transferred either (probably a problem with the mos driver)
Then select your usb device in the upper left corner, plug in ttl and power supply to esp8266, hold down FLASH and then press RST, 8266 should enter the download state, then let go, select UPLOAD in ESPHome, if everything goes well, it should be downloaded, and will be updated later The code can also be passed OTA without using the serial port.
Then connect to HomeAssistant
After connecting to Wi-Fi, a message should be added to the notification, prompting you whether to access this device. Just select access. You can view it in Configuration-Integration.
Then connect to HomeKit, click the HomeKit bridge option in the integration, and select fan in the domain to be included.
All reference designs on this site are sourced from major semiconductor manufacturers or collected online for learning and research. The copyright belongs to the semiconductor manufacturer or the original author. If you believe that the reference design of this site infringes upon your relevant rights and interests, please send us a rights notice. As a neutral platform service provider, we will take measures to delete the relevant content in accordance with relevant laws after receiving the relevant notice from the rights holder. Please send relevant notifications to email: bbs_service@eeworld.com.cn.
It is your responsibility to test the circuit yourself and determine its suitability for you. EEWorld will not be liable for direct, indirect, special, incidental, consequential or punitive damages arising from any cause or anything connected to any reference design used.
Supported by EEWorld Datasheet