Starting my first build. Want to make a humidistat for my indoor grow box.

Hey guys!

I have a indoor grow box that i'm constantly monitoring. I first went on google to see if I could buy a humidistat and just connect my devices. But it was either expensive or not practical for my use. I then saw a few videos about Arduino based humidistat so here I am.

What I bought so far:

  • Arduino Mega 2560
  • 4 relay module
  • Kuman 1602 Shield Module LCD Display V3
  • AM2315 - Encased I2C Temperature/Humidity Sensor
  • 9 Volt 2 Amp Power Adapter
  • solderless breadboard

I also bought some jumpers and resistors.

Is there a good tutorial on here or online that would show me how to setup it up? I try using the search feature however I can't seem to find one. Does anyone have some tutorials bookmarked or saved on their PC and is willing to share?

Thanks

What will the relays control? Please include links to any pumps, valves etc.

We can guide you as to how to wire up and code. Please read the "please read" post so you know how to post links, pics & code.

I am currently working on a greenhouse watering controller using a similar temp/humidity sensor, plus soil moisture sensor(s) and a 12V submersible pump to irrigate using rainwater collected from the roof. My setup is web enabled so I can remotely monitor the environment and control the pump when needed (this will be automatic when I am confident it won't flood or allow everything to dry out).

Thanks for the reply!

I want 3 devices hooked up to the relay.

ultrasonic mister ==> https://www.amazon.com/gp/product/B00P91ZFPA

Inline duct fan ==> https://www.amazon.com/gp/product/B008N4QIZG

ceramic heater ==> https://www.amazon.com/dp/B000FTEQCY

I created a sample flow chart.

We will be growing in a 4'X3'X5' box (non cannabis). We have self watering containers and might add a soil moisture sensor. Adding wifi and a decent video camera inside the box for FB live videos. But that's later on.

I'm open to any suggestions and/or improvement. Thanks for your time!

Brian

Your links don't work, I can't click them. As I said before, please read the "please read" post. It explains important stuff like that.

Your "flow chart" needs some more work. It's a good start, but it isn't a flow chart and it isn't a system block diagram. It's a rather confusing mish-mash of the two. It will really help you when you get to the wiring and coding stages if you separate them and get them a bit more complete. Google for examples of each type of diagram. A flow chart is about decisions and actions with no representation of the hardware. You develop your code/sketch from it. A system block diagram shows major components and the data/messages that pass between them without talking about when our how decisions are made. You develop your schematic from that.

Have you attempted any simple prototyping yet? If not, I suggest starting with just the mega and the temp/humidity sensor. Get the appropriate library installed and try running the example sketches that come with the library.

PaulRB:
Your links don't work, I can't click them. As I said before, please read the "please read" post. It explains important stuff like that.

Your "flow chart" needs some more work. It's a good start, but it isn't a flow chart and it isn't a system block diagram. It's a rather confusing mish-mash of the two. It will really help you when you get to the wiring and coding stages if you separate them and get them a bit more complete. Google for examples of each type of diagram. A flow chart is about decisions and actions with no reference to hardware. A system block diagram shows major components and the data/messages that pass between them without talking about when our how decisions are made.

Have you attempted any simple prototyping yet? If not, I suggest starting with just the mega and the temp/humidity sensor. Get the appropriate library installed and try running the example sketches that come with the library.

Thanks for your input.

So I just hooked up my LCD shield to the mega and got my AM2315 sensor to work. I used this sketch:

/* Example sketch for AM2315 humidity - temperature sensor
   Written by cactus.io, and requires the cactus_io_AM2315 library. public domain
   This sketch will work with the Adafruit AM2315 sensor.
   For hookup details using this sensor then visit
   http://cactus.io/hookups/sensors/temperature-humidity/am2315/hookup-arduino-to-am2315-temp-humidity-sensor
*/
#include <LiquidCrystal.h>
#include <Wire.h>
#include "cactus_io_AM2315.h"

AM2315 am2315;
LiquidCrystal lcd(8,9,4,5,6,7);

void setup() {
  lcd.begin(16, 2);
  lcd.print("Reading sensor");
 

  if (!am2315.begin()) {
     Serial.println("Sensor not found, check wiring & pullups!");
     while (1);
  }
}

void loop() {
  
  am2315.readSensor();

  float temperature, humidity;

  humidity = am2315.getHumidity();
  temperature = am2315.getTemperature_F();
  delay(2000); 

 lcd.clear();

 char tempF[6]; 
 char humF[6];
 dtostrf(temperature, 5, 1, tempF);
 dtostrf(humidity, 2, 0, humF);

 lcd.print("T:"); 
 lcd.print(tempF);
 lcd.print((char)223);
 lcd.print("F ");
 lcd.print("H: ");
 lcd.print(humF);
 lcd.print("%");
}

Next I would need to hook up my relay to the devices. I saw some videos about relays but it wasn't clear or thorough enough for me. I know the basic however, I'm not confident enough to tackle this yet. Just need more info/directions.

By the way, I added the missing url tags from the previous post. You're able to click them.

Thanks for the URL tags.

I'm not confident enough to tackle this yet

You are right to be nervous. Wiring mains appliances is a serious safety concern. Post a link to your relays so we can check they are up to the job.

here's the link I bought it from https://www.amazon.com/gp/product/B00KTEN3TM

I tested the relay to see if it works. I used this sketch:

/* YourDuino Example: Relay Control 1.10
  Handles "Relay is active-low" to assure
  no relay activation from reset until
  application is ready.
   terry@yourduino.com */

/*-----( Import needed libraries )-----*/
/*-----( Declare Constants )-----*/
#define RELAY_ON 0
#define RELAY_OFF 1
/*-----( Declare objects )-----*/
/*-----( Declare Variables )-----*/
#define Relay_1  2  // Arduino Digital I/O pin number
#define Relay_2  3
#define Relay_3  4
#define Relay_4  5

void setup()   /****** SETUP: RUNS ONCE ******/
{
//-------( Initialize Pins so relays are inactive at reset)----
  digitalWrite(Relay_1, RELAY_OFF);
  digitalWrite(Relay_2, RELAY_OFF);
  digitalWrite(Relay_3, RELAY_OFF);
  digitalWrite(Relay_4, RELAY_OFF);  
  
//---( THEN set pins as outputs )----  
  pinMode(Relay_1, OUTPUT);   
  pinMode(Relay_2, OUTPUT);  
  pinMode(Relay_3, OUTPUT);  
  pinMode(Relay_4, OUTPUT);    
  delay(4000); //Check that all relays are inactive at Reset

}//--(end setup )---


void loop()   /****** LOOP: RUNS CONSTANTLY ******/
{
//---( Turn all 4 relays ON in sequence)---
  digitalWrite(Relay_1, RELAY_ON);// set the Relay ON
  delay(1000);              // wait for a second
  digitalWrite(Relay_2, RELAY_ON);// set the Relay ON
  delay(1000);              // wait for a second  
  digitalWrite(Relay_3, RELAY_ON);// set the Relay ON
  delay(1000);              // wait for a second
  digitalWrite(Relay_4, RELAY_ON);// set the Relay ON
  delay(4000);              // wait see all relays ON
  
//---( Turn all 4 relays OFF in sequence)---  
  digitalWrite(Relay_1, RELAY_OFF);// set the Relay OFF
  delay(1000);              // wait for a second
  digitalWrite(Relay_2, RELAY_OFF);// set the Relay OFF
  delay(1000);              // wait for a second  
  digitalWrite(Relay_3, RELAY_OFF);// set the Relay OFF
  delay(1000);              // wait for a second
  digitalWrite(Relay_4, RELAY_OFF);// set the Relay OFF
  delay(4000);              // wait see all relays OFF  
  

}//--(end main loop )---



//*********( THE END )***********

Im been reading this page about 4 relays module http://arduino-info.wikispaces.com/ArduinoPower#4-8

The switching capacities of those relays sound ok for your appliances. But this statement concerned me:

5V 4-Channel Relay interface board, and each one needs 50-60mA Driver Current

That's more than an Arduino output can supply. Yet they are sold for use with Arduino, and there appear to be opto-isolators and transistors on the board. So hopefully it's a mistake. But you should check with the seller if you can.

EDIT: could be the "Driver current" won't be drawn from the Arduino outputs themselves, but from the relay board's Vcc pin. If that's the case, no problem, but the seller should make that clearer, otherwise they might lose sales!