Top Banner
ISSN 00204412, Instruments and Experimental Techniques, 2009, Vol. 52, No. 6, pp. 784–787. © Pleiades Publishing, Ltd., 2009. 784 1 1. INTRODUCTION Embedded systems are getting more and more popular with their integration in large number of applications. Broadly speaking today every application has got at least one embedded component integrated inside it, e.g., consumer electronics, automobiles, industrial automation, networking, etc. Nowadays they are also being devised as web application servers. The major benefits of embedding the web server are improved reliability, performance, efficiency, scalabil ity and low cost. Such systems can be found very useful in remote monitoring applications where direct human intervention is not possible or at least not nec essary. Many such applications are being developed, for example Can Filibeli et al. [1] have described use of embedded web server for controlling home appliances remotely. Elkeelany et al. [2] have worked on the design of low cost, low power embedded device which eliminates the requirement of OS level processing of network protocol stack. Manfred Bathelt et al. [3] have extended the design of web server and implemented device control using web browser. Takayuki Fujita et al. [4] have reported work on an environmental sensing system in which monolithically integrated multi sensor chip with on chip peripheral have been used to store data in temporary RAM and to send it to TCP/IP protocol on Ethernet. Farah Magrabi et al. [5] have described a web based approach for monitoring patients’ electrocardiogram. The server used in system provides database facility to 1 The article is published in the original. store information of all patients and an access to the patient’s data and ECG has been provided for clients’ node. This paper describes design of an embedded web server for weather parameter monitoring, which is devised around microcontroller P89V51RD2 inter faced with the Ethernet card RTL8019. In the pro posed system the temperature and humidity sensors along with the signal conditioning circuitry form an input part. When powered the system initializes the TCP/IP link, and waits for the HTTP request. On arrival of request from the remote node the Embedded Web Server takes snapshot of current ambient param eters and puts it into the preformatted webpage. This web page is then sent to the requester node. All the TCP/IP binding is catered by the Ethernet controller under the control of firmware of the system. 2. SYSTEM BLOCK DIAGRAM The system block diagram is shown in Fig. 1. It consists of temperature and humidity sensors, analog todigital converter, a microcontroller for controlling system’s activities, a LCD for local realtime display of parameters, and an Ethernet interface for network connectivity. The individual blocks are described below. The sensor unit monitors temperature and atmo spheric humidity with the help of LM35 semiconduc tor temperature sensor and SYHS220 humidity module, respectively. The LM35 precision tempera ture sensor produces calibrated and linear output in the range of –55 to +150°C. Similarly the calibrated humidity module SYHS220 minimizes the system complexity by reducing component count. APPLICATION OF COMPUTERS IN EXPERIMENTS Embedded Web Server for Monitoring Environmental Parameters 1 S. B. Chavan a , P. A. Kadam b , and S. R. Sawant b a Department of Electronics Technology, Shivaji University, Kolhapur, Maharashtra, 416004 India b Department of Electronics, Shivaji University, Kolhapur, Maharashtra, 416004 India email: [email protected] Received December 18, 2008; in final form, April 27, 2009 Abstract—In this communication a design of embedded web server based on the Ethernet technology for remote monitoring of weather parameters is presented. This web server monitors parameters viz. temperature and humidity and transmits this information in the form of HTML webpage. The input sensors LM35 semi conductor temperature sensor and SYHS220 humidity module have been employed, providing accuracy about 1° centigrade and 2% relative humidity. The web server provides simultaneous access to multiple nodes on the network. PACS numbers: 84.40.X6 DOI: 10.1134/S0020441209060050
24

Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically

Sep 04, 2020

Download

Documents

dariahiddleston
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
Page 1: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically

ISSN 0020�4412, Instruments and Experimental Techniques, 2009, Vol. 52, No. 6, pp. 784–787. © Pleiades Publishing, Ltd., 2009.

784

1 1. INTRODUCTION

Embedded systems are getting more and morepopular with their integration in large number ofapplications. Broadly speaking today every applicationhas got at least one embedded component integratedinside it, e.g., consumer electronics, automobiles,industrial automation, networking, etc. Nowadaysthey are also being devised as web application servers.The major benefits of embedding the web server areimproved reliability, performance, efficiency, scalabil�ity and low cost. Such systems can be found very usefulin remote monitoring applications where directhuman intervention is not possible or at least not nec�essary.

Many such applications are being developed, forexample Can Filibeli et al. [1] have described use ofembedded web server for controlling home appliancesremotely. Elkeelany et al. [2] have worked on thedesign of low cost, low power embedded device whicheliminates the requirement of OS level processing ofnetwork protocol stack.

Manfred Bathelt et al. [3] have extended the designof web server and implemented device control usingweb browser.

Takayuki Fujita et al. [4] have reported work on anenvironmental sensing system in which monolithicallyintegrated multi sensor chip with on chip peripheralhave been used to store data in temporary RAM and tosend it to TCP/IP protocol on Ethernet.

Farah Magrabi et al. [5] have described a web basedapproach for monitoring patients’ electrocardiogram.The server used in system provides database facility to

1 The article is published in the original.

store information of all patients and an access to thepatient’s data and ECG has been provided for clients’node.

This paper describes design of an embedded webserver for weather parameter monitoring, which isdevised around microcontroller P89V51RD2 inter�faced with the Ethernet card RTL8019. In the pro�posed system the temperature and humidity sensorsalong with the signal conditioning circuitry form aninput part. When powered the system initializes theTCP/IP link, and waits for the HTTP request. Onarrival of request from the remote node the EmbeddedWeb Server takes snapshot of current ambient param�eters and puts it into the preformatted web�page. Thisweb page is then sent to the requester node. All theTCP/IP binding is catered by the Ethernet controllerunder the control of firmware of the system.

2. SYSTEM BLOCK DIAGRAM

The system block diagram is shown in Fig. 1. Itconsists of temperature and humidity sensors, analog�to�digital converter, a microcontroller for controllingsystem’s activities, a LCD for local real�time display ofparameters, and an Ethernet interface for networkconnectivity. The individual blocks are describedbelow.

The sensor unit monitors temperature and atmo�spheric humidity with the help of LM35 semiconduc�tor temperature sensor and SY�HS�220 humiditymodule, respectively. The LM35 precision tempera�ture sensor produces calibrated and linear output inthe range of –55 to +150°C. Similarly the calibratedhumidity module SY�HS�220 minimizes the systemcomplexity by reducing component count.

APPLICATION OF COMPUTERSIN EXPERIMENTS

Embedded Web Server for Monitoring Environmental Parameters1

S. B. Chavana, P. A. Kadamb, and S. R. Sawantb

a Department of Electronics Technology, Shivaji University, Kolhapur, Maharashtra, 416004 Indiab Department of Electronics, Shivaji University, Kolhapur, Maharashtra, 416004 India

e�mail: [email protected] December 18, 2008; in final form, April 27, 2009

Abstract—In this communication a design of embedded web server based on the Ethernet technology forremote monitoring of weather parameters is presented. This web server monitors parameters viz. temperatureand humidity and transmits this information in the form of HTML web�page. The input sensors LM35 semi�conductor temperature sensor and SY�HS�220 humidity module have been employed, providing accuracyabout 1° centigrade and 2% relative humidity. The web server provides simultaneous access to multiple nodeson the network.

PACS numbers: 84.40.X6

DOI: 10.1134/S0020441209060050

Page 2: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 52 No. 6 2009

EMBEDDED WEB SERVER FOR MONITORING ENVIRONMENTAL PARAMETERS 785

Temp.sensor

Humiditysensor with

on�board signalconditioning

+5 Vpowersupply

LCD

Signalcondi�tioner

ADC Micro�controller

NIC(Ethernetcontroller) Network

Fig. 1. Basic block diagram.

The internally compensated op�amp LM358 withlow input offset voltage is used for temperature signalconditioning. The humidity sensor module does notrequire separate signal conditioning circuitry.

The A/D converter used in this system is an 8�bit,multi�channel, microprocessor compatibleADC0809. The system has been designed to monitorthe temperature range of 0–50°C with the resolutionof 0.5°C and the humidity range of 30–90% RH with5% RH resolution. This reflects that 0 the 8�bit reso�lution is sufficient for the system.

Philips P89V51RD2BN microcontroller is useddue to its larger RAM and Flash�ROM capacity of1 and 64 kB, respectively, which is adequate forsmall applications. It facilitates rapid applicationdevelopment with the on�chip In�System Program�ming facility.

The Ethernet module used in the system isREALTEK’S RTL8019. It supports full duplex Ether�net functionality and is compatible with the µIP, afreeware TCP/IP stack.

The system uses 16 × 2 LCD module for local real�time display. The module has on�board display con�troller which relieves the main microcontroller frommanually generating dot�matrix character display. Thedetailed schematic diagram of the system is shown inFig. 2.

3. SOFTWARE DESCRIPTION

Figure 3 shows the flow�chart of the system soft�ware. The system software is mainly composed of aTCP/IP stack, a BSP (Board Support Package) and

application software. The programmed behavior of thesystem is as follows.

When the system is powered�up the initializationpart of the system software configures various on�chipperipherals such as timers, interrupts etc. It also ini�tializes the external interfaces viz. Ethernet, LCD,ADC, etc. Once the system hardware is initialized, thesystem loads the TCP/IP stack and enables the net�work communication via Ethernet. The HTTP serverapplication is started and the web server can now bereached from the remote node. At this point the sys�tem keeps polling for the HTTP request.

When the HTTP request arrives from any of theremote hosts, the Embedded Web Server responds itwith the acknowledgement, and checks for theauthentication. The requests with proper authentica�tion are accepted by the Embedded Web Server, inresponse of which it reads the ambient parameters,embed them in the preformatted web�page and sendsthe HTML web�page to the requestor node.

In addition to this main functionality, a timerdriven ISR runs separately in the background to readambient parameters and refresh the local LCD display.

Some of the major software routines are describedbelow.

3.1. HTTP.C

This file consists of routines which enables server tolisten request, to respond and process the request, toformat the web page and to send the web page to thenode which made the request.

Page 3: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically

786

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 52 No. 6 2009

CHAVAN et al.

0.1 µ

F

100 µ

F

100 µ

F

0.1 µ

F

D1 D2

GNDGND

GND

GND

GND

33 pF

33 pF1

211.0572 MHz

+5 V +5 V

IC1

IC2

IC4

IC5A

GND

IN OUT

10 k

10 k

10 k

From temp.sensor

From humidity sensor moduleSY�HS�220 0.1 µF

GND

CLK

START

VREF+VREF–

ALE

IN0IN1IN2IN3IN4IN5IN6IN7

D0D1D2D3D4D5D6D7

OE

EOK

A0A1A2

10

6

1216

22

262728

12345

7

252423

9

171415818192021

XTAL1

XTAL2

VCCGND

EARST

P10�T2P11�T2ExP12P13P14P15P16P17

P30�RXDP31�TXDP32�INT0P33�INT1P34�T0P35�T1

P27�A15P26�A14P25�A13P24�A12P23�A11P22�A10

P21�A9P20�A8

P07�AD7P06�AD6P05�AD5P04�AD4P03�AD3P02�AD2P01�AD1P00�AD0

ALE

PSEN

P37�RD

P36�WR

19

18

4020

319

12345678

101112131415

2827262524232221

3233343536373839

30

29

17

16

12345

6789

DB9 connector

0.1 µ

F

0.1 µ

F

0.1 µ

F

GND

С1+

С1–

С2+

С2–

T1IN

R1OUT

EN\

FORCEOFF\FORCEON

V+

V–

T1OUT

R1IN

INVALID\

2

4

5

6

11

9

1

1612

3

7

13

8

10

LCD.6LCD.14LCD.13LCD.12LCD.11

RTL8019_IORB

RTL8019_IOWB

RTL8019_RSTDRV

RTL8019_SA4

RTL8019_SA3RTL8019_SA2RTL8019_SA1RTL8019_SA0

RTL8019_SD7RTL8019_SD6RTL8019_SD5RTL8019_SD4RTL8019_SD3RTL8019_SD2RTL8019_SD1RTL8019_SD0

10 µ

F

IC3

3

2

Fig. 2. Schematic of system. (IC1) ADC0808D, (IC2) P89c51RD2BN, (IC3) IC7805, (IC4) MAX3221EAE, (IC5) LM358D,(D1) U57X32, (D2) 1N007.

START

Intialize the system

Is request received?

Yes

Yes

Yes

No

No

No

Authentication granted?

Read parameters via ADC

FORMAT HTML PAGE

Whether ACK received?

Fig. 3. Flow chart.

Page 4: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically

INSTRUMENTS AND EXPERIMENTAL TECHNIQUES Vol. 52 No. 6 2009

EMBEDDED WEB SERVER FOR MONITORING ENVIRONMENTAL PARAMETERS 787

3.2. TCP_IP.C

This file consists of routines to initialize the TCPprotocol layer of stack, to process the TCP packets.The subroutines provided allow the microcontroller toinitialize various parameters of the TCP/IP protocol,establish TCP connection with remote IP and portnumber, check for the timeout of the connection,indicate the arrival of TCP packets, and receive orsend the data over the active connection, process theIP packets, and perform checksum.

3.3. Ethernet

This is a driver for Ethernet controller chip whichmaintains communication between node and the net�work. It provides the routines to transmit IP frameonto the network or vice versa.

3.4. HumConversion() and TempConversion()

These routines read the environmental data withthe help of ADC and send it onto the network byembedding into the web page.

4. OBSERVATIONS

The data of temperature recorded using the“Embedded Web server” is represented graphically in

Fig. 4, which shows close agreement between temper�ature parameter monitored by the Embedded WebServer and the one recorded on the calibrated ther�mometer.

Figure 5 gives variation of humidity as a function oftime recorded using the Embedded Web Server systemand using calibrated hygrometer.

From the graphs of Humidity and temperature it isclear that there is very close agreement between thedata collected by our system and that measured byalready available and calibrated systems which vali�dates the measurements made by our system.

REFERENCES

1. Can Filibeli, M., Oznur, Ozkasap, and Reha, M.,J. Network Comput. Appl., 2007, vol. 30, no. 2, p. 499.

2. Elkeelanyv, O. and Chaudhry, G., Microprocessorrs andMicrosystems, 2004, vol. 28, no. 7, p. 387.

3. Bathelt, M., Gall, U., Hindel, B., and Kurzke, Ch.,Comput. Networks ISDN Systems, 1997, vol. 29, nos. 8–11, p. 1065.

4. Takayuki Fujita and Kazusuke Maenaka, Sensors Actu�ators: A Physical, 2002, vols. 97–98, p. 527.

5. Magrabi, F., Lovell, N.H., and Celler, B.G., Int.J. Medical Inform., 1999, vol. 54, no. 2, p. 145.

40

35

30

25

201 3 5 7 9 11 13 15 17 19 21 23 25

Temp on calibrated therm orneter

Temp shown by project

Fig. 4. Temperature observations.

70

301 3 5 7 9 11 13 15 17 19 21 23 25

60

50

40

Calibrated hygrometer hum idity

Hum shown by project

Fig. 5. Humidity observations.

Page 5: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 6: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 7: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 8: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 9: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 10: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 11: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 12: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 13: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 14: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 15: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 16: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 17: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 18: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 19: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 20: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 21: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 22: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 23: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically
Page 24: Embedded Web Server for Monitoring Environmental Parametersshodhganga.inflibnet.ac.in/bitstream/10603/4027/14/14... · 2015. 12. 4. · “Embedded Web server” is represented graphically