You are on page 1of 8

International Journal of Electronic Engineering Research

ISSN 0975 - 6450 Volume 2 Number 1 (2010) pp. 111–118


© Research India Publications
http://www.ripublication.com/ijeer.htm

Pressure Measurement and CAN Bus


Implementation for Data Transmission

Milind S. Patil1§, Ameer C. Shaikh1, Shailendra S. Bidkar1 and R.R. Mudholkar2


1
ASM System, Kolhapur - 416001, Maharashtra, India
2
Department of Electronics, Shivaji University, Kolhapur - 416001,
Maharashtra, India
§
E-mail: micromilind1@rediffmail.com

Abstract

The paper presents a method of real time measurement and transmission of


pressure condition in industrial machine. In model system two PIC controllers
are employed as two different nodes, first node measures the physical
parameter, then transmits digital packets on CAN bus and another node
receives. Sensor basically measures pressure in the analog domain and PIC
controller built-in 10 bit ADC converts the analog data from sensor into digital
number. This is processed and encoded by the same controller and sent the
digital code to another PIC controller through a coaxial cable. The receiving
controller can be used for analysis, display and or control purpose.
Transmission and reception of data is performed by a pair of CAN
transceivers. PIC controller supports CAN transceiver. The data transmission
and reception is studied in different noise levels. The results show that the data
transmission remains reliable due to CAN bus even in the presence of noise.
The research intends to develop a data transmission system in the textile
industries.

Key-Words: Pressure, CAN protocol, PIC controller.

Introduction
There are many good reasons to use CAN data bus technology in textile industries,
chemical industries, green house etc. A most important reason is noisy environment
and long distances between the main control unit and sensor unit. This long distance
means long, expensive and unreliable cables. There are two different ways to solve
these problems. The control system can be distributed to suitable parts, which are
112 Milind S. Patil et al

connected together via a data bus. Another way is to use components, which can be
connected to control system via a data bus.
The Controller Area Network (CAN) is a high-integrity serial data communication
bus for real-time applications for networking "intelligent" devices as well as sensors
within a system or sub-system, which operates at baud rates up to 1 Mbps. The CAN-
bus was originally developed by the German company Robert Bosch GmbH for use in
the car industry to provide a cost effective communication bus. In car electronics
CAN bus is as an alternative to expensive and cumbersome wiring looms in the mid
1980s. Nowadays CAN is being used in an increasing number of applications in the
automotive industry [10] and in many other industrial applications where noise is the
major problem.
Pressure sensors are used for control and monitoring in thousands of everyday
applications. Pressure sensors can also be used to indirectly measure other variables
such as fluid/gas flow, speed, water level, and altitude.
The MPX series piezoresistive transducer is a state-of-the-art monolithic silicon
pressure sensor designed for a wide range of applications, but particularly those
employing a microcontroller with A/D inputs. This patented, single element
transducer combines advanced micromachining techniques, thin-film metallization,
and bipolar processing to provide an accurate, high level analog output signal that is
proportional to the applied pressure. This is employed in the system as a pressure
transducer.

Block Diagram
The complete block diagram of measurement and data communication scheme is
shown in Fig. 1.
CAN LOW

120E 120E

CAN HIGH

CAN CAN
TRANSCEIVER TRANSCEIVER

PIC PIC
CONTROLLER CONTROLLER

DISPLAY
SENSOR
UNIT

Figure 1: System Block Diagram.


Pressure Measurement and CAN Bus Implementation 113

The pressure is measured using Keller’s pressure Transmitter Series 21MC [3].
The two-wire current output for 10 bar is selected. The output signal from pressure is
analog current. It gives output 4 to 20 mA current.
The analog current output of pressure transmitter is converted into analog voltage
that is processed in digital domain. The PIC18F2480 microcontroller [2] with built in
10 bit successive approximation ADC module suits this purpose, as the conversion
time is adequate to measure pressure. The digital data equivalent of measured
pressure is transmitted through CAN bus system to a remote processor. This
controller in turn converts the received digital data into the corresponding pressure
value and displays it on an LCD display.

The Hardware
The detail structure of hardware is shown in Fig. 2.

Figure 2: System Hardware.

Pressure Transmitter Series 21MC


These piezoresistive silicon pressure transmitters are produced on the new KELLER
[3] automatic brazing lines. This new technology allows the crevice-free construction
of the pressure port without using seals or O-rings. In the brass sensor line (Series 21
MC), a steel insert and a nickel diaphragm is brazed into brass housing.
114 Milind S. Patil et al

Microcontroller PIC18F2480
Microcontroller used in each node as an intelligent device. It is a programmable
device that’s why in first node microcontroller receives the analog signal from sensor
converts in digital form, and packets transmitted on CAN bus through CAN
transceiver. In this way another node receives the packets through CAN bus and
displays on Display unit. It can also be stored on memory and can be used for
controlling output like solenoid valve, motor etc. [4]. For this working flow
initialization, baud rate generation conversion of analog to digital signal, data packet
transmission, reception and lot of tasks are done in all the nodes. Microcontroller in
each node is PIC18F2480 from Microchip. Its features are as follows. The PIC
18F2480 is an enhanced flash microcontroller, with one CAN module. It operates on
Single Supply of 5V DC.

Controller Area Network (CAN)


The controller area network module is a serial interface useful for communicating
with other peripherals or micro-controller devices. This interface / protocol is
designed to allow communications with in noisy environments.
Presently there exist numerous hardware solutions for data transmission. As the
simplest and also inexpensive choice, a system based on field-bus was considered.
There are, however, many field-bus solutions available. One of the most popular and
very reliable is CAN bus [5]. The CAN bus is a serial communication bus linking
intelligent CAN controllers for Real-Time control applications. The CAN bus
standard (ISO 11898)[1] defines two lowest layers of ISO/OSI reference model: the
Physical Layer and the Data Link Layer. The MAC (Medium Access Control) sub-
layer (of the Data Link Layer) is the most important from message scheduling and
time analysis point of view. CAN bus uses deterministic mechanism for bus access
called CSMA/BC (Carrier Sense Multiple Access/Bitwise Connection). The
CSMA/BC prevents message collisions and ensures messages arbitration. The
arbitration is done with respect to the identifier field of every CAN message. CAN
2.0A standard uses an 11-bit identifier. From the application point of view CAN does
not define the meaning of data carried by CAN messages.
The PIC 18F2480 can support data rate up to 1Mbps. CAN is better for
communicating the signals in the automobiles, where the speed is at most important.
MCP2551 is the CAN transceiver IC [2] used for the bus interfacing purpose. On the
receiver side there is one more CAN transceiver MCP2551, which receives the signal
from the transmitter CAN transceiver. When the controller receives the message, then
the data will be displayed on a 16x2 LCD display supported by PIC controller.

The Software
The software has two parts: one for the transmitter side and another for the receiver
side.
Pressure Measurement and CAN Bus Implementation 115

Transmitter Side
The appropriate algorithm required for sensing the analog input from sensor,
converting it to digital equivalent data and then transmitting the same is shown in the
proceeding section.
In transmitter section, two main subroutines are used. One subroutine is to initialize
CAN as transmitter and the ADC module. The microcontroller software selects the rate of
transmission as 100 kbps. This is sufficient for this pressure measurement. The other
subroutine is to transmit the data using CAN through CAN transceiver MCP2551. In this
subroutine, before transmitting, the digital data is obtained from ADC module of the PIC
18F2480. Fig. 3 depicts the main transmitter flow chart.

Receiver Side
Firstly the 16 x 2 LCD is initialized. Before initializing LCD, it is necessary to
configure the appropriate port pins as output. It is done in the main program. Then the
command words are given to LCD, to clear the display and to place the cursor in the
home position, etc. The main program calls two subroutines, one for initializing CAN
module of PIC controller 18F2480, which acts as receiver. Here also the baud rate of
100 kbps is selected. The other subroutine is used to receive the transmitted data,
manipulate it in to the pressure value and then display it as pressure on the LCD. Fig.
4 depicts the main receiver flow chart.

S TART
S TART

Me m ory Initia liza tion


CAN Initia liza tion Memory Initialization
CAN Initialization

Initia lize ADC m odule


S e le ct the ADC cha nne l
LCD Initialization

If ADC NO
Conve rs ion Read the data through
Ove r ? CAN Bus

YES

Read the ADC output and Display the digital data


Transmit the Data on LCD

Figure 3: Main Transmitter. Figure 4: Main Receiver.


116 Milind S. Patil et al

Results
Pressure measurement
The technical specifications of pressure sensor are as follows-
Supply voltage for Series 21 MC is 12 V.
The sensitivity is +-0.04%/0c.
The current is converted into voltage using I to V convertor. The resistor of 25
ohm is connected in between output pin and ground.

Practical Observations
A set of readings with the designed unit is shown in Table 1.

Sr. Actual Current Measured Error


No. Pressure(Bar) (mA) Pressure(Bar)
1 1 4 1 0
2 1.25 4.95 1.2375 0.0125
3 1.5 6.1 1.525 -0.025
4 1.75 7.11 1.7775 -0.0275
5 2 8.09 2.0225 -0.0225
6 2.25 9.1 2.275 -0.025
7 2.5 10 2.5 0
8 2.75 11.1 2.775 -0.025
9 3 12.05 3.0125 -0.0125
10 3.25 13.1 3.275 -0.025
11 3.5 14.15 3.5375 -0.0375
12 3.75 15.05 3.7625 -0.0125
13 4 15.95 3.9875 0.0125
14 4.25 17 4.25 0
15 4.5 18.1 4.525 -0.025
16 4.75 19.1 4.775 -0.025
17 5 20 5 0

The error between actual and observed pressure under different noise levels by
system is computed and plotted, which are shown in Fig. 5-8.
Pressure Measurement and CAN Bus Implementation 117

Figure 5: Error for different samples at Figure 6: Error at noise level I for
normal conditions. different samples.

Figure 7: Error at noise level II for Figure 8: Error at noise level III for
different samples. different samples.

Conclusion
At normal conditions the error level is less compared to noisy environment (fig. 5).
For noise level-I the change in actual and measured readings is plotted as shown fig.
6. For noise level-II error is increased compared to normal conditions, which is shown
in fig. 7. As shown in fig. 8 the noise level is increased however error has remained
within acceptable limits. In this way CAN bus is operates fairly well in noisy
environment.
The real time problem to measure and transmit the pressure in different locations
in industry like textile and other can be solved by the solution discussed in the paper.
Pressure measurement is most important in applications such as chemical
industries, textile industries, leakage testing instrument, and so on. Keller’s Series 21
MC quite suitable and affordable for this task upto 10 bar. The output of sensor is
calibrated. The observed error is less than 1% in the measured value. It is within the
acceptable range for most of practical application. In most cases the measured sensor
data is required for distant receiver that is far from measuring unit. Besides noise
tolerance CAN bus offer advantages like high speed, low cost, easy to install.
118 Milind S. Patil et al

CAN Bus having numerous advantages, but it has also some restrictions. CAN
work reliably upto 1Mbps for the maximum possible bus length 40 meters.

References
[1] Robert Bosch GmbH. Control Area Network specification version 2, Sept.
1991.
[2] Microchip Technology Inc.
[3] www.keller-druck.com
[4] K. M. Zuberi and K. G. Shin, “Non-Preemptive Scheduling of messages on
Controller Area Network for Real-Time Control Applications”, Technical
Report, University of Michigan, 1995.
[5] J. Rufino and P. Veríssimo: “A Study on the Inaccessibility Characteristics of
the Controller Area Network”, 2nd International CAN Conference 95,
Oct.1995.
[6] H. Kopetz and G. Grünsteidl: “TTP - A Time-Triggered Protocol for Fault-
Tolerant Real-Time Systems”, Res.Report 12/92, Inst. f. Techn. Informatik,
Technical University of Vienna, 1992.
[7] M.A. Livani and J. Kaiser: “EDF Consensus on CANBus Access in Dynamic
Real-Time Systems”, Technical Report No. 97-17, University of Ulm, 1997.
[8] L.B. Fredriksson: “A CAN Kingdom (Rev. 3.01)”, Published by KVASER
AB, Box 4076, S-51104 Kinnahult, Sweden, 1996.
[9] CiA Draft Standard 301 version 3.0, “CANopen Communication Profile for
Industrial Systems”.
[10] Kim, K., et al. “Integrating subscription-based and connection-oriented
communications into the embedded CORBA for the CAN bus”, in Proc. of the
Sixth IEEE Real-Time Technology and Applications Symp.,Washington,
D.C., June 2000, p. 178-187.
[11] Kirrmann, H. & Zuber, P.A.,“The IEC/IEEE train communication network”,
IEEE Micro, vol. 21 #2, March-April 2001, pp. 81-92.

You might also like