Building a smart fan controller with Raspberry Pi
Fan Control with a Variable Frequency Drive (VFD)
With the sensors and communication protocol sorted, the next step is deciding what we'll use to control the fan. As mentioned earlier, we need a system that can manage both fan direction (forward and reverse) and speed.
Using a commercial Variable Frequency Drive (VFD) seems like the best option—there's no need to reinvent the wheel by building a motor speed controller from scratch if we can buy one affordably.
Now, we need to determine how to interface with the VFD to control speed and direction, this is show in the diagram below as unsolved question marks.
After looking into various commercial VFDs with reverse capabilities, I found that most low-cost models use a 0-10V voltage signal for speed control. Some also support 0-20mA or 4-20mA current-based control, which is generally more robust and resistant to electrical noise. However, the current-based option creates a need for a constant current draw, which can be inconvenient and slightly more complex to implement.
The 0-10V approach, by contrast, is simple to set up. For example, you could create a 0-10V control signal using a potentiometer and a battery as a voltage divider, whereas generating a 0-20mA signal would require a voltage-to-current converter circuit. So, for simplicity, I'm opting for a 0-10V setup.
With this decision, we know we'll need a 0-10V output signal to control the VFD's speed. Next, we also need to manage the fan's forward/reverse direction. For most VFDs, switching directions is as easy as closing a circuit or applying voltage to a specific pin—something we can handle by adding a relay to our interface.
Additionally, to fully turn the fan on or off (beyond just adjusting speed), we can use another relay to control the VFD's power input. This relay approach aligns with the same interface we'll use for controlling fan direction.
Since most VFDs work with a standard 230V mains supply, the main power relay should be capable of handling this voltage.
Based on these decisions, our updated diagram below shows the resolved interface, including connections for power, direction, and speed control.