Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. My Project
  3. Humidity control with arduino

Humidity control with arduino

Scheduled Pinned Locked Moved My Project
2 Posts 2 Posters 1.5k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    abhisuma
    wrote on last edited by
    #1

    I have created a program with arduino uno for controlling humidity in my mushroom grow room.
    There are two rooms and i am trying to control humidity of each room with one pressure pump , two solenoid valves and relays. I am trying to keep the humidity range in each room in between 75 - 88.
    As per my planning if the humidity in one room is below 75 the relays connected to pressure pump and solenoid valve for that particular room to be turned on and would be turned off on exceeding 88,and the same procedure for the other room.I have created code for this and as i am beginner i think it is better to present the code to the experienced guys before testing ,pls check my codes and help to rectify any problems.

    Insert Code Here#include <dht.h>
    
    dht DHT;
    
    #define DHT1_PIN 2
    #define DHT2_PIN 4
    #define DHT1TYPE DHT11
    #define DHT2TYPE DHT11
    int pumppin =7;
    int solenoidpin =8;
    int valvepin =12;
    
    void setup(){
      pinMode(pumppin, OUTPUT);
      pinMode(solenoidpin, OUTPUT);
      pinMode(valvepin, OUTPUT);
    }
    void loop()
    {
      int chk =DHT.read11(DHT1_PIN);
      if (DHT.humidity <75) {
        if (digitalRead(pumppin == HIGH)){
          digitalWrite(solenoidpin, HIGH);
        }else{
          digitalWrite(pumppin, HIGH);
          digitalWrite(solenoidpin, HIGH);
        }
      }
      if (DHT.humidity >88) {
      digitalWrite(pumppin, LOW);
          digitalWrite(solenoidpin, LOW);
        }
        delay(5000);
        
        int chk2 =DHT.read11(DHT2_PIN);
      if (DHT.humidity <75) {
        if (digitalRead(pumppin == HIGH)){
          digitalWrite(valvepin, HIGH);
        }else{
          digitalWrite(pumppin, HIGH);
          digitalWrite(valvepin, HIGH);
        }
      }
      if (DHT.humidity >88) {
      digitalWrite(pumppin, LOW);
          digitalWrite(valvepin, LOW);
        }
        delay(5000);
    }
    
    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Locking this topic to aviod unnecessary double work and confusion since the same post was made at https://forum.mysensors.org/post/71293

      Pleas don't post the same question multiple times.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      14

      Online

      11.7k

      Users

      11.2k

      Topics

      113.1k

      Posts


      Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • MySensors
      • OpenHardware.io
      • Categories
      • Recent
      • Tags
      • Popular