Hey everyone this is my 1st post and I'm doing it on my gf's behalf. I'm hoping this post is in the right category...
She's trying to create an automated greenhouse for seedlings, fungi, terrarium plants etc. Total plant gal.
She's using:
Arduino Uno
DF Robot IO Expansion Shield
DF Robot Gravity Analog Infrared CO2 sensor
DF Robot Digital temp & humidity sensor
Digital Loggers IOT Relay II
Her idea is to create a nice enclosed greenhouse that can be self-sufficient. She wants the temp, CO2 and humidity to be regulated and kept at certain levels. When the humidity sensor senses a level too low, the humidifier will kick on and run until the right level is reached. A similar thing will happen when the CO2 sensor senses levels too high - it will kick on a couple small fans. The lighting is all taken care of already by a lamp (UV bulb) on a separate timer. This will be her way of experimenting with growing new plants and keeping her green thumb through the winter.
She's still very new to using Arduino btw.
So far she's been able to alternate her fan and humidifier on/off as just a test by using the sample code given with the Digital Loggers relay. But, she wants to use the info from the sensors to trigger her fans & humidifier on/off, not just have them triggered by a time interval. She's been looking all day for a sample code to use as a base or stepping stone. I've searched too but honestly I'm quite ignorant on the subject. Any help at all would be very much appreciated.
I've attached her sample code and an image of the setup. Note: CO2 sensor is not connected and Arduino is not running temp sensor. Only relay is being run.
Thanks in advance.
int relay = 8; // Tells Arduino the relay is connected to pin 8
void setup()
{
pinMode(relay, OUTPUT); // Initialize the Atmel GPIO pin as an output
}
void loop() // Loops forever
{
digitalWrite(relay, HIGH); // Turn the relay on (HIGH is the voltage level = 1)
delay(300000); // Stay ON for 5 minutes (Fans are ON)
digitalWrite(relay, LOW); // Turn the relay off by making the voltage LOW = 0
delay(3600000); // Stay OFF for 60 minutes (Humidifier is ON)
}