mcs-51 microcontroller based industrial automation and ... · mcs-51 microcontroller based...
TRANSCRIPT
International Conference on Communication and Signal Processing, April 3-5, 2014, India
MCS-51 Microcontroller Based Industrial Automation and Control System using
CAN protocol
A.Devi, G. Gnanavel, G. Antoni gracy
Abstract-When we consider an industry of large area the
monitoring, controlling of each section involved in the industry is
a big task. It involves a large amount of man power and time
consumption. To overcome these above factors we developed this
technology to make single person for monitoring and controlling
the entire network. This can be achieved based on multiprocessor
communication by the combination of a wired technology i.e.
controller area network (CAN) bus network, and the MCS-51
microcontroller which are the main objectives of our paper. The
MCS-51 and the CAN protocol are cost effective, and the CAN
protocol is used in various applications like industries,
automobiles and home. The software part is done in Keil IDE
and Jet Flasher. Hardware is implemented and software porting
is done.
Index Terms- CAN, GSM, Temperature control, Gas leakage
control, MCS-5J microcontroller
I. INTRODUCTION
Now a day automation field gets a wide growth in the world wide. So every process control industries, different parameters need to be monitored and controlled simultaneously. Hence there is a need for implementation of separate circuits to measure these different parameters. But it is very difficult to implement such circuits of high complexity. Hence a need arises to reduce this complexity. This led to the use of multichannel process monitoring in a single window. So in order to achieve this, CAN (Controller Area Network) protocol can be chosen. CAN is a vehicle bus standard designed to allow microcontrollers and devices to communicate with each other within a vehicle without a host computer.
A. Devi is pursuing M.E. Embedded System Technologies, Department of EEE, VRS College of Engineering and Technology, Villupuram, India (email[email protected])
G. Gnanavel is working as Assistant professor, Department of EEE, VRS College of Engineering and Technology, Villupuram, India (email[email protected])
G. Antoni gracy is pursuing M.E. Embedded System Technologies, Department of EEE, VRS College of Engineering and Technology, Villupuram, India ([email protected])
978-1-4799-3358-7114/$31.00 ©20l4 IEEE
061
CAN bus is a message-based protocol, designed specifically for automotive applications. But now also used in other areas such as industrial automation and medical equipment. CAN bus was originally invented in 1983 by Robert Bosch GmbH. Previously, sensor networks consist of small nwnber of sensor nodes that were wired to a central processing station. However, now a days, the focus is more on wireless, distributed, sensing nodes. A typical smart system is made up of both digital and analog components, which allow the sensor data to be captured, transformed, analyzed, and transmitted to other modules in the system. But by applying the CAN protocol to a smart network is a natural progression from existing networks. It will prove itself efficient and economic media for communication.
The CAN bus provides an ideal platform for interconnecting modules and allows each module to communicate with any other module. A networked system which requires fast and robust communication and where data should maintain high integrity, CAN can be used. The CAN protocol is robust and uses sophisticated error checking and handling, which allows errors and failures to occur without shutting the entire system down which is useful in the motor control node.
The objective of this paper is to design a low cost industrial automation and control system based on multiprocessor communication using CAN protocol.
The rest of the paper is organized as follows: working principle of proposed system design is given in section II, detailed view of hardware components is given in section III, monitoring and controlling system design is given in section IV, experimental and simulation results are given in section V, conclusion and future enhancement are discussed in sections VI and VII.
II. PROPOSED SYSTEM DESIGN
The block diagram of proposed system is shown in Fig.l. Three slave modules and one master module along with one special slave are present.
+-IEEE Advancing Technology
for Humanity
FA.I.� (I emp control)
DC motor (Gas/fire control)
MCS-51
Special slave
Buzzer
MCS-51 Slave 2
CAN-H
CA.I.�-L
Fig. 1 Block diagram of proposed system using CAN protocol
Always master only initiates the communication. Whenever the master asks for the temperature, the slave 1 measures temperature level value of the boiler and senses the those values to the master module via CAN protocol after converting values into digital values via AID converter. Similarly the slave 2 is used to measure the smoke/gas level of the boiler and senses those values to the master module after converting those valves into digital values. The master module displays both temperature and gas/smoke values on the LCD.
If the temperature level of the boiler is higher than a threshold value, the cooling fan is automatically turned ON and the relay is made to tum off the boiler, and simultaneously the message will be sent to a higher authority or supervisor regarding the abnormal situation via GSM (global system for mobile communication). If the temperature value is lower than the threshold value, the relay is turned to ON in order to heat the boiler. Similarly if smoke/gas level of the boiler is higher than the threshold value, the buzzer is turned ON to indicate the abnormal condition and DC motors connected to window opening mechanism are rotated for fIre and gas leakage control.
III. HARDWARE DESIGN
Totally fIve MCS-Sl are present among which slave 1 and 2 are parameter processing modules, slave 3 is relay module and slave 4 is a special module for sending message to higher authority person or supervisor. These parameter processing
062
modules, relay modules and special module are connected to the master module which controlling all the modules.
A. MCS 51 Microcontroller module
In this system we use low-power, high-performance MCS-Sl microcontroller with 8KB of ISP flash memory. The MCS-Sl is an 8 bit microcontroller and uses nonvolatile memory technology. The 80S1 is designed as a strict Harvard architecture that has the advantage of making such systems immune to most forms of mal ware. On-chip flash allows the program memory to be reprogrammed in-system or by a conventional nonvolatile memory programmer.
The signals from the sensors are given to the microcontroller. The microcontroller also checks the output of the sensor and compares with set values and gives corresponding output to the master via CAN protocol.
Table 1 Features of MCS-51
FEATURE MCS-Sl
RAM (bytes) 128
ROM 4K
Timers 2
Serial port 1
110 ports 40
Interrupt sources 6
B. Temperature sensor LM-35
The LM35 is an integrated circuit sensor that can be used to measure temperature with an electrical output proportional to the temperature (in QC). The sensor circuitry is sealed and not subject to oxidation. The LM35 may not require that the output voltage be amplified. It has an output voltage that is proportional to the Celsius temperature. The important characteristic of the LM35 is that it draws only 60 micro amps from its supply and possesses a low self-heating capability.
TIT vcj/' ! �Gnd
Vout
Fig. 2 LM35
C. LPG Gas sensor-MQ-6
Gas sensor used here is MQ-6 which has high sensitivity to Propane, Butane and LPG, and also response to Natural gas. Sensitive material of MQ-6 gas sensor is Sn02, which with lower conductivity in clean air. If V+ >V- , then the output voltage is high and the LED connected to the output is ON. If V+ < V- , then the output voltage is low and LED is OFF. Gas sensor is shown in Fig.3.
Fig.4 Gas sensor
D. LM7805
The operating voltage range of MCS 51 is 5V. So LM7805 which is a +5.0V lA voltage regulator, is used. It is a linear voltage regulator that produces a relatively constant output voltage of +5V DC. The LM7805 is shown in Fig.4.
063
230 V AC IN
E. Cooling fan Fig.4 LM7805 circuit
Ie 1 7805
2 C2 C3
3
0.01uF 0.01 uF Cer Cer
If the received sensor (temperature or smoke/gas) data is higher than the predefined limit, the cooling fan will start rotating continuously. Fan speeds may be controlled manually (a simple potentiometer control, for example), thermally, or by the computer hardware or by software. It is also possible to run many 12V fans from the 5 V supply, at the expense of airflow, but with reduced noise levels.
F. Buzzer
If the DC motors start rotate continuously, the buzzer will turn on to indicate the abnormal condition. As the concentration of gas decreases the sensor output decreases and when it becomes less than the limit the motors will stop automatically.
G. Liquid crystal display
Liquid Crystal Displays (LCDs) are used for displaying current temperature, smoke and gas level of the boiler. A simple 8-bit 16x4 LCD is used to interface with the MCS-51. This means there are 16 characters per line by 4 lines. There are three control signals Register select, Enable and Read/Write. There are two important registers in LCD. Command Code register and Data register. If an 8-bit data bus is used, the LCD will require a total of 11 data lines (3 control lines plus the 8 lines for the data bus).
When RS is low (0), the data is to be treated as a command or a special instructions (such as clear screen, position cursor, etc). When RS is high (1), the data being sent is text data which should be displayed on the screen. RlW input allows the user to write information to LCD or read information from it.
When R W line is low (0), the information on the data bus is being written to the LCD. When RlW is high (1), the program is registers effectively querying (or reading) the LCD. The enable Pin is used by the LCD to latch information at its data pins. When data is supplied to data pins, a high to low pulse must be applied to this pin in order for the LCD to latch the data present in the data pins. We have to prepare an LCD properly before the character we need, has to be displayed. For this a number of commands have to be provided to the LCD.
Two ports (PORT 0 and PORT 2) of the MCS-Sl are taken. PORT 2 is used for providing control signals and PORT 0 IS
used for providing data signals.
IV. DESIGN OF MONITORING AND CONTROLLING SYSTEM
A. At the master side
The CAN 2.0B is a network protocol that was specially developed for connecting the sensors and actuators. CAN 2.0B supports data rates from Skbps to 1 Mbps, which allows the CAN network to be used to share status information and real time control. It can transfer up to 8 data bytes within a single message. Values are transferred to microcontrollers from ADC via CAN Protocol at an interval of 10 seconds and is displayed in the LCD. The flowchart for CAN based monitoring in master side is shown in Fig. S.
:>-----i Inform liDe failure to the supervisor via GSM
Seod request to slave for sensor data
Wait for reply [rom slave for IOms
Inform abnormal situtaioD to supervisor
Fig 5. Flow chart for CAN Based monitoring in master side
064
B. At the special slave side
",,'ait for initializtioD from master
NO
Receive information from tbe master
Se,od inJormatioD to mobile number via GSM
Fig 6. Flow chart for interrupts in special slave
C. At the slave side
Start
Wait selection address data from ID.a.ster
Wait for sensor initiaJiztion from DI3II,ster
After initializtioD send sensor data to ma,ster
'Vait for control data from ma,ster for IOms
NO
Work according to control data
Fig 7. Flow chart for parameter processing in slave side
V. EXPRIMENT AL AND SIMULA nON RESULTS
Entire automation and control system is divided into two stages. First stage is the industrial parameter processing stage i.e. slave 1 and 2. Second stage is the automation and control stage i.e. master. Fig. 8 is the overall hardware setup of industrial automation and controlling system. In the first stage, temperature sensor and gas sensor are connected to microcontrollers. The LCD is connected to port 0 of the microcontroller in the master order to display the instantaneous values of parameters. Control signals for LCD are obtained from PORT 2. The master is interfaced with special slave for interrupt purpose.
= :: �'It .... . . ...... . . � .. ......
" "" �UII' -II
Fig 9. Simulated output of temperature sensor circuit
065
The fig.9 shows simulated output of one of the processing stage i.e. temperature sensor circuit, using proteus schematic software.
VI. CONCLUSION
This paper is concerned about implementation of low cost system for monitoring parameters of an industrial boiler based on multiprocessor communication. The monitoring parameters are temperature and gas level of the boiler. Transmission of process information from plant to control room is made in fail safe and efficient manner by CAN serial communication protocol. Instantaneous values of process parameter are showed in LCD. Normal and abnormal conditions are viewed in the LCD. Control elements are activated and deactivated as per the program logic.
VII. FUTURE ENHANCEMENT
This project in future can be enhanced for
1. This can be expanded to a multi master multi slave network which will enhance the capabilities of the system to a great extent.
2. Remote sensing of the parameters can be made if they are loaded on to the server.
3. Initially we provide analysis assuming no errors on the CAN bus. This analysis is then extended, to account for errors on the bus.
[II
[21
[31
[41
[51
[61
[71
[81
REFERENCES
Presi.T.P, "P IC Microcontroller Based Vehicle Monitoring System Using Controller Area Network (CAN) Protocol",IEEE international conference 2012. Kumar, M. A.Verma, and A Srividya, Response-Time "Modeling of Controller Area Network (CAN). Distributed Computing and Networking, Lecture Notes in Computer Science Volume 5408, p63-174,2009. Tindell, K., A Burns, and AJ. Wellings, "Calculating controller area network (CAN) message response times", Control engineering Practice, 3(8): p. 1163-1169,2005 . Wilfried Voss, comprehensive guide to controller area network, Copperhill Media Corporation, 2005-2008. John Rinaldi and Vince Leslie, 'The Fast Guide to Controller Area Network (CAN) Application Layers", Real Time Automation, pp. 1-8, December 2003. Dogan Ibrahim, "Microcontroller based temperature monitoring and control", ISBN: 0750655569, Elsevier Science & Technology Books, October 2002. National Semiconductor, "LM35 Precision Centigrade Temperature sensors Data sheet", National Semiconductor Corporation, November 2000. Pazul, "Controller Area Network (CAN) Basics", Microchip technology Inc., AN713, May 1999.