Building a smart fan controller with Raspberry Pi
Cooling a root cellar
After recently renovating our root cellar, we wanted to use it for food and perishables storage. However, the cellar wasn't quite cool enough to store food safely. The solution? Pull in some of the colder outside air to efficiently cool it down.
Of course, we can't just run a fan constantly because sometimes the outside air is warmer than inside, like during the day. Ideally, we'd bring in cooler night air and stop the fan during warmer daytime hours. So, we need a system that can control the fan, turning it on when it's cooler outside and off when it's warmer.
There are a few ways to approach this:
- A basic timer that runs the fan at night.
- Manual control to switch the fan on and off based on outside temperatures.
- A smart setup that automatically checks temperatures and activates the fan only when it's cooler outside.
I'm leaning toward the smart setup—it's not only fun to build, but it also avoids the risk of pulling in hot or damp air that could damage stored goods. Plus, we could add sensors to measure both temperature and humidity, ensuring we're not introducing excess moisture into the cellar, which could cause condensation and rot.
Here's my vision for this smart setup:
- Temperature & Humidity Sensing:
- Measure both inside and outside conditions.
- These sensors should be rugged enough for outdoor exposure.
- Fan Control:
- A relay switch for on/off control
- ideally, variable speed control to avoid excessive cycling.
- The fan should be able to run smoothly at various speeds based on the temperature differential.
- Bi-Directional Airflow:
- Reverse the fan's direction as needed to either expel damp air or bring in cool, dry air.
- Advanced Control with PID Logic:
- Using a PID (Proportional-Integral-Derivative) control, the fan could adjust smoothly to meet target conditions without abrupt cycling.
- Network Connectivity, since it's a smart system, why not connect it to our home network for real-time monitoring? It would allow for:
- Real-time tracking
- Track temperature and humidity trends over time
- Using graphs or data logs to optimize cellar conditions
In summary, the goal is a robust, intelligent system that keeps the cellar cool and dry, efficiently managing airflow based on real-time conditions while avoiding the risks of excess moisture or frequent fan cycling.