Can of Bliss
Member
I've been planning this build for a little while and was hoping to get some feedback before I make the next step. Also, if people show interest in this, (& it works) I hope to post this as a how to DIY thread.
For those who don't know what an Arduino is:
It's a circuit board about half the size of a smart phone with a bunch of connector pins. You can plug it into a computer and program it to analyze what's happening on some pins and put out a signal on other pins.
Once the program is loaded it can be removing from the computer and will run the program when it's connected to DC power (you can use a 9v battery or a power adapter).
The programming is done in the language C (I know enough of that to make a light blink, also I can Google and copy paste).
The output pins put out about 5v DC and not much current, so you can't directly power much off it, you need something like a relay for big power.
That was probably a really bad explanation and if you're interested you should Google it or buy a book.
the hardware, mostly from amazon:
Arduino Uno clone ~$10
Arduino relay board (4 relays, 120 vac 10A each ) ~$10
DHT22 humidity and temperature sensor ~$10
Ultrasonic fogger $14
Soldering iron, wire, heat shrink tubing, other junk ~priceless
The physical setup:
Sensor placed in the canopy in some easily adjustable manner.
Wire running back to control board
Control board hooked to relay board
One relay powers fogger
Other powers fan(s) or dehumidifier
Program:
Sensor readings are put into formula for VPD
If VPD number is too high,
-fogger turns on until VPD reaches lower limit of good
If VPD number is too low
-exhaust box until VPD reaches higher limit of good
Maybe turn on some lights so I can tell what's going on.
Edit: first draft of program on page 3 of this thread, newest version is at the end of this post
What I still need to find /figure out/reconsider:
What VPD is best for canibus and how far out of that is good/okay/fine/could be better/bad
What about at "night"
If I should use the second sensor (maybe average them, maybe to keep track of outside humidity)
The best place to put the sensor
Other stupid things I didn't think about
So any help or suggestions would be great. Feel free to ask questions, hijacked threads can turn into some of the best ones.
Thanks
Edit:
Program newest version as of March 8th:
//VPD Hhumidity Control writen March 3rd, 2017 by Can of Bliss icmag.com, open source, please improve and share
//updated 3/8/'17 with formula from VintageGreen
//This has not been tested!!!!
//For use with a DHT 22
#include <Adafruit_Sensor.h>
#include <DHT_U.h>
#include <DHT.h>
#include "DHT.h" //you'll need the "library" on your computer for this to work
#define DHTPIN 2 // what digital pin we're connected to
#define DHTTYPE DHT22 // DHT 22
float vpd;
float vpdSetHigh = 12.5;
float vpdSetLow = 7.5;
int vpdHighLed = 12; //pin for low humidity light on
int vpdLowLed = 11; //pin for high humidity light on
int dehumidify = 10; //pin for dehumidify relay
int humidify = 9; //pin for humidify relay
int dehumidifyTimeOn = 5000;//set time on for your system in millisecondes
int humidifyTimeOn = 5000;//et time on for your system in millisecondes
int readDelay = 2000; //DHT 22 (AM2302) can only take a reading every 2 sec
// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("DHTxx VPD test");
dht.begin();
pinMode (vpdHighLed, OUTPUT);
pinMode (vpdLowLed, OUTPUT);
pinMode (dehumidify, OUTPUT);
pinMode (humidify, OUTPUT);
}
void loop() {
float h = dht.readHumidity();
int t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");// Check if any reads failed && exit early (to try again).
return;
}
vpd = ((1-h/100)*0.611*exp(17.27*t/(t+237.3))*10*10)/10.0;
if (vpd <= vpdSetLow){
digitalWrite (vpdLowLed, HIGH);
digitalWrite (humidify, HIGH);
delay (humidifyTimeOn);
Serial.print ("too wet");
}
if (vpd >= vpdSetHigh){
digitalWrite (vpdHighLed, HIGH);
digitalWrite (dehumidify, HIGH);
delay (dehumidifyTimeOn);
Serial.print ("too dry");
}
digitalWrite (vpdHighLed, LOW);
digitalWrite (vpdLowLed, LOW);
digitalWrite (dehumidify, LOW);
digitalWrite (humidify, LOW);
delay(readDelay);
}
For those who don't know what an Arduino is:
It's a circuit board about half the size of a smart phone with a bunch of connector pins. You can plug it into a computer and program it to analyze what's happening on some pins and put out a signal on other pins.
Once the program is loaded it can be removing from the computer and will run the program when it's connected to DC power (you can use a 9v battery or a power adapter).
The programming is done in the language C (I know enough of that to make a light blink, also I can Google and copy paste).
The output pins put out about 5v DC and not much current, so you can't directly power much off it, you need something like a relay for big power.
That was probably a really bad explanation and if you're interested you should Google it or buy a book.
the hardware, mostly from amazon:
Arduino Uno clone ~$10
Arduino relay board (4 relays, 120 vac 10A each ) ~$10
DHT22 humidity and temperature sensor ~$10
Ultrasonic fogger $14
Soldering iron, wire, heat shrink tubing, other junk ~priceless
The physical setup:
Sensor placed in the canopy in some easily adjustable manner.
Wire running back to control board
Control board hooked to relay board
One relay powers fogger
Other powers fan(s) or dehumidifier
Program:
Sensor readings are put into formula for VPD
If VPD number is too high,
-fogger turns on until VPD reaches lower limit of good
If VPD number is too low
-exhaust box until VPD reaches higher limit of good
Maybe turn on some lights so I can tell what's going on.
Edit: first draft of program on page 3 of this thread, newest version is at the end of this post
What I still need to find /figure out/reconsider:
What VPD is best for canibus and how far out of that is good/okay/fine/could be better/bad
What about at "night"
If I should use the second sensor (maybe average them, maybe to keep track of outside humidity)
The best place to put the sensor
Other stupid things I didn't think about
So any help or suggestions would be great. Feel free to ask questions, hijacked threads can turn into some of the best ones.
Thanks
Edit:
Program newest version as of March 8th:
//VPD Hhumidity Control writen March 3rd, 2017 by Can of Bliss icmag.com, open source, please improve and share
//updated 3/8/'17 with formula from VintageGreen
//This has not been tested!!!!
//For use with a DHT 22
#include <Adafruit_Sensor.h>
#include <DHT_U.h>
#include <DHT.h>
#include "DHT.h" //you'll need the "library" on your computer for this to work
#define DHTPIN 2 // what digital pin we're connected to
#define DHTTYPE DHT22 // DHT 22
float vpd;
float vpdSetHigh = 12.5;
float vpdSetLow = 7.5;
int vpdHighLed = 12; //pin for low humidity light on
int vpdLowLed = 11; //pin for high humidity light on
int dehumidify = 10; //pin for dehumidify relay
int humidify = 9; //pin for humidify relay
int dehumidifyTimeOn = 5000;//set time on for your system in millisecondes
int humidifyTimeOn = 5000;//et time on for your system in millisecondes
int readDelay = 2000; //DHT 22 (AM2302) can only take a reading every 2 sec
// Connect pin 1 (on the left) of the sensor to +5V
// NOTE: If using a board with 3.3V logic like an Arduino Due connect pin 1
// to 3.3V instead of 5V
// Connect pin 2 of the sensor to whatever your DHTPIN is
// Connect pin 4 (on the right) of the sensor to GROUND
// Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(9600);
Serial.println("DHTxx VPD test");
dht.begin();
pinMode (vpdHighLed, OUTPUT);
pinMode (vpdLowLed, OUTPUT);
pinMode (dehumidify, OUTPUT);
pinMode (humidify, OUTPUT);
}
void loop() {
float h = dht.readHumidity();
int t = dht.readTemperature();
if (isnan(h) || isnan(t)) {
Serial.println("Failed to read from DHT sensor!");// Check if any reads failed && exit early (to try again).
return;
}
vpd = ((1-h/100)*0.611*exp(17.27*t/(t+237.3))*10*10)/10.0;
if (vpd <= vpdSetLow){
digitalWrite (vpdLowLed, HIGH);
digitalWrite (humidify, HIGH);
delay (humidifyTimeOn);
Serial.print ("too wet");
}
if (vpd >= vpdSetHigh){
digitalWrite (vpdHighLed, HIGH);
digitalWrite (dehumidify, HIGH);
delay (dehumidifyTimeOn);
Serial.print ("too dry");
}
digitalWrite (vpdHighLed, LOW);
digitalWrite (vpdLowLed, LOW);
digitalWrite (dehumidify, LOW);
digitalWrite (humidify, LOW);
delay(readDelay);
}
Last edited: