Automatic Greenhouose Control System (1 Fan + 1 Bulb + 2 Relay Module + LCD 20x4

Hi Anyone,

Now I am doing the Final Year project of Automatic Greenhouse Control System. Can please advise how to combine the 3 different CODEs into one programme file for uploading into Arduino UNO R3 microcontroller?

below are the codes;

Motion sensor CODE:

const byte ledPin = A1; // LED pin
const byte lightSensorPin = 13; // lightSensor input pin
byte senseMotion = 0; // variable to hold current state of motion detector

void setup() {
// set the digital pin directions
pinMode(ledPin, OUTPUT);
pinMode(lightSensorPin, INPUT);
}

void loop()
{
// Now watch for daylight
senseMotion = digitalRead(lightSensorPin);
if (senseMotion == HIGH) { // insufficient daylight, yet...
digitalWrite(ledPin, LOW);
} else { // sufficient daylight!
digitalWrite(ledPin, HIGH);
}
delay(1000);
}

DHT 11 sensor with LCD CODE;

#include <dht.h>
#include <LiquidCrystal.h>

LiquidCrystal lcd(12, 11, 5, 4, 3, 2);

dht DHT;

#define DHT11_PIN 7

void setup(){
lcd.begin(16, 2);
}

void loop()
{
int chk = DHT.read11(DHT11_PIN);
lcd.setCursor(0,0);
lcd.print("Temp = ");
lcd.print(DHT.temperature);
lcd.setCursor(0,1);
lcd.print("Humidity = ");
lcd.print(DHT.humidity);
delay(1000);
}

thank you.

Min

Can please advise how to combine the 3 different CODEs into one programme file for uploading into Arduino UNO R3 microcontroller?

Sure can. Use a text editor.

Now, if you had some real requirements for the resulting program, then the parts of the three existing programs that needed to be borrowed for the new program might be relatively obvious.

I could have sworn that you said "I am doing"... Doesn't really sound much like it.

Type 'merging code' into the search box (top right of the screen) and you will find many resources to assist you.