title: "An ESPHome-powered Smart PWM Fan Controller"
description: "Control your fan walls with style from HomeAssistant"
date: 2025-05-16
tags:
- DIY
- Home Automation
---
## The Motivations
I have a few fan arrays/walls throughout my house, namely two in my garage, and one I plan to build in my room over my bed to replace a tower fan.
But PC fans can be noisy, and control is ideal. So I decided to build myself a relatively simple ESPHome-based fan controller!
## The Design
I of course wanted to base the design off the ESP32, which is my go-to microcontroller for all ESPHome-related devices these days. One crucial feature of the ESP32 is that it contains 8 pulse counter units, which allow the chip to count pulses - like a fan tachometer - very quickly and without using the CPU. I selected my venerable slim HW-395 model, which I also use for [my](/posts/the-supersensor) (Supersensors](/posts/the-supersensor-2.0), as its compact size but full pin count makes designing around it very easy.
The ESP32 alone can output PWM as well, so I didn't need any sort of fancy controller chip - I just hooked the PWM lines up to each fan and let the ESPHome software do the rest. Lastly a relay controls power to the fans, for simple on/off control in addition to the PWM level control, giving the full range of control needed for a fan array.
I also needed a way to step down the 12VDC input to the 5V that both the ESP32 and relay needed, so for that I selected a basic adjustable DC-DC converter. This did require initial tuning during each board's assembly, but once set it should never need further adjustment. I used an SMD-like method with a hot air gun to ensure a flat profile with good contact for this board, while everything else is through-hole soldered.
I designed the board in EasyEDA and ordered from JLCPCB for a very reasonable price (though shipping costs are not what they used to be). The overall design is quite simple, with power routing capable of at least 3A of current at a minimum.
Lastly, the HomeAssistant view shows everthing we might need, with power and speed controls as well as the RPM tachometer output of each fan (useful to see levels or if a fan fails).

ESPHome code and schematics for the PCB can be found on [the GitHub project page](https://github.com/joshuaboniface/smart-pwm-fan-controller).