Implementation of TCP/IP on Embedded Webserver Using Raspberry PI In Industrial Application

Specilization in Project    
Implementation of TCP/IP on Embedded Webserver Using Raspberry PI In Industrial Application


An embedded system is a computer system designed for specific control functions within a larger system, often with real-time computing constraints .But when networking technology is combined with it, the scope of embedded systems would be further more. Here design and implementation of embedded web server is presented. That can be used for Electrical Equipment monitoring system. In h/w design Raspberry pi from Xbee is used. Sensors are interfaced with microcontroller. Parameters like temperature, gas are measured and transmitted to PC through serial protocol SPI. The received values in PC are uploaded in internet by Ethernet cable. So by typing IP address in web browser, client can monitor all devices in industry from any remote places via its own local browser. Ethernet communication is depicted and data flow is analysed last.


The arrival of internet reduced the whole world communication boundary to that of a single village. After the "everybody in internet wave" now obliviously follows the "everything in the internet wave". When the embedded devices are provided with internet access, it is of no doubt that demand will rise due to the remote accessing capability of the devices. The paper includes complete implementation of an HTTP Web Server in Raspberry Pi. This development kit which contains Ethernet interface is connected to PC using RJ45 cable. Sensors are connected to 89C51 Microcontroller. Temperature, Gas, Humidity, pressure, motion, and speed are must often measure parameters. Some electronic circuits, chemical reactions, biological processes perform best with in limited temperature and also necessary to measure gas in environment. These parameters are mostly used in power plants, chemical industry, hospital, medicine Production Company. In this paper embedded systems and Internet technology are combined to form a new technology -the Embedded Internet Technology, which developed with the popularization of computer network technology in recent years. The heart of communication is TCP/IP protocol. Network Communication is performed by the IEEE 802.3 Ethernet standard. It is the most modern technology of embedded systems. Since ARM embedded web server based on Raspberry Pi has fast execution capability and Ethernet standard can provide internet access with reasonable speed, this system is suitable for enhancing security in industrial conditions by remotely monitoring various industrial applications.

Embedded Webserver

The implementation of embedded Internet technology is achieved by means of the embedded web server. It runs on embedded system with limiting computing resources to serve web documents including static and dynamic information about embedded system to web browser. We can connect any electronic device/equipment to web server and can obtain the real-time status information and control remote equipment without time and space restriction through web page released by embedded web server. Embedded server is a single chip implementation of the Ethernet networking standard. It consists of two primary elements communicating with each other: i) a server consisting of an ARM processor with an Ethernet controller and ii) a client computer which is connected to controller through this RJ45 interface. The client computer sends/receives data to/from the arm microcontroller using TCP packets. The client has to enter IP address to access this server. This request is taken by the operating system of the client and given to the LAN controller of the client system. The LAN controller sends the request to the router that processes and checks for the system connected to the network with the particular IP address. If the IP address entered is correct and matches to that of the server, a request is sent to the LAN controller of the server and a session is established and a TCP/IP connection is establishes and the server starts sending the web pages to the client through which we can remotely monitor and control the sensor and device status respectively.

System Description

The architecture of Industrial monitoring system consists of three modules as follows. Sensor module consists of 89C51 microcontroller and XBee. Server node consists of Raspberry Pi with inbuilt Ethernet Controller and Xbee. Thirdly, GUI (graphical user interface) on PC where is parameter of industrial plant is monitored. Fig 2&3 below shows the overall Block Diagram of a sensor module & server module browser and logged in he/she will get web page that contains all parameters like temperature and gas.

System Design

The designing part includes basically two sections as follows. ? Hardware design ? Software design A. Hardware Design It includes Raspberry Pi, Temperature sensor ,gas sensor, microcontroller and Xbee connector. B. Raspberry Pi Fig. 4 shows Raspberry Pi development kit. The Raspberry Pi is a credit-card-sized single-board computer developed in the UK by the Raspberry Pi Foundation. It has a Broadcom BCM2835 system on a chip (SoC),which includes an ARM1176JZF-S 700 MHz processor, Video Core IV GPU. Its GPU provides Open GL ES 2.0, hardware-accelerated Open VG, and 1080p30 H.264 highprofile decode which is capable of 1Gpixel/s, 1.5Gtexel/s or 24GFLOPs with texture filtering with 512 MB RAM. It does not include a built-in hard disk or solid-state drive, but uses an SD card for booting and persistent storage. It has 10/100 Base T Ethernet socket. C. Temperature Sensor - AD590 The AD590 is a 2-terminal integrated circuit temperature transducer that produces an output current proportional to absolute temperature. For supply voltages between 4 V and 30 V, the device acts as a high impedance, constant current regulator passing 1 µA/K. Laser trimming of the chips thin-film resistors is used to calibrate the device to 298.2 µA output at 298.2 K (25°C).It should be used in any temperature-sensing application which is below150°C.

D. Gas Sensor - MQ2 MQ-2 is a Carbon Monoxide (CO) sensor, suitable for sensing Carbon Monoxide concentrations (PPM) in the air. The MQ-2 sensor can measure CO concentrations ranging from 20 to 2000ppm.This sensor has a high sensitivity and fast response time. The sensors output is an Analog resistance. The drive circuit is very simple , just a voltage divider; all you need to do is power the heater coil with 5V DC or AC , add a load resistance, and connect the output to an ADC or a simple OPAMP comparator. They are used in gas detecting equipment for carbon monoxide (CO) in family and industry or car. E. Microcontroller-89C51 The P89C51 device contains a non-volatile 16kB/32kB/64kB Flash program memory that is both parallel programmable and serial In-System and InApplication Programmable. In-System Programming (ISP) allows the user to download new code while the microcontroller sits in the application. In-Application Programming (IAP) means that the microcontroller fetches new program code and reprograms itself while in the system. This device executes one machine cycle in 6 clock cycles, hence providing twice the speed of a conventional 80C51. This device is a Single-Chip 8-Bit Microcontroller manufactured in advanced CMOS process and is a derivative of the 80C51 microcontroller family. The instruction set is 100% compatible with the 80C51 instruction set. The device also has four 8-bit I/O ports, three 16-bit timer/event counters, a multi-source, four -priority-level, nested interrupt structure, an enhanced UART and on-chip oscillator and timing circuits.

F. XBee The XBee/XBee-PRO ZNet 2.5 OEM (formerly known as Series 2 and Series 2 PRO) RF Modules were engineered to operate within the Zigbee protocol and support the unique needs of low-cost, low-power wireless sensor networks. The modules require minimal power and provide reliable delivery of data between remote devices. B. Software Design G. Raspbian OS Raspbian is an unofficial port of Debian Wheezy arm hf with compilation settings adjusted to produce code that uses "hardware floating point", the "hard float" ABI and will run on the Raspberry Pi. The port is necessary because the official Debian Wheezy arm hf release is compatible only with versions of the ARM architecture later than the one used on the Raspberry Pi (ARMv7-A CPUs and higher vs the Raspberry Pis ARMv6 CPU). H. Ride RIDE is a fully featured Integrated Development Environment that provides seamless integration and easy access to all development tools. From editing to compiling, linking, debugging and back to the start, with a Simulator, ICE, Rom Monitor or other debugging tool, RIDE conveniently manages all aspects of the Embedded Systems development with a single user interface.

TCP/IP PROTOCOL The software running on the embedded web server follows the same layered structure as used in the TCP/IP protocol suite. The TCP/IP protocol suite allows computers of all sizes, running different operating systems, to communicate with each other. The TCP/IP protocol suite is a combination of different protocols at various layers as shown in Fig. Fig.5. Layers of TCP/IP protocol suit Every layer acts independently from each other. The Link Layer normally includes the device driver in the operating system and the corresponding network interface (card) in the computer. An Ethernet controller driver controls the Ethernet interface. The network layer controls the communication between hosts on the Ethernet. The Address Resolution Protocol (ARP) at network layer translates IP addresses to Ethernet MAC addresses. Internet Protocol (IP) delivers packets to Transmission Control Protocol (TCP), UDP, and Internet Control Message Protocol (ICMP), the ICMP answers to PING requests. TCP/UDP delivers data to the applications. HTTP runs on the top of TCP/IP protocol. It is set of the rules for transferring files like text, image, sound and other multimedia file on the World Wide Web. When Web. The applications can communicate with the transport layer through buffers with data and variables with control information. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. When you are set up with direct access to the Internet, your computer is provided with a copy of the TCP/IP program. SOFTWARE LEVEL COMPILATION The firmware development for the system operation is done in Embedded C language in RIDE software we have to create code for four modules. First is ADC module that code can convert sensor data into digital data. Second is UART module in which data can be transferred to pc via serial protocol. Third is LCD module, which shows values. Third module compilation is done in RIDE software as shown in Fig.6. Fourth module is to transfer data into website. Fourth module compilation is done in Raspbian compiler. It is also used to design website as shown in Fig.10. These modules coding is dumped into Raspberry development kit by using Putty. There are many different technologies to achieve dynamic Web page, commonly used with CGI, ASP, PHP, and JSP and so on. The CGI is implemented on web server which provides interface between webserver and program that generate the web content this server technology can be made to interact between the browser and server.


The individual testing of different modules are developed and the final setup was made arranging all devices in proper manner. After this final arrangement the whole system was tested.The temperature sensor is the transducer that reads temperature of the particular environment, which we want to measure and converts the temperature into corresponding electrical signal. This analog signal is amplified by signal conditioning circuit and then the analog value is converted into digital by means of analog to digital converter in order to read microcontroller. Microcontroller is programmed to read this digital value corresponding to temperature and gas it is stored in the microcontroller. Data can be displayed in LCD by programming the microcontroller. In microcontroller, the feedback signal is converted to the analog value when set point is done, microcontroller reads the value and displays in LCD. The final arrangement was made and the system was run, the data from XBEE received by RPI which is acting as server. Now when a remote computer requests for this data to the server it serves the data through a webpage The protocol used for the communication between webserver and web browser is Hyper Text Transfer Protocol or HTTP protocol. This protocol defines all the basic frame work of web communications by handling requests and also by providing control information to be transferred between browser and server. To obtain a web document, the browser and server should establish a connection at Port 80. The HTML web page displayed when the configured IP address entered on the web browser is shown. Here the first data gives information about the temperature sensed in the remote location. The second data displays the concentration of CO in the location of monitoring.


Implementation of web server using Raspberry Pi for intelligent monitoring is a new method to monitor an environment which designed here for the real time implementation. The system can also communicate with PC through RS-232 Serial Port. It supports online supervision and control not only within Private Network (LAN) but also in Public Network (Internet).The whole system has low-cost, good openness and portability, and is easy to maintain and upgrade. It is possible to interface different kind of Sensors with these modules and make various applications. So it can monitor embedded system operation state through Internet, achieving network monitoring purposes. This work can further be extended with usage of high end embedded servers along with wireless sensor networks with increase in parameters and increase in sensor nodes.