Humidity control with arduino
-
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); }
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login