PWM Fan control with ESP32

I’ve received my level shifter today and it works as expected. Well, not at first because there is a pin on my ESP32 board labeled GND but should be labeled CMD … changed ground pin and it works !
Only issue is that levels are backwards : if I set “high” on HA the fan stops and if I set “off” the fan is at full power. Pretty sure that’s not hard to change.

Sharing the diagram in case someone wants to reproduce :

Thanks for the help.

11 Likes