Im trying to integrate this 5v 3wire fan. My guess is its PWM controlled for speed. but cannot get it working.
I’ve tried the output as a ledc, as below. Connected + and - to a constant 5V supply and connected the yellow wire to GPIO19. But the fan just runs very slowly.
Any ideas?
Taken straight from the ESPhome wiki.
output:
- platform: ledc
pin: GPIO19
id: gpio_19
# Example usage in a light
light:
- platform: monochromatic
output: gpio_19
name: "Kitchen Light"
The fan
JulianDH
(Julian Hall)
August 27, 2023, 9:16am
2
Third wire is usually a tachometer which measures RPM
You will need four wire version to control with PWM
I am not an expert with small fans. My next project
Yea I read that too,
Ok sweet i’m not too fussed about it anyway just would have been nice to integrate it if I could.
JulianDH
(Julian Hall)
August 27, 2023, 9:21am
4
You can integrate but you will either need a relay for it to be on OR a module that allows control over 5v supply if you need to adjust RPM
McElias
(Elias)
August 16, 2024, 12:47am
5
Hello,
i want to say that even with 3 wires it should work and you could be able to control fa, speed, this is a part of my esphome config.
captive_portal:
sensor:
- platform: homeassistant
entity_id: sensor.system_monitor_processor_temperature
id: server_temp
accuracy_decimals: 1
on_value_range:
- below: 38.0
then:
- logger.log: "Set fan level 33 over 30C"
- output.set_level:
id: rack_fan_speed
level: 0%
- above: 38.0
below: 40.0
then:
- logger.log: "Set fan level 50 over 40C"
- output.set_level:
id: rack_fan_speed
level: 50%
- above: 50.0
then:
- logger.log: "Set fan level 100 over 50C"
- output.set_level:
id: rack_fan_speed
level: 100%
output:
- platform: esp8266_pwm
id: rack_fan_speed
pin: 4
frequency: "30000 Hz"
min_power: 1%
max_power: 100%
fan:
- platform: speed
output: rack_fan_speed
name: "Override Enable"
id: rack_fan_toggle
on_turn_on:
- output.set_level:
id: rack_fan_speed
level: !lambda |-
return id(fan_speed_override).state/100.0;
on_turn_off:
- logger.log: "Power of Fan turned OFF"
- delay: 1s
- output.set_level:
id: rack_fan_speed
level: !lambda |-
if (id(server_temp).raw_state > 50){
return 1;}
else if (id(server_temp).raw_state > 40){
return 0.66;}
else if (id(server_temp).raw_state > 30){
return 0.33;}
else
return 0;
number:
- platform: template
name: "Fan Speed Override"
id: fan_speed_override
internal: false
max_value: 100.0
min_value: 0.0
step: 33.3
optimistic: true
mode: slider
on_value:
then:
if:
condition:
fan.is_on: rack_fan_toggle
then:
- output.set_level:
id: rack_fan_speed
level: !lambda "return x/100;"
web_server:
port: 100