- Open Access
- Authors : Kamweru Paul Kuria , Owino Ochieng Robinson , Mutinda Mutava Gabriel
- Paper ID : IJERTV9IS120214
- Volume & Issue : Volume 09, Issue 12 (December 2020)
- Published (First Online): 28-12-2020
- ISSN (Online) : 2278-0181
- Publisher Name : IJERT
- License: This work is licensed under a Creative Commons Attribution 4.0 International License
Monitoring Temperature and Humidity using Arduino Nano and Module-DHT11 Sensor with Real Time DS3231 Data Logger and LCD Display
Kamweru Paul Kuria Department of Physical Sciences Chuka University
Owino Ochieng Robinson Department of Physical Sciences Chuka University
Mutinda Mutava Gabriel Department of Physical Sciences Chuka University
Abstract – Humidity and Temperature are crucial parameters for the optimal response of biological systems e.g. each has its own impact on growth and production of quality crops. There are several techniques of measuring humidity and temperature. However, there is still a need for continuous technological innovation to enable fast, real time and remote monitoring of these parameters. The aim of this study research was to fabricate a functional hardware and software system to measure temperature and humidity. The system was designed to allow multiple communication with user by recording of the data in Real time, storing the acquired data in an SD card, incorporate an alarming system (piezo buzzer) together with an LED indication mechanism. The study utilized an Arduino Nano board interfaced with a Temperature and Humidity sensor, Real Time Clock (RTC), LCD, and Micro SD card Module, piezo buzzer and LED, and had the ability to store the data as text file. A code was generated using the computer with the appropriate Arduino program and sent to the Arduino microcontroller for running the circuit. To study the performance characteristics of the Arduino-based humidity and temperature sensor, two independent running test were done, one outside the Physics laboratories and the second inside a Green House, both at Chuka University, Kenya.
Keywords – Arduino Nano, Temperature and Humidity sensor, Real Time Clock, LCD and micro SD card module
Temperature and humidity are perhaps the most monitored environmental variables as the two have shown significant impact in the almost all aspects, e.g. of optimal plant growth and development [1,2], the quality of food during production processing and storage , efficiency of many temperature and humidity-sensitive equipment [4,5] among many others. The monitoring of temperature and humidity in laboratories, storages, halls, school and hospitals is important with respect to health and hygiene [6,7,8].
Despite this, temperature and humidity measurement is among the most difficult problems in basic metrology. The difficulty to achieve accuracy due to the fragility and the requirement standards to maintain the preferred good quality instruments. Thus much interests have been geared towards the improvement of existing instrument and come up with more innovative ones as done recently by the authors  and .
This study was motivated by the dire need to provide a system capable of monitoring of temperature and humidity by one integrated system, having real time data logging, with an
embedded alarming system that alerts the user when the desired temperature and humidity limits are exceeded recorded. The study utilized the Arduino, a low-cost, effective readily available open resource. The study was also to display the values of temperature and relative humidity as well as the time at which these values were recorded on the LCD screen. The language needed to program the microcontroller is user friendly since it uses a combination of C and C++. Its storage is almost space less since together with its components requires minimal space and can reduce the manpower of farming and reduce the number of greenhouse attendant and workload . But majority of times such an alerting humidity and temperature fluctuation could easily go unnoticed, the user or the person in charge is sleeping or in absentia due to some unavoidable circumstances in case, it is better to log the data in a storage medium in case of such an event so that he can keep a track of the data. The purpose of this Arduino microcontroller for the study were used in programing and running the circuit. The program (code) is generated using the Arduino IDE software and fed into the microcontroller. In interfacing the Arduino Nano in the circuit, it will run it to produce the required results.
The Arduino Nano is an open-source microcontroller board based on the Microchip ATmega328P microcontroller and developed by Arduino.cc. [12, 13]. The board is equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The board has 14 digital I/O pins (six capable of PW output), 6 analog I/O pins, and is programmable with the Arduino IDE (Integrated Development Environment), via a type B USB cable. It can be powered by the USB cable or by an external 9-volt battery, though it accepts voltages between 7 and 20 volts. It is also similar to the Arduino Nano and Leonardo. A good example of the Arduino Nano microcontroller is shown in the Figure 1.
Fig. 1. Arduino Nano microcontroller
The word "Uno means "one" in Italian and was chosen to mark the initial release of Arduino Software. The Nano board is the first in a series of USB-based Arduino boards; it and version 1.0 of the Arduino IDE were the reference versions of Arduino, which have now evolved to newer releases. The ATmega328 on the board comes preprogrammed with a boot loader that allows uploading new code to it without the use of an external hardware programmer. While the Nano communicates using the original STK500 protocol, it differs from all preceding boards in that it does not use the FTDI USB-to- serial driver chip. Instead, it uses the Atmega16U2 (Atmega8U2 up to version R2) programmed as a USB-to-serial converter .
Liquid Crystal Display (LCD)
Liquid-Crystal Display (LCD), shown in Figure 2, is a flat- panel display or other electronically modulated optical device that uses the light-modulating properties of liquid crystals combined with polarizers. Liquid crystals do not emit light directly, instead using a backlight or reflector to produce images in color or monochrome. LCDs are available to display arbitrary images (as in a general-purpose computer display) or fixed images with low information content, which can be displayed or hidden, such as preset words, digits, and seven- segment displays, as in a digital clock. They use the same basic technology, except that arbitrary images are made from a matrix of small pixels, while other displays have larger elements. LCDs can either be normally on (positive) or off (negative), depending on the polarizer arrangement. For example, a character positive LCD with a backlight will have black lettering on a background that is the color of the backlight, and a character negative LCD will have a black background with the letters being of the same color as the backlight. Optical filters are added to white on blue LCDs to give them their characteristic appearance .
Fig. 2. Liquid Crystal Display for Displaying Readings
Real Time Clock Module
Real time clocks (RTC), as the name recommends are clock modules. The DS3231 real time clock (RTC) IC is an 8 pin device using an I2C interface, shown in Figure 3. The DS3231 is a low-power clock/calendar with 56 bytes of battery backup SRAM. The clock/calendar provides seconds, minutes, hours, day, date, month and year qualified data. The end date of each month is automatically adjusted, especially for months with less than 31 days. They are available as integrated circuits (ICs) and supervise timing like a clok and also operate date like a calendar. The main advantage of RTC is that they have an arrangement of battery backup which keeps the clock/calendar running even if there is power failure. An exceptionally little current is required for keeping the RTC animated. We can find these RTCs in many applications like embedded systems and computer mother boards, etc. In this article we are going to see about one of the (RTC), i.e. DC3231 .
Fig. 3. Real Time Clock Module for time keeping
Humidity and Temperature sensors
DHT11, shown in Figure 4, is a temperature and humidity sensor has four pins- VCC, GND, Data Pin and a not connected pin. A pull-up resistor of 5k to 10k ohms is probed for communication between sensor and micro-controller. DHT11 sensor consists of a capacitive humidity sensing element and a thermistor for sensing temperature. The humidity sensing capacitor has two electrodes with a moisture holding substrate as a dielectric between them. Change in the capacitance value occurs with the change in humidity levels. The IC measure, process this changed resistance values and change them into digital form [15,16,17]. For measuring temperature this sensor uses a Negative Temperature coefficient thermistor, which causes a decrease in its resistance value with increase in temperature.
Fig. 4. DHT11 Humidity and Temperature sensor
SD Card module
The SD card works on 3.3V but if you want to use them with Arduino for storing data then you will have to use a SD card module shown in Figure 5. The SD card module we have used is for the micro SD cards and it uses the FETs for level shifting and also a 3.3V regulator which converts the 5V from Arduino into the 3.3V for micro SD card. The Arduino SD card module has a socket for the SD cards on the back side and I have tested memory cards up to 128 GB which works fine. With six pins, VCC and GND for power and the other four pins for SPI communication. The other four pins are as follows MISO (Master in Slave out), MOSI (Master out slave in), SCK (System Clock), and CS (Chip Select). This SD card module uses FETs for level shifting and also has a voltage regulator which converts 5V in to 3.3V. The communication between the Arduino and the SD card module is done by using the SPI.
Arduino e.g. for sound alarm alerts in distance measurements and many others. If the crystal pushes against a diaphragm, like a tiny speaker cone, it can generate a pressure wave which the human ear picks up as sound. Simple change the frequency of the voltage sent to the piezo and it will start generating sounds by changing shape very quickly .
Fig. 6. Piezo Buzzer
The brain part of the building monitoring system, the Arduino IDE (integrated development environment), is a software development environment or software application for Arduino where users can write different kind of computer programs and test. The user can write codes in IDE in a language which an Arduino understands, i.e. C, C++. The program (codes) written in IDE, when uploaded into the Arduino microcontroller determines what and how the system works. The Arduino IDE comes with a built-in code parser that studies the validity of the written codes before sending it to the Arduino. The compilation and translation work is done in IDE after checking the validity of codes. After translating the code, the IDE uploads the program to the Arduino microcontroller . IDE software includes the set of different programs that are ready for being tested on the device. Just like in other programming platform, Arduino IDE can also be extended with the use of libraries; the IDE installation includes the installation of number of libraries . The software page where Arduino codes are written looks like as shown in Figure
7. It has two main functions setup () function and loop () functions. The setup part is where the codes should be written so that the program runs and the loop part is where the codes should be written so that the program runs with repetition until the power off or reset button is pushed. It allows users to program and edit Arduino to do anything they like to do with it. Depending upon the feature of different boards, the IDE enables communication with Arduino board through USB . The following figure shows the screen capture of Arduino IDE.
Fig. 5. SD Card Module.
Piezo buzzers, an example in Figure 6, are a simple device that can generate basic beeps and tones, they work by using a piezo crystal, a special material that changes shape when voltage is applied to it. They have been used in connection with
Fig. 7. Arduino IDE
The materials were connected as follows. The Arduino Nano was interfaced to the breadboard. One jumper wire from the 5-volt pin on the Arduino was connected to the bottom channel of the breadboard. Another jumper wire from a ground pin on the Arduino was connected to the upper channel of the breadboard. DHT11 Positive pin (Vcc) to breadboard positive power rail, Negative pin (GRD) to breadboard negative power rail, Signal pin (DATA) to Arduino Analog A3.
The RTC connects to the Arduino Nano board as follows: SDA pin was connected to a 4 analog pin Arduino Nano board; SCL pin connects to a 5 analog pin Arduino Nano board; a GND pin was connected to GND pin Arduino Nano board; a VCC (5V) pin was connected to 5V Arduino Nano board pin; a SQW pin was not used. To work with RTC, the library RTC lib was included in the Arduino development environment.
CS of mini SD card module to digital pin 10 on the Arduino, SCK of mini SD card module to digital pin 13 on the Arduino, MOSI of mini SD card module to digital pin 11 on the Arduino, MISO of mini SD card module to digital pin 12 on the Arduino, VCC of mini SD card module to digital 5V on the Arduino, GND of mini SD card module to digital GND on the Arduino. Following this procedure the study introduced RTC and SD Card as shown in Figure 8.
Fig. 8. Arduino interfaced with SD card.
Piezo Buzzer has two terminals; Positive and negative. The positive terminal was connected to the pin 8 at the Arduino while the negative part was interfaced with 330 Ohms resister and connected to the lower channel of the breadboard.
The study utilized one red LED which was connected to the pin number 9 with jumper wire. The negative terminal was interface with the 330 Ohms resisters to the lower channel of the breadboard.
LCD has 16 terminals which were connected to the Arduino as: Pin 14 to Pin 7, Pin 13 to pin 6, Pin 5 to GRD, pin 4 to pin 2, Pin 6 to pin 3, Pin 11 to pin 4 as shown. The 5V pin from the Arduino was connected to the positive line on the breadboard. Also, the ground pin from the Arduino was connected to the negative part of the breadboard. For the re-set of the intensity of the LCD screen, a 10k potentiometer was interfaced to the breadboard with it middle terminal to pin 3. Potentiometer was connected to the breadboard, the positive terminal to the positive pin and the negative terminal to the ground pin to the ground pin as shown in Figure 9.
Fig. 9. Figure 1: Adruino interfaced with DHT11and LCD
The code was generated using the computer with the appropriate Arduino IDE program and sent to the Arduino microcontroller for running the circuit. All the modules were designed and all the components assembled. The testing of each module was carried out successfully. The sensor readings were effectively retrieved in a stable environment and stored in files. The file was then imported to excel automatically using macros and the data was cleansed and formatted for a neater representation. Graphical charts were then plotted using the data which presented a nice analytical view of weather pattern based on sensor readings. Thus the testing phase was completed. This study was performed in a controlled manner.
Thus, there is a need to conduct further experiments in environments more similar to real weather conditions.
RESUTS AND DISCUSSION
This study sought to first design, data logging of humidity and temperature and raise a light (from an LED) and a sound alarming (from a sound buzzer). To achieve this, the components that include the Arduino Uno, resistors, LED, buzzer, RTC, SD Card module, LCD and Humidity and temperature sensor were fixed to the breadboard and connected as described in chapter three. Figure 10, shows the connections in progress. A jumper wire was connected from the 5 volts port from the Vcc port in the microcontroller chip to the positive channel of the breadboard. Another cable was grounded to the negative terminal of the breadboard from the GND port of the chip.
Fig. 10. Circuit for arrangement of resistor, LED, RTC and SD Card modules, buzzer, LCD and DHT11 sensor.
A piezo buzzer having two terminals, positive terminal was connected to the pin 8 at the Arduino while the negative part was interfaced with 330 Ohms resister and connected to the lower channel of the breadboard. When the power source was connected as in Figure 10, the piezo buzzer produced a single tone signal to indicate that power was flowing through it. The limit set for the Piezo Buzzer was to produce the sound alarm at the temperature greater than 00C and less than 270C.
The RTC was connected to the Arduino Nano board as follows: SDA pin is connected to a 4 analog pin Arduino Nano board; SCL pin connects to a 5 analog pin Arduino Nano board; a GND pin is connected to GND pin Arduino Nano board; a VCC (5V) pin connects to 5V Arduino Nano board pin; a SQW pin is not used. To work with RTC, the library RTC libs were included in the Arduino development environment. Upon powering of the Arduino, The RTC power LED lighted indicating that it was okay.
CS of mini SD card module was connected to digital pin 10 on the Arduino, SCK of mini SD card module to digital pin 13 on the Arduino, MOSI of mini SD card module to digital pin 11 on the Arduino, MISO of mini SD card module to digital pin 12 on the Arduino, VCC of mini SD card module to digital
5V on the Arduino, GND of mini SD card module to digital GND on the Arduino.
The project utilized one red LED that was connected to the pin number 9 with jumper wire. The negative terminal interfaced with the 330 Ohms resisters to the lower channel of the breadboard.
LCD has 16 terminals which were connected to the Arduino as: Pin 14 to Pin 7, Pin 13 to pin 6, Pin 5 to GRD, pin 4 to pin 2, Pin 6 to pin 3, Pin 11 to pin 4 as shown. The 5V pin from the Arduino was connected to the positive line on the breadboard. Also, the ground pin from the Arduino was connected to the negative part of the breadboard. For the re-set of the intensity of the LCD screen, a 10 k potentiometer was interfaced to the breadboard with it middle terminal to pin 3. Potentiometer was connected to the breadboard, the positive terminal to the positive pin and the negative terminal to the ground pin to the ground pin as shown in Figure 11.
Fig. 11. A powered circuit for motion detector with LED, Buzzer, DHT11 sensor, Arduino microcontroller, RTC and SD Card Module and 9 volt battery.
When the power was connected to the circuit, LCD produced a green yellow light and it displayed the details of the project followed then by the time, date, temperature and relative humidity values as in Figure 12 (Temperature, 23.6 and Relative Humidity as 95.0%).
Fig. 12. A humidity and temperature sensor with display of distances on the Liquid Crystal Display.
The study was initiated in one environment, and the logged data was tabulated and graphs generated from it. The assembled component was placed on a slight elevated ground in different confined space of study as shown on figure 11. The set was powered on and left there undisturbed for a stipulated time. Thereafter, the data was automatically logged into the SD Card storage media. The SD Card was then inserted into a
computer and the logged data exported to the Microsoft Excel for Data analysis. The temperature values from the sampled places were analyzed as corresponding logged data from SD Card then tabulated in the table 1.
TABLE 1. DATA FOR TEMPERATURE AND RELATIVE HUMIDITY AS RECORDED INTO THE SD CARD.
The LED interfaced to the Arduino microcontroller were able to blink giving out the light signals upon the extreme readings, as well as the piezo buzzer producing alarming signal. The LED was also to produce light (HIGH) when the Temperature is greater than 250C. After wiring and writing the code, the program was run and the built device was successful in measuring humidity and temperature. The LCD display and serial monitor readings are shown in Figure 13.
To study the performance characteristics of the used Arduino-based humidity and temperature sensor, the test was done in The University Green House. The test was done
Fig 13. Humidity and temperature plotted against time as recorded
outside the laboratory. The following show the table for humidity and temperature outside the laboratory.
SUMMARY, CONCLUSION AND RECOMMENDATION
The research project was successfully carried out. The aim of the research project was to come up with a technique which will monitor humidity and temperature in real time, record and store the data in an SD card while displaying the parameters on the LCD screen, produce a recorded sound alarm by Piezo Buzzer and also light indication by LED. The outcome was as per the expectations of the study in comparison with the results obtained by Schwartz (2015)  and Rajesh Shrestha (2019) and following this study, the main objectives were successfully reached.
The circuit was successfully connected and the program was sent to the Arduino microcontroller chip to run the circuit. The humidity and temperature sensor was able monitor the temperature and humidity, send the parameters to the micro controller chip for calculation of the relative humidity in real time before displaying them on the LCD screen and later to be stored into the SD Card and the alarm sound from the piezo buzzer was produced in conjunction with the LED.
Piezo Buzzer was set to produce sound indication in response to the parameter extremes. The limit set for the Piezo Buzzer was to produce the sound alarm at temperature greater
20 degrees Celsius. The results were correct since for the temperature equal or greater than 25 and the temperature equal to 30 produced no tone from the piezo buzzer.
The LED was also set to produce light signal in a particular set of temperature greater than 20 degrees Celsius. On the outcome, the LED produced light as it was expeced. The LCD was also expected to display the details of the project as well as the real time temperature and relative humidity values of humidity and temperature sensor. When the power was connected to the set-up, the details of the project were displayed in the LCD screen followed by the values monitored indicating that the connection was right. The intensity of the screen was expected to be controlled by the potentiometer of which the same was approved.
A single unit of the circuit was successfully assembled and only the potentiometer, LEDs, LCD and SD Card slot were not confined inside the box made for their proper working. They were able to produce the required results even when the entire circuit was closed inside the box.
This concludes that the present proposed work was a success and it will provide a convenient method for effective monitoring of temperature and humidity in real time. This system is compact to an extent and cost effective when compared to prices of instruments used to measure the environmental factors.
This system has the advantages that, first it is competent and reliable for real time monitoring of temperature and humidity. Secondly the system is totally digital, there is full arrangement of storage of the data so it can be further used for
analysis purpose. And finally the system can continuously monitor the environment parameters, updating the user at every fixed interval of time about the change in the parameters. This makes the user keep a better eye at the premises.
However the system is developed only for small area and though the sensor is nicely calibrated, there are chances of error in the readings as the sensor may get damaged when exposed to higher temperature beyond its limit.
This concludes that the present proposed work was a success and it will provide a convenient method for effective monitoring of temperature and humidity in real time. This system is compact to an extent and cost effective when compared to prices of instruments used to measure the environmental factors. In future, this system would be upgraded to web based monitoring system by using the GPRS (General Packet Radio Service) technique which would ease the user to have access over the system remotely over the Internet. Also, an upgrade for the monitoring of larger area would be done. Additionally, sensors like barometric pressure sensor, gas detector for air quality check, and a web interface would be all integrated into a single system which could just not only measure the temperature and humidity parameters but also the other parameters would be analyzed.
The authors acknowledge Mr. Mutunga and Mr. Gitonga for their technical support.
K. R. Lind, N. Lee, T. Sizmur, O. Siemianowski, S. Van Bruggen, B. Ganapathysubramaniam and L. Cademartiri. Plant growth environments with programmable relative humidity and homogeneous nutrient availability. PloS one, 2016: 11(6), e0155960.
R. S. Redmond, J. W. Jones, K. R. Thorp, A. Desa, H. C. Man and S. Taheri . Review of optimum temperature, humidity, and vapour pressure deficit for microclimate evaluation and control in greenhouse cultivation of tomato: a review. International Agrophysics, 2018: 32(2): 287.
A. Akila and P. Shalini. Food grain storage management system. International Journal of Engineering & Technology, 2018: 7(2.31): 170- 173.
D. I. Mendeleev, G. E. Marin, Y. Y. Galitskii and M.V. Savina. Assessment of the effect of humidity of air-cooled in the absorption refrigeration machine on the operation of an energy gas turbine. In IOP Conference Series: Materials Science and Engineering, IOP Publishing 2020: 971 (5) p. 052041).
H. Selin. Encyclopedia of the History of science, Technology and medium in Non-Western culture, 2nd Ed, Springer Published April 16, 2008, p739 ISBN 978-1-40-4559.
M. Dovjak, M. Shukuya and A. Krainer. User-centred healing-oriented conditions in the design of hospital environments. International journal of environmental research and public health, 2008: 15(10), pp 2140.
J. James and M.P. Maheshwar. Plant growth monitoring system, with dynamic user-interface, in 2016 IEEE Region 10 Humanitarian Technology Conference (R10-HTC), pp. 15, Agra, India.
S.R. Kumar and S. Rameshkumar. Industrial Temperature Monitoring and Control System through Ethernet Lan, IJECS, 2013: 2 (6), pp 1988-1991.
H. Benyezza, M. Bouhedda, M. C. Zerhouni, M. Boudjemaa and S. A. Dura. Fuzzy Greenhouse Temperature and Humidity Control based on Arduino. In 2018 International Conference on Applied Smart Systems (ICASS), IEEE, 2008: pp. 1-6.
P. Bhadani and V. Vashisht. Soil moisture, temperature and humidity measurement using Arduino. In 2019 9th International Conference on
Cloud Computing, Data Science & Engineering (Confluence), IEEE, 2009: pp. 567-571.
M. Schwartz. Programming Arduino with Lab VIEW, Published by Pack Publishing Ltd., 2005, ISBN 978-1-84969-822-1
Arduino cc. Arduino and Genuino Products Overview (Arduino Newsletter, 2016 and https://www.arduino.cc/en/Main/ArduinoBoardUno, Accessed on October 15, 2019.)
C. Amariei. Adruino Development Cookbook, Pactk Publishing Ltd., 2005, ISBN 978 1-78-398294 -3.
Xiamen Emote Display CO.LTD, Specification of LCD Module LCD datasheet Modulesparkfun. [Online]. Available:https://www.sparkfun.com/datasheets/LCD. (29, Oct, 2008).
D.T. Kenny. Basic Sensor Technology. In: J.S Wilson, ed. Sensor Technology Handbook. 2005.
Texas Instruments, LM35 Precision Centigrade Temperature Sensors, http://www.ti.com/lit/ds/symlink/lm35.pdf, Accessed on November 15, 2019.
I. Toyoda and C. Denso. Capacitive humidity sensor. 2003. U.S. Patent 6,647,782.\
G.M. Mutinda and P.K. Kamweru. Arduino UNO, ultrasonic sensor HC- SR04 motion detector with display of distance in the LCD..
U. Demisch and M. Testoterm GmbH and Co. (1991). Capacitive humidity sensor. U.S. Patent 5,050,434.
Kouhia-Euku. (2016): DEVELOPMENT OF AN ARDUINO-BASED EMBEDDED SYSTEM.: Case: Greenhouse monitoring. Published 2016
S. Rajesh. Study and Control of DHT11 Using Atmega328P Microcontroller , International Journal of Scientific & Engineering Research. IJSER (2019): 10(4).