Resource icon

Build a Fan Controller for Your Cannabis Grow Room

Cannabis cultivation requires a controlled environment to ensure optimal growth and yield. One crucial aspect of this environment is proper air circulation. In this article, we will discuss how to build a fan controller for under $30 for your cannabis grow room. By following these simple steps, you'll be able to maintain the ideal temperature and humidity levels, leading to a healthier and more productive cannabis crop.

Introduction to Fan Controllers​

Fan controllers are devices used to regulate the speed of fans in response to varying environmental conditions. In a cannabis grow room, fan controllers help maintain the optimal temperature and humidity levels by adjusting the fan speeds according to the room's needs. This ensures that your cannabis plants receive the proper airflow and prevents the formation of mold and mildew.


Components Required​

To build a fan controller for under $30, you will need the following components:

  1. Arduino Nano board
  2. DHT22 temperature and humidity sensor
  3. Relay module (single or multiple channels)
  4. 12V DC fan (or multiple fans)
  5. Breadboard
  6. Jumper wires
  7. 12V power supply
  8. USB cable (for programming the Arduino Nano)
These components are readily available online or at your local electronics store.


Assembling the Fan Controller​

Follow these steps to assemble your fan controller:

  1. Connect the DHT22 sensor to the Arduino Nano board using jumper wires. Connect the VCC pin of the sensor to 5V on the Arduino, the GND pin to GND, and the data pin to a digital input pin (e.g., D2).
  2. Connect the relay module to the Arduino Nano board. Connect the VCC pin of the relay to 5V on the Arduino, the GND pin to GND, and the IN pin to a digital output pin (e.g., D3).
  3. Connect the 12V DC fan(s) to the relay module. Connect the positive wire of the fan to the relay's NO (normally open) terminal and the negative wire to the GND terminal of the power supply.
  4. Connect the 12V power supply to the relay module's COM (common) terminal.

Programming the Fan Controller​

  1. Install the Arduino IDE on your computer, if you haven't already.
  2. Download and install the DHT library for Arduino.
  3. Connect the Arduino Nano to your computer using the USB cable.
  4. Open the Arduino IDE and create a new sketch.
  5. Write a program to read the temperature and humidity values from the DHT22 sensor and control the fan speed based on these values.
  6. Upload the program to the Arduino Nano board.
I assume you're using an Arduino for this project. Here's a simple code to read temperature and humidity values from the DHT22 sensor and control the fan speed based on these values. Make sure you have the DHT sensor library installed in your Arduino IDE.

C:
#include <DHT.h>

// Constants
#define DHTPIN 2     // DHT22 data pin connected to Arduino digital pin 2
#define DHTTYPE DHT22 // DHT22 sensor
#define FANPIN 3      // Fan PWM pin connected to Arduino digital pin 3

// Variables
int fanSpeed; // Fan speed (0-255)

// Objects
DHT dht(DHTPIN, DHTTYPE);

void setup() {
  Serial.begin(9600);
  dht.begin();
  pinMode(FANPIN, OUTPUT);
}

void loop() {
  float humidity = dht.readHumidity();
  float temperature = dht.readTemperature(); // Read temperature in Celsius

  if (isnan(humidity) || isnan(temperature)) {
    Serial.println("Failed to read from DHT22 sensor!");
    return;
  }

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.print(" *C, Humidity: ");
  Serial.print(humidity);
  Serial.println(" %");

  // Adjust the fan speed based on temperature
  if (temperature < 25) {
    fanSpeed = 0; // Turn off the fan
  } else if (temperature >= 25 && temperature < 30) {
    fanSpeed = map(temperature, 25, 30, 100, 200); // Map temperature to fan speed (100-200)
  } else {
    fanSpeed = 255; // Maximum fan speed
  }

  // Set the fan speed
  analogWrite(FANPIN, fanSpeed);

  Serial.print("Fan speed: ");
  Serial.println(fanSpeed);

  // Wait 2 seconds before next reading
  delay(2000);
}

Installing the Fan Controller in Your Grow Room​

  1. Disconnect the Arduino Nano from your computer.
  2. Connect the 12V power supply to the Arduino Nano's VIN and GND pins.
  3. Install the fan controller in your cannabis grow room by mounting the Arduino Nano, DHT22 sensor, relay module, and fan(s) in a suitable location.
  4. Ensure the DHT22 sensor is placed in an area that accurately represents the grow room's temperature and humidity levels.
  5. Turn on the power supply, and the fan controller will begin regulating the fan speed based on the room's temperature and humidity.

Conclusion​

Building a fan controller for your cannabis grow room is a cost-effective way to maintain the ideal environmental conditions for your plants. By following these steps and investing in a few affordable components, you can easily create a reliable and efficient fan controller for under $30. Proper air circulation is essential for the health and productivity of your cannabis plants, and this DIY fan controller offers an effective solution for maintaining optimal conditions in your grow room.
  • Like
Reactions: mekannic
Author
logic
Views
1,040
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from logic

Top Bottom