WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE FINAL YEAR PROJECT REPORT BEng Honours Electronic & Communications Engineering University of Kent, Canterbury Department of Electronics Author: Odafe Ojenikoh Project Supervisor: Adam Jastrzebski March 2008
72
Embed
Wireless Tyre Pressure Monitoring System using Zigbee
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.
ABSTRACT ............................................................................................................................................................. I ACKNOWLEDGEMENTS ........................................................................................................................................ II TERMS AND ABREVIATIONS ................................................................................................................................III 1 INTRODUCTION ............................................................................................................................................ 1
1.1 AIM AND SCOPE .............................................................................................................................................. 1
3.2 ADDITIONAL FEATURES ................................................................................................................................... 12
4 DESIGN AND IMPLEMENTATION ................................................................................................................ 13 4.1 OVERVIEW ................................................................................................................................................... 13
4.2 ANATOMY OF ZIGBEE BASED WIRELESS TPMS .................................................................................................... 13
4.2.1 The Hardware ................................................................................................................................... 13 4.2.1.1 Microchip PICDEM Z Demonstration Kit ........................................................................................................ 13 4.2.1.2 Freescale Combined Temperature and Pressure Sensor ............................................................................... 14 4.2.1.3 Interfacing The Sensor Board With the Demo Board .................................................................................... 17
4.2.2.2.1 Sending Messages.................................................................................................................................... 23 4.2.2.2.2 Receiving Messages ................................................................................................................................. 24 4.2.2.2.3 The Control Unit ...................................................................................................................................... 25 4.2.2.2.4 The Tyre Unit ........................................................................................................................................... 26 4.2.2.2.5 Running the TPMS Application ................................................................................................................ 32
4.3.1 Understanding The Zigbee Stack Implementation ............................................................................ 35
4.3.2 Programming in C ............................................................................................................................. 36
5 TESTING AND RESULT VERIFICATION .......................................................................................................... 37 5.1 TESTING THE MPXY8020 SENSOR ................................................................................................................... 37
5.4 KNOWN ISSUES ............................................................................................................................................. 42
6.1.1 Tyre Identification Feature ............................................................................................................... 47
6.1.2 Additional System Operational Modes ............................................................................................. 47
6.2 FINAL CONCLUSIONS ...................................................................................................................................... 48
9.1 SCREEN CAPTURE OF TEST RESULTS ................................................................................................................... 52
9.3.2 Configuring the Application .............................................................................................................. 65
9.3.3 TPMS Application CD ........................................................................................................................ 66
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
i
ABSTRACT
This report gives an insight to a final year project involving developing a Tyre Pressure monitoring
system using Zigbee for its wireless communication protocol. Also, the report gives a brief overview of
Tyre pressure monitoring systems, its features and various types. It then goes further to examine the
Zigbee communication protocol and its features. Furthermore, the report gives detailed information
about the actual design, implementation and testing of a demonstrator system used to analyse the
feasibility of using Zigbee communication protocol in a Tyre Pressure Monitoring System. Also
highlighted in the report are additional features that can be implemented in a Tyre Pressure
Monitoring System as a result of Zigbee being used. It also contains analysis carried out focusing on the
power consumption of the System while Zigbee is being used and draws a conclusion as to the
suitability of using Zigbee in a wireless Tyre Pressure Monitoring System.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
ii
ACKNOWLEDGEMENTS
Firstly, I would like to thank my Supervisor, Adam Jastrzebski for providing the tools and helping me lay the
foundation upon which this project was based. Also, I would like to express my sincere gratitude to Dr Robert B.
Reese of the Department of Electrical and Computer Engineering at Mississippi State University whose extensive
research and implementation of the Zigbee stack helped in successfully completing the project. Furthermore, I
would like to thank the Support staff in the Digital Simulation Laboratory in the Electronics Department at the
University of Kent for their help with resolving technical issues during the course of the project.
Finally, I thank my parents Mr & Mrs J.O Omongagah for their constant financial and moral support during my
five years studying at the University of Kent.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
iii
TERMS AND ABREVIATIONS
APL Application layer of the Zigbee stack
APS Application support layer of the Zigbee stack
Coordinator The network coordinator, forms the network
FFD full function device
FSM Finite State Machine
HAL Hardware Abstraction Layer of the Zigbee stack
IDE Integrated Development Environment
IEEE Address 8-byte 802.15.4 network address of a node, also called the long address
MAC Medium access control layer of the Zigbee stack
MCU Microcontroller Unit
Network Address 2-byte network address of a node, also called the short address
NWK Network layer of the Zigbee stack
PAN personal area network
PAN ID personal area network identifier
PHY Physical layer of the Zigbee stack
RF Radio Frequency
RFD reduced function device
TPMS Tyre Pressure Monitoring System
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
1
1 INTRODUCTION
Tyre Pressure Monitoring Systems (TPMS) are electronic systems in motor vehicles to monitor the air
pressure inside its tyres. Several years ago, TPMS were installed as a factory default in high end vehicles
only. This was generally because extending the technology to mid-range-higher volume production
models will require that the systems be more cost effective. However, due to legislations and
improvements in technology, there are increasing number of low end vehicles fitted with TPMS and also
a significant increase in the availability of after-market systems.
TPMS are implemented using radio frequency (RF) technology to avoid expensive and rather
complicated rotating contact wiring. A typical TPMS comprises an electronic control unit fitted inside the
vehicle and battery powered sensors with transmitters within the tyre cavities of the vehicle. The
control unit provides the necessary processing functionality that interprets pressure data coming from
battery powered sensors and delivers alerts and warnings to the driver.
1.1 AIM AND SCOPE
Most TPMS systems that utilize RF technology use proprietary techniques in communicating between
sensors and their control unit and as such, there is little or no room for interoperability with units
supplied by other vendors. One of the reasons is the use of non-standards based communication
techniques. Also, most proprietary RF based systems only allow the sensors in the tire cavities transmit
data in a pre determined pattern. This means the control unit have little or no control as to when the
sensors send data. This creates the problem of an inefficient use of battery power as a result of the data
not being of interest to the control unit at the time it is being send. Thus, the need to send data
sometimes exceeds the demand for it.
The project examines the use of an industry standard RF communication protocol called Zigbee in the
design of a wireless TPMS. The deliverables in the project include a demonstrator TPMS that exploits the
Zigbee protocol and how it affects the power consumption of the system due to the fact that it
facilitates two way communication and paves a way for the innovation of additional features in TPMS
design. Long battery life is a key feature when it comes to enhancing the capability of TPMS as battery
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
2
operated systems usually have a unit embedded inside the vehicle tyre and as such it is impractical and
not cost efficient to frequently replace the battery. The project also examines the power consumption of
the tyre unit and uses the information to estimate the duration of the battery life.
1.2 APPROACH
In carrying out the project, it was necessary to carry out an extensive research on tyre pressure
monitoring systems and their properties. It was also important that the Zigbee communication protocol
and the relevant standards associated with it were understood. The demonstrator system built
comprises an evaluation kit obtained from Microchip Ltd, containing two Microprocessor boards with
software for evaluating the Zigbee communication protocol. A Sensor unit was built by myself
containing a combined temperature and pressure sensor and was attached to one of the evaluation
boards, together, mimicking the unit found in the tyre cavity of a TPMS. Further details of the System is
discussed in section 4. In developing the software, the System was first modelled at a high level using
flowcharts and pseudo codes to map out its intended operation. Software algorithms were developed
and implemented to meet the project specification and the system was tested and analyzed using the
project specification as a benchmark to measure the level to which the project achieved its goals.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
3
2 BACKGROUND RESEARCH
2.1 TPMS OVERVIEW
In the United States, accidents involving sport utility vehicles led to tyre recalls and claims that vehicle
design, tyre quality, tyre pressure, or driver error were the underlying causes. As a result, the
Transportation Recall Enhancement, Accountability and Documentation (TREAD) Act was passed in the
fall of 2000 following the Ford-Firestone crisis which saw a wave of road accidents involving Ford
Explorers fitted with Firestone tyres. It was found that the tyres experienced high rates of thread
separation from the tyre. It was also established that the problem was due to poor tyre design. The
United States Congress wanted to make tyres safer for the motoring public, hence, the introduction of
the Act. The TREAD Act has nine components that affect the tyre industry one of which is Tyre Pressure
Monitoring Systems. The purpose of this regulation was to warn drivers if their tyres are losing air
pressure. The final rule was published June 5, 2002.
Whilst in the US TPMS legislation grew from safety-related issues, The European Union (EU) legislators
are looking at TPMS as a way of reducing Carbon emissions and are presently considering mandatory
tyre pressure monitoring from an environmental stance.
2.1.1 TYPES OF TPMS
2.1.1.1 DIRECT TPMS
Direct TPMS use a small pressure sensor located inside each wheel. The sensor has a built-in transmitter
that broadcasts a radio signal to an external control unit. The control identifies the signal from each
wheel and keeps monitors the pressure. If the pressure drops below a predetermined threshold, the
module turns on a light or displays a message to warn the driver. The pressure sensors may be mounted
in the drop centre inside the wheel, or on the end of the valve stem inside the wheel. Stem mounted
pressure sensors use the valve stem as the antenna, so don't replace the standard valve caps with
anything else. Sensors attached to the rim drop centre are typically held in place by a long steel strap
that wraps all the way around the wheel.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
4
FIGURE 2.1.1.1: DIRECT TPMS TYRE UNIT
2.1.1.2 INDIRECT TPMS
Indirect TPMS measures the pressure by monitoring the individual wheel speeds of the vehicles tyres.
Most indirect systems use the fact that an under-inflated tyre has a slightly smaller diameter than a
correctly inflated tire and therefore will rotate more times to cover a specific distance to detect under-
inflation. Such systems can detect under-inflation in up to three tyres simultaneously but not in all four
since the operating principle of these systems is to compare the different wheel speeds and if all four
tyres lose the same amount of air the relative change will be zero. Newer developments of indirect
TPMS can detect simultaneous under-inflation in all four tyres due to vibration analysis of individual
wheels or analysis of load shift effects during acceleration and cornering. Indirect TPMS is cheap and
easy to implement since most modern vehicles already have wheel speed sensors for anti-lock braking
systems and electronic stability control systems. The disadvantage is that they rely on user recalibration
when the tyres are changed or re-inflated. Not performing this recalibration may lead to potentially
dangerous, false or misleading alerts.
2.1.1.3 HYBRID TPMS
Hybrid TPMS combines the advantages of both direct and indirect TPMS. The accuracy of the direct
system and some of the cost savings of the indirect systems are evident in hybrid systems. The pressure
sensors are on two of the vehicles wheels instead of four, and the wheel speed sensors compare the
differences in speed to these wheels to detect a dip in pressure.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
5
2.2 ZIGBEE OVERVIEW
ZigBee is a low-cost and low-power wireless networking standard that builds on the IEEE 802.15.4
standard which defines the physical (PHY) and media access control (MAC) layers. Zigbee defines the
application and security layer specifications hence, enabling interoperability between products of
different vendors.
FIGURE 2.1.1.1: ZIGBEE COMMUNICATION PROTOCOL STACK
Zigbee operates in the industrial, scientific and medical (ISM) bands which is 868MHz in Europe, 915MHz
in the USA and 2.4GHz in most parts of the world. Data rate ranges from 20 to 250kbit/s per channel
depending on band in use:
Frequency (MHz) 868 915 2400
Data Rate (Kbps) 20 40 250
Number of Channels 1 10 16
TABLE 2.1.1-1: ZIGBEE OPERATING FREQUENCIES
Zigbee radios use direct-sequence spread spectrum coding, which is managed by the digital stream into
the modulator. Binary Phase Shift Keying (BPSK) is used in the 868 and 915 MHz bands and Orthogonal
Quadrature Phase Shift Keying (O-QPSK) that transmits two bits per symbol is used in the 2.4 GHz band.
The raw, over-the-air data rate is 250 Kbit/s per channel in the 2.4 GHz band, 40 Kbit/s per channel in
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
6
the 915 MHz band, and 20 Kbit/s in the 868 MHz band. Transmission range is between 10 and 75 meters
(33 and 246 feet), although it is heavily dependent on the particular environment. The maximum output
power of the radios is generally 0 dBm (1 mW).
Furthermore, the basic channel access mode specified by IEEE 802.15.4-2003 is Carrier Sense, Multiple
Access/Collision Avoidance (CSMA/CA). That is, the nodes talk in the same way that people converse;
they briefly check to see that no one is talking before they start. There are three notable exceptions to
the use of CSMA. Beacons are sent on a fixed timing schedule, and do not use CSMA. Message
acknowledgements also do not use CSMA. Finally, devices in Beacon oriented networks that have low
latency real-time requirements may also use Guaranteed Time Slots (GTS), which by definition do not
use CSMA.
Zigbee has a mesh network architecture but also supports a star topology and cluster-tree topology. In a
mesh topology, each node may communicate with any other node within range, it gives many possible
routes through the network, hence, bad performing routes can be ignored. The star topology is very
simple, all nodes communicate with one central node. The cluster tree topology is a combination of star
and mesh topologies.
FIGURE 2.1.1.2: MESH NETWORK TOPOLOGY1
1 (Microchip Technology Inc, 2007)
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
7
FIGURE 2.1.1.3: STAR NETWORK TOPOLOGY2
FIGURE 2.1.1.4: CLUSTER TREE NETWORK TOPOLOGY3
2.2.1 ZIGBEE DEVICE TYPES
IEEE 802.15.4 defines two types of devices. These devices types are:
Full Function Device (FFD): offer most of the services available on an IEEE 802.15.4 based system,
typically powered from the Mains and usually remains powered up even when Idle.
Reduced Function Device (RFD) : has limited functionality, it is usually battery powered and typically
switched off when idle.
Listed in Table 2.2.1-1 are the three types of ZigBee protocol devices as they relate to the IEEE device
types.
2 (Microchip Technology Inc, 2007)
3 (Microchip Technology Inc, 2007)
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
8
Zigbee Protocol Device IEEE Device
Type Typical function
Coordinator FFD
One per network. Responsible for forming the network, allocating network addresses and may monitor and control other devices on the network
Router FFD
This is an optional device in the network, it extends the physical range of the network by way of allowing more nodes to join the network. It may also perform monitoring and control functions
End device RFD
Performs monitoring and control functions only
TABLE 2.2.1-1: RELATIONSHIP BETWEEN ZIGBEE & IEEE DEVICE TYPES4
2.2.2 ZIGBEE STACK ARCHITECTURE
The ZigBee stack architecture is made up of a set of blocks called layers. Each layer performs a specific
set of services for the layer above. The stack architecture is shown in Figure 2.2.2.1.
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
51
8 TABLE OF FIGURES Figure 2.1.1.1: Direct TPMS Tyre Unit ............................................................................................................. 4 Figure 2.1.1.1: Zigbee Communication Protocol Stack .................................................................................... 5 Figure 2.1.1.2: Mesh Network Topology ......................................................................................................... 6 Figure 2.1.1.3: Star Network Topology ............................................................................................................ 7 Figure 2.1.1.4: Cluster Tree Network Topology ............................................................................................... 7 Figure 2.2.2.1: Zigbee Protocol Stack Architecture ......................................................................................... 8 Figure 4.2.1.1: Zigbee Demonstration Board with Zigbee Compliant Transceiver ........................................ 14 Figure 4.2.1.2: Sensor Board ......................................................................................................................... 15 Figure 4.2.1.3: Sensor Board Schematic Diagram ......................................................................................... 15 Figure 4.2.1.4 - MPXY8020 Series Sensor Block Diagram .............................................................................. 16 Figure 4.2.1.5: Complete Demonstrator Tyre Unit ........................................................................................ 18 Figure 4.2.1.6: Microcontroller and Sensor PORT Mapping .......................................................................... 18 Figure 4.2.1.7: Sensor Data Timing................................................................................................................ 19 Figure 4.2.2.1: Control Unit User Payload Packet ......................................................................................... 24 Figure 4.2.2.2: Tyre Unit User Payload Packet .............................................................................................. 24 Figure 4.2.2.3: Control Unit Driving Mode Flowchart ................................................................................... 25 Figure 4.2.2.4: Control Unit Parking Mode Flow Chart ................................................................................. 26 Figure 4.2.2.5: Tyre Unit Driving Mode Flowchart ........................................................................................ 27 Figure 4.2.2.6: Tyre Unit Parking Mode Flowchart ........................................................................................ 27 Figure 4.2.2.7: Successive Approximation Routine Flowchart ...................................................................... 30 Figure 4.2.2.8: Sensor Waveform During Measurement .............................................................................. 31 Figure 4.2.2.9: Control Unit Startup Flowchart ............................................................................................. 32 Figure 4.2.2.10: Tyre Unit Startup Operation Flowchart ............................................................................... 33 Figure 4.2.2.11: Control Unit Mode Change and Message Receipt Flowchart.............................................. 34 Figure 4.2.2.12: Tyre Unit Message Receipt FlowChart ................................................................................ 35 Figure 5.1.2.1: Test Setup for The MPXY8020 Sensor ................................................................................... 38 Figure 5.1.3.1: Achieved Control Timing Results For MPXY8020 Sensor ...................................................... 39 Figure 5.2.2.1: Zigbee Communication Link Test Set Up ............................................................................... 40 Figure 5.3.2.1: Control Unit Buttons ............................................................................................................. 41 Figure 6.1.2.1: 8 Bit D/A Conversion Time Waveform .................................................................................. 52 Figure 6.1.2.2: Sensor Setup Time Waveform ............................................................................................... 53 Figure 6.1.2.3: Sensor Hold Time Waveform................................................................................................. 53 Figure 6.1.2.4: Complete Measurement Time From Reset To 8 Bit D/A Conversion .................................... 54 Figure 6.1.2.5: Tyre Unit Network Join AtTempt ........................................................................................... 54 Figure 6.1.2.6: Control Unit Network Formation .......................................................................................... 55 Figure 6.1.2.7: Tyre Unit Network Join Acknowledgement ........................................................................... 55 Figure 6.1.2.8: Control Unit Acknowledgement of Tyre Unit Join ................................................................. 56 Figure 6.1.2.9: Parking Mode Command As Sent By Control Unit ................................................................ 56 Figure 6.1.2.10: Parking Mode Command Receipt ........................................................................................ 57 Figure 6.1.2.11: Tyre Unit Awaken on Driving Mode Command Receipt ...................................................... 57 Figure 6.1.2.12: Driviing Mode Command As Sent by the Control Unit ........................................................ 58 Figure 6.1.2.13: Driving Mode Command Receipt By Tyre Unit .................................................................... 58 Figure 6.1.2.14: Message Sent By Tyre Unit in Driving Mode ....................................................................... 59 Figure 6.1.2.15: Message Received By Coordinator in Driving Mode ........................................................... 59 Figure 9.2.5.1: TPMS Application Configuration ........................................................................................... 65
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
52
9 APPENDICES
9.1 SCREEN CAPTURE OF TEST RESULTS
FIGURE 6.1.2.1: 8 BIT D/A CONVERSION TIME WAVEFORM
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
53
FIGURE 6.1.2.2: SENSOR SETUP TIME WAVEFORM
FIGURE 6.1.2.3: SENSOR HOLD TIME WAVEFORM
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
54
FIGURE 6.1.2.4: COMPLETE MEASUREMENT TIME FROM RESET TO 8 BIT D/A CONVERSION
FIGURE 6.1.2.5: TYRE UNIT NETWORK JOIN ATTEMPT
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
55
FIGURE 6.1.2.6: CONTROL UNIT NETWORK FORMATION
FIGURE 6.1.2.7: TYRE UNIT NETWORK JOIN ACKNOWLEDGEMENT
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
56
FIGURE 6.1.2.8: CONTROL UNIT ACKNOWLEDGEMENT OF TYRE UNIT JOIN
FIGURE 6.1.2.9: PARKING MODE COMMAND AS SENT BY CONTROL UNIT
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
57
FIGURE 6.1.2.10: PARKING MODE COMMAND RECEIPT
FIGURE 6.1.2.11: TYRE UNIT AWAKEN ON DRIVING MODE COMMAND RECEIPT
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
58
FIGURE 6.1.2.12: DRIVIING MODE COMMAND AS SENT BY THE CONTROL UNIT
FIGURE 6.1.2.13: DRIVING MODE COMMAND RECEIPT BY TYRE UNIT
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
59
FIGURE 6.1.2.14: MESSAGE SENT BY TYRE UNIT IN DRIVING MODE
FIGURE 6.1.2.15: MESSAGE RECEIVED BY COORDINATOR IN DRIVING MODE
WIRELESS TYRE PRESSURE MONITORING SYSTEM USING ZIGBEE
60
9.2 SENSOR ROUTINES
9.2.1 SENSOR INITIALIZATION ROUTINE
void initSensor(void)
{
TRISD = confMcuPins; //configuring MCU pin
directions
clk = 0; // initialise clock
//cycling high and low to put serial bit counter in
//known state (Reset)
S1 = 1;
wait(1);
S1 = 0;
resetDAR();//Resetting sensor internal DAR
//Putting Sensor in Reset mode
sensorResetMode();
}
9.2.2 8 BIT DATA SHIFT ROUTINE /************************************************