Lemontree

smart fan

 
Overview

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.

4HU54BnUa5P2Or3gDkftXGWC6iwqEFg8NVxL1QHu.jpegWmC4OzXfjgqqqszZQaz5Lzjur9PEgMW2CVCyOcIy.jpeg

 

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.

0EVpQOFgTGJzhaAopnsljJ3VM3tsmxXn4PlpEsfD.png

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.

KXDsRUu3VddzNCZ6vtAQvZxAgq9wXO6Vu0Qh0kFm.png

Then connect to HomeKit, click the HomeKit bridge option in the integration, and select fan in the domain to be included.

n71F8aFey6ujn1vy3zoGFo4ysB6SloMy79jbN9xY.png

参考设计图片
×
 
 
Search Datasheet?

Supported by EEWorld Datasheet

Forum More
Update:2025-05-11 12:51:40

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
community

Robot
development
community

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号