Top Banner

of 21

Building Temperature and Relative Humidity Sensors for Obtaining Greenhouse Environmental Data

Oct 12, 2015

Download

Documents

MelgcSmith

While studying in Malaysia, Savannah State University Global Tiger, Patrick Dean, Jr., presented these findings from his research.
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript

PowerPoint Presentation

Building Temperature and Relative Humidity Sensors for Obtaining Greenhouse Environmental Data

Patrick Dean Jr.ObjectivesThe purpose of the mini project was to create a device that is capable of monitoring air temperature and relative humidity changes in a greenhouse. The intent of this project involves: 1) Learning Arduino Uno and sensors, 2) Learning fundamental basics of creating circuits, 3) Learning basics of C language for coding in Arduinos Integrated Development Environment (IDE) Program, 4) Learn microcontroller technology and impact of using microcontrollers to create monitoring systems in Agriculture. IntroductionIn order to remotely monitor the ambient temperature and humidity within a greenhouse at constant intervals throughout the day an Environmental monitoring device was created. The Environmental Monitoring device created has 5 major components: the Arduino Uno microcontroller, the lm35 Temperature Sensor by Cytron Technologies, the HR202 Humidity Sensor by Cytron Technologies, the breadboard to create the temporary circuit, and the Arduino Integrated Development Environment (IDE) to create and run source code.

3IntroductionThe Arduino Uno is a microcontroller that has 14 digital input/output pins, a power jack, USB connection, and reset button. Depending on the amount of power needed for all of the sensors to function the USB connection can power the microcontroller as well as the power jack.

4IntroductionThe lm35 temperature sensor is a precision centigrade temperature sensor with an integrated circuit. The output voltage is linearly proportional to temperature in degrees Celsius at 10 mv per degree C.

5IntroductionThe humidity sensor module is mounted with the HR202 Humidity Sensor. The HR202 is a basic sensor that only needs a source of power to begin operation.

6MethodologyThe project was carried out in the following stages: Research and Analysis of components of neededDesign of circuit Design Implementation Testing.

7MethodologyProcess: Wire lm35 and Arduino Uno to the breadboardCreate and test code for lm35 temperature sensorAdd LED to circuitTest temperature sensor and code for accurate readingsWire HR202 Humidity Sensor to the breadboardCreate and test code independently Test both Temperature and Humidity Sensor together for accurate readings

8MethodologyWe created a couple of different source codes before we created one that worked. We made sure the temperature sensor and humidity sensor worked independently before getting them to work together.

//Pins in use://LED: D2//Temperature sensor: A0

const int inPin = 0; //sensor connected to this analog pinconst int threshold = 35; // the degree Celsius that will trigger outputint led = 2; //digital output pin

void setup() { // initialize the digital pin as an output. pinMode(led, OUTPUT); Serial.begin(9600);//data read in bps for serial data transmission}

void loop() { int value = analogRead (inPin); long Celsius = (value*500L)/1024; // 10 mV per degree CSerial.print (celsius);Serial print (degrees Celsius: );if(celsius>threshold){ digitalWrite (output, HIGH);Serial.println(pin is on);pinMode(2, OUTPUT); digitalWrite(2, HIGH); }else{digitalWrite(outPin, LOW);Serial.println(pin is off);pinMode(2, OUTPUT);digitalWrite(2, LOW); } delay(1000);//wait for one second

}Turn on the LED when temperature goes above 35C9MethodologyCreated a couple of different source codes before we created one that worked. We made sure the temperature sensor and humidity sensor worked independently before getting them to work together.

Turn on the LED when temperature goes above 35C

10MethodologyThe Arduino Unos connection to the breadboard requires connections from certain pins to the breadboard: the power pin is the 5 volt pin, the ground pin, and the analog pin.

11MethodologyThe lm35 sensor has its positive terminal pinned to 5 volts by way of the breadboard. The ground terminal is wired on the breadboard to connect with the ground pin on the Arduino Uno. The output terminal is pinned to Analog 0 (A0) on the Arduino Uno.

12MethodologyThe HR202 humidity sensor has 4 pins: positive and negative pins connected to 5 volts power, 1 ground pin, and 1 analog pin, A1.

13MethodologyThe LED is wired to digital ground pin with its resistor wired to digital pin 13 (on the Arduino Uno).

14Results//Pins in use://LED: D3//Temperature sensor: A0//redled: D5//Relative Humidity sensor: A1

int inPin = A0; //sensor connected to this analog pinint RelHum = A1; // RH sensor int led = 13; //digital output pinint redled = 5; // digital output pin

void setup() { // initialize the digital pin as an output. Serial.begin(9600);//data read in bps for serial data transmission pinMode(led, OUTPUT); pinMode(inPin, INPUT); pinMode(yellowled, OUTPUT); pinMode(RelHum, INPUT);}void loop(){ int value = analogRead(inPin);

float humidity = analogRead(RelHum);long celcius = (value*500L)/1024; // 10 mV per degree C

Serial.print("Temperature=");Serial.println(celcius); Serial.print("Relative humidity="); Serial.println(humidity); Serial.print("\n");if(celcius>30){ digitalWrite (led, HIGH);//Serial.print("Pin is on");//Serial.print("\n"); }else{digitalWrite(led, LOW);//Serial.print("Pin is off");//Serial.print("\n");}//if(humidity