Climate Monitoring System using ARM

DOI : 10.17577/IJERTV1IS5431

Download Full-Text PDF Cite this Publication

Text Only Version

Climate Monitoring System using ARM

Nelaparthy Benhur CH.Phanisri

Student, M.Tech Associate Professor

Abstract

Monitoring environmental conditions is very essential in research field like agriculture and zoology. Here a climate monitoring system is designed on ARM7 based 16-bit/32-bit microcontroller LPC2148 which measures the temperature, relative humidity, and light intensity with respect to date and time. The date and time are displayed on a 16×2 LCD, when these parameter values are measured. These values with respect to date and time are stored in the I2C serial interface EEPROM using I2C serial communication. By using RS232 interface the stored data can be transmitted and saved on the computer system hyper terminal for further analysis.

  1. Introduction

    The art of weather forecasting began with early civilizations using reoccurring astronomical and meteorological events to help them monitor seasonal changes in the weather. Around 650 B.C., the Babylonians tried to predict short-term weather changes based on the appearance of clouds and optical phenomena such as haloes. In order to predict climate, instruments were needed to measure the properties of the atmosphere, such as moisture, temperature, and light intensity. The first known design in western civilization is a hygrometer, an instrument to measure the humidity of air and thermometer to measure temperature in the year 1592.

    The potential economic benefits of more accurate weather monitoring are immense. For example, Sample crops that could benefit from more accurate climate monitoring aiding farmers in selecting harvesting times and in protecting their crops from freezing temperatures. In military operations, there is a considerable historical record of instances when weather conditions have altered the course of battles. Knowing of temperature, precipitations and humidity is essential for preventing and controlling wildfires in forests.

    The above reasons tell the advantages of climate monitoring. Climate monitoring system is so designed that it is portable, easy to use, and can store parameter values which are observed. For this ARM7 based 16- bit/32-bit microcontroller LPC2148 whose core is a 32- bit embedded RISC processor delivered as a hard macro cell optimized to provide the best combination of performance, power and area characteristics. The ARMTDMI core enables system designers to built embedded devices requiring small size, low power and high performance. It is having inbuilt I2C protocol communication, UART serial communication, ADC and real time clock. The I2C protocol is more advantageous than SPI protocol as it has the features of two wire serial interface, full duplex communication, software addressable, multiple master protocol. I2C serial communication protocol supports writing data into EEPROM device and so it is used here. Real time clock is used in the system design. For editing of time, 74LS21 IC is used for implementing switches. Temperature, relative humidity and light intensity sensors are used for sensing the climate. LCD is used to display date and time. The temperature, relative

    humidity, and light intensity values with respect to data and time are stored in EEPROM using I2C protocol. The data in the EEPROM is displayed on hyper terminal using UART serial communication.

  2. Block Diagram

  3. Features of Microcontroller

ARM7 LPC2148 has the following features which are required for climate monitoring system design.

  1. 16-bit/32-bit ARM7 TDMI-S microcontroller

  2. 40kB of on-chip static RAM and 512kB of on-chip flash memory

  3. In-System Programming/ In-Application Programming (ISP/IAP)

  4. Two 10-bit ADCs provide a total of 14 analog inputs, with conversion times as low as 2.44µs per channel

  5. Low power Real-Time Clock (RTC) with independent power and 32 kHz clock input

  6. Multiple serial interfaces including two UARTs, two Fast I2C-buses (400kbit/s).

  7. Vectored Interrupt Controller (VIC) with configurable priorities and vector addresses

  8. 48 of 5V tolerant fast general purpose I/O pins

  9. Individual enable/disable of peripheral functions as well as peripheral clock scaling for additional power optimization

  10. CPU operating voltage range of 3.0V to 3.6V (3.3V

± 10%) with 5V tolerant I/O.

4. Interfacing sensor to Microcontroller

A sensor is a device that measures a physical quantity and converts it into an equivalent digital signal [1]. Monitoring the climate means sensing the changes in the climate. The basic parameters which are measured in the climate monitoring are temperature, relative humidity and light intensity. For this, temperature, humidity, and light dependent resistor sensors are used.

Temperature Sensor

LM35 IC which was manufactured by National Semiconductors is used to measure temperature. The temperature sensor has three terminals as shown in figure 1. The Vcc pin is given a supply voltage of 5V DC. The ground pin is grounded. The data pin is connected to the chanel-1 of the inbuilt ADC using port pin P0.29. The sensor gives electrical output proportional to the temperature (0C). The general equation used to convert output voltage to temperature is

T (oC) =Vout*(100o C/Vcc)

Figure 1. Pin connection of temperature sensor

Humidity Sensor

SHY-2 humidity sensor is used to measure humidity. Humidity is an important factor in personal comfort and in quality control for materials, machinery etc. The sensor has two pins as shown in the figure 2. The sensor circuit produces a linear voltage vs. RH

output that is proportional to the supply voltage. Its operating voltage is 3.3V as the humidity varies from 20~95% RH. The accuracy of humidity sensor is ±5% RH (at 25ºC, 60%RH). The change in the RH of the surrounding produces a digital output which is given to the inbuilt ADC of the microcontroller.

Figure 2. Pin connection of humidity sensor

Light Sensor

LDR is Light Dependent Resistor which is used as light sensor. It gives output in terms of voltage which indicates the light intensity of the surroundings. The cell resistance falls with increasing light intensity. Its operating voltage is 320V AC or DC peak. LDR is having two terminals as shown in the figure 3. The data pin is interfaced with the trim pot which has variable resistance. The other pin of the LDR is grounded. The other pin of the trim pot is given to 3.3V power supply. The data pin is given to the inbuilt ADC of the microcontroller.

Figure 3. Pin connection of light sensor

4. EEPROM Interfacing

The EEPROM stores data coming from analog to digital converter channels of the microcontroller. The serial clock (SCL) and serial data (SDA) are the two pins used for writing and reading data from EEPROM. The memory required for storing data which consists of temperature, relative humidity and light intensity with respect to date and time is eleven bytes. Like this last twenty three values are stored in the EEPROM. Total of 253 bytes is used for storing these values. The EEPROM of ATMEL Company is used. This is programmed to store data for every one minute. The supply voltage is given 5V DC and the ground pin is grounded. The interfacing of EEPROM to the microcontroller is shown below. The features of EEPROM are low voltage and standard voltage operation 5.0 (Vcc=1.8V to 5.5V), 2.7 (Vcc=2.7V to 5.5V), and 1.8 (Vcc=1.8V to 5.5V); 1 MHz (5V), 400

KHz (2.7V) and 100 KHz (1.8V) compatibility.

Serial Clock (SCL): The SCL input is used to positive edge clock data into each EEPROM device and negative edge clock data out of each device.

Serial Data (SDA): The SDA pin bidirectional for serial data transfer. This pin is open-drain driven and may be wire-ORed with any number of other open- drain or open collector devices.

Device/Page Addresses (A0, A1, A2): The A0, A1, A2 pins are device address inputs that are hardwired or left not connected for hard compatibility.

Write Protect (WP): The write protect input, when tied to GND, allows normal write operations. When WP is tied to VCC, all write operations to the memory are inhibited. If left unconnected, WP is internally pulled down to GND.

Figure 4. Pin connection of EEPROM

  1. Protocol used for Interfacing ARM Device

    Inter-Integrated Circuit generically referred to as "two-wire interface" is a multi-master serial single- ended computer bus invented by Philips in the year 1982 that is used to attach low-speed peripherals like EEPROM to the microcontroller. Each device connected to the bus has a unique address and only one device is connected. Data is divided into 8-bit bytes to be transmitted. A few control bits for controlling the communication start, end, direction and for an acknowledgment mechanism are used. The active wires

    i.e. serial clock (SCL) and serial data (SDA) are both bi-directional. The I2C protocol specification states that the IC that initiates a data transfer on the bus is considered the bus master. Consequently, at that time, all the other ICs are regarded to be bus slaves. Here LPC2148 microcontroller which is having inbuilt I2C protocol which is completely interrupt driven acts as master and EEPROM as slave. The I2C protocol specification states that data may only change on the SDA line if the SCL clock signal is at low level; conversely, the data on the SDA line are considered as stable when SCL is in high state. At the physical layer, both SCL and SDA lines are open-drain I/Os with pull- up resistors. Pulling such a line to ground is decoded as a logic ZERO, whereas releasing the line and letting it float is a logic ONE. Actually, a device on an I2C bus only drives zeros.

    Writing Byte into I2C Device

    Figure 5. Write Byte operation

    For writing a byte on the SDA line first a start bit to the slave device i.e. EEPROM and the device address with write bit is sent. The serial interrupt is set. Slave device sends an acknowledgement. Then serial interrupt is cleared. Master sends word address. Serial interrupt is set. Slave sends acknowledgement and serial interrupt is cleared. Master sends the data to be stored in slave device. Serial interrupt is set. Slave send the acknowledgement and serial interrupt is cleared. Master sends the stop bit. After this process the byte is written into EEPROM.

    Reading Byte from I2C Device

    Figure 6. Read Byte operation

    For reading the data stored in EEPROM, a start bit is sent on the SDA line. Device address and the read bit are sent to the slave device. Serial interrupt is set. The slave device sends an acknowledgement to the master. Then serial interrupt is cleared. Then data is read from EEPROM and a stop bit is sent by the microcontroller. After this process the data is read from EEPROM.

  2. Interfacing 74LS21 to Microcontroller

    This device is manufactured by National Semiconductors Company. This device contains two independent gates each of which performs the logic AND function. Its logic function is, by default the output is high when all the inputs are in logic high. When one of the inputs becomes low its output is low. The supply voltage is 5V DC. The input voltage is 5V DC. The IC operating temperature is 0º to +70ºC. Here it is used to do some operations like date and time editing, erasing EEPROM and updating stored values of EEPROM to the hyper terminal. Four switches S1, S2, S3, S4 are interfaced to the inputs of the AND gate and also connected to four port pins. Y is the output of the AND gate given to the port P0.14. The four switches acts as interrupts to the system. When any of the switches is pressed, interrupt is generated. The interrupt is disabled first and then interrupt service routine is executed. Interrupt is again enabled for the next interrupt.

    Figure 7. 74LS21 IC connection to switches

  3. Real Time Clock

Real time clock is inbuilt in ARM7 LPC2148 microcontroller is used to provide uninterrupted real time clock to the system. This gets power from independent battery and is programmed to count the date, month, year, hour, minutes and seconds. Date and time are displayed continuously on the 16×2 LCD display unit. The date and time are edited by using switches. Real time clock is programmed to store date and time in EEPROM with respect to the sensor values for every one minute.

  1. Analog to Digital Converter

    Analog to digital converter is inbuilt in ARM7 LPC2148 microcontroller. Three channels out of 14 channels which are divided in ADC0 and ADC1 are used to take analog data from the three sensors. The analog to digital converter is 10bit resolution with programmable acquisition of data. 10 bit conversion time is 2.44µs. The sensed values from the three sensors are converted into digital equivalent which will be in-between 0-1023 steps. The digital values are given to the microcontroller. The reference voltage is 3.1V. Microcontroller stores the values to EEPROM. ADC registers used are

    ADCR-ADC Control Register

    ADDR0-A/D Channel 0 Data Register. ADDR1-A/D Channel 1 Data Register. ADDR2-A/D Channel 2 Data Register.

  2. LCD Interfacing to Microcontroller

    A liquid crystal display (LCD) is a thin, flat panel used for electronically displaying information such as text and integers. Its major features are its lightweight construction, and portability. Date and time are continuously displayed on LCD when the sensor values are being stored in EEPROM. Four data lines are used to send data on to the LCD. When RS=0 and EN pin is made high to low command is sent to LCD. When RS=1 and EN pin is made high to low data is sent to LCD. VEE is used to adjust contrast.

    Figure 8. LCD connection to LPC2148

  3. PC Interfacing using RS-232 serial communication

    PC is interfaced with ARM7 LPC2148 using MAX-232. It is the IC used to convert the TTL logic level to the RS-232 logic level. RS-232 is one of the communication protocols that does not require clock along with data lines. There are two data lines Tx and Rx for the serial communication. To convert TTL logic level to RS-232 standard, MAX-232 IC is used. The MAX-232 operates from a single 5-V power supply with 1.0µF charge-pump capacitor. Data stored in the EEPROM is transmitted to PC using this serial communication.

    Figure 9. MAX-232 connection to UART and LPC2148

  4. Hyper Terminal

    Hyper terminal is an application in PC, which is used to display data read from EEPROM using RS-232 serial communication. First the COM port is selected. The baud rate is set to 9600. When the interrupt switch is pressed, the data stored in the EEPROM is uploaded on to the hyper terminal. The displayed data can be saved for further analysis.

    Figure 10. Hardware picture of climate monitoring system using ARM.

  5. Results and Conclusions

    Sensors are interfaced to the microcontroller and the EEPROM is interfaced to the microcontroller using I2C serial communication protocol. Switches are interfaced to 74LS21 IC and the IC is interfaced to the microcontroller. Date and Time are displayed on LCD display. The data from the sensors are stored in the EEPROM. Hence, the project climate monitoring system using ARM was developed. The developed system is successful in measuring temperature, relative humidity and light intensity. The stored values with respect to date and time are uploaded on to the hyper terminal for further analysis.

  6. References

    [1]. R.Tamil selvi, K.R.Valluvan Development of low cost power parameter masuring system using PIC, International Conference on Control, automation, communication and energy conservation conference, pp.1-5, 2009.

    [2]. Rajesh Luharuka, Robert X. Gao, and Sundar Krishnamurty A Microcontroller-Based Data Logger for Physiological Sensing Instrumentation and Measurement Technology conference, Vol:1,pp.175-180,2009

    [3]. R. Kuchtal, P. Stefan', Z. Barton, R Vrba' and M. Sveda Wireless Temperature Data Logger, TENCON IEEERegion/10Conference,pp.1-6,2008.

    [4]. Wei Shutao Chen Lin Cui Lili Wang Zhenxing Interface Design of EEPROM and Single Chip Micro Computer by IIC Bus International Conference on Information Management and Engineering-,pp.554-557,2009

    [5]. , M. Haefke, S. C. Mukhopadhyay! and H. Ewald A Zigbee Based Smart Sensing Platform for Monitoring Environmental Parameters, Instrumentation and Measurement Technology conference,pp.1-8,2011

    [6]. Frederic Leens An introduction to I2C and SPI protocols,IEEE Instrumentation and Measurement magazine-2009.

    [7]. Algiers, Algeria ,Berrandjia, M.L. ; Tiar, R. ; Liacha,

    1. ; Tahraoui, K. FPGA Implementation of I2C & SPI Protocols: a Comparative StudyInternational Conference on Electronics, Circuits, and Systems, ,pp.507-510, 2009.

[8].74LS21 data sheet, www.alldatasheet.com/datasheet- pdf/pdf/124911/ETC1/74LS21.html

[9].AT24C08/datasheet,www.grifo.com/PRESS/DOC/Atmel/A T24C08.PDF

[10].LM 35 data sheet, www.ti.com/product/lm35

[11].SYH-2 data sheet, www.datasheetarchieve.com/syh-2- datasheet.html

[12].LPC214x,user-manual, www.nxp.com/documents/user_manual/UM10139.pdf

International Journal of Engineering Research & Technology (IJERT)

ISSN: 2278-0181

Vol. 1 Issue 5, July – 2012

Leave a Reply