Sei sulla pagina 1di 10

SIGNAL INTERFACING

USING CAN BUS

A Project Report
Submitted in Partial Fulfillment of the Requirement for
the Award of the Degree of

BACHELOR OF TECHNOLOGY
(ELECTRONICS AND COMMUNICATIONS)

TO
UKTU DEHRADUN

Submitted by
RAKSHIT KANDPAL
(160050102042)
SHUBHAM CHAUDHARY
(160050102053)

UNDER THE GUIDANCE OF


ANOOP RAGHUVANSHI
(Assistant Professor, ECE Department)

DEPARTMENT OF ELECTRONICS AND COMMUNICATION ENGINEERING


UTTARAKHAND TECHNICAL UNIVERSITY, DEHRADUN MAY, 2020\

1
DECLARATION
We Rakshit Kandpal , Shubham Chaudhary bearing university roll number
160050102042,160050102053 respectively , we are students of BTECH of
Electronics and Communication Engineering Department. We hereby declare that
we own the full responsibility for the information, results etc. provided in this
Project titled “SIGNAL INTERFACING USING CAN BUS”, submitted to
UKTU, Dehradun for the award of BTECH (ECE) degree. We have taken care in all
respect to honor the intellectual property right and have acknowledged the
contribution of others for using them in this academic purpose. We further declare
that in case of any violation of intellectual property or copyright, we as the candidate
will be fully responsible for the same. My supervisor, HOD and the Institute should
not be held responsible for any full or partial violation of copyright if found at any
stage of my degree.

Date: Rakshit Kandpal(160050102042)


Place: BIAS Bhimtal Shubham Chaudhary(160050102053)

2
CERTIFICATE
Certified that the thesis titled “SIGNAL INTERFACING USING CAN BUS”
submitted by Rakshit Kandpal (160050102042) , Shubham Chaudhary
(160050102053) , in the partial fulfilment of the requirements for the award of the
degree of BTECH(Electronics & Communication Engineering) of UKTU University, is a
record of student’s own work carried under my supervision and guidance. To the best of our
knowledge, this thesis has not been submitted to UKTU University or to any other university
or institute for award of any degree. It is further understood that by this certificate the
undersigned do not endorse or approve any statement made, opinion expressed or conclusion
drawn therein but approve the thesis only for the purpose for which it is submitted.

Anoop Raghuvanshi H.O.D


Assistant Prof. ECE Deptt. Dr. H,C Pandey
HOD, ECE Deptt.

iii
Acknowledgement

I wish to express my sincere gratitude to my supervisor Anoop Raghuvanshi


Assistant Professor, Department of Electronics and Communication Engineering,
BIAS, Bhimtal for his valuable guidance, constant inspirations and helpful
suggestions for carrying out this thesis work.

I also wish to express my sincere thanks and deep sense of gratitude to my Head of
Department Dr. H.C Pandey Head, BIAS, Dehradun also to Mr. Anil Kumar
Chaurasia , Assistant Professor and BTECH-Project Coordinator, Department of
ECE, BIAS, Bhimtal for his constant inspirations and helpful suggestions throughout
the course of this Project work.

I would like to thank Staff and faculty members of Electronics and Communication
Engineering department for their support throughout this work.

I also wish to express my sincere thanks to Dr. G.S Tomar, Director, Birla Institute
of Applied Sciences, Bhimtal , Uttarakhand for his guidance.

Last but not the least, I thank my family and my friends, who have always been a
constant source of encouragement in every aspect of my life.

Rakshit Kandpal (160050102042)


Shubham Chaudhary (160050102053)

iv
TABLE OF CONTENTS
Description Page No
Declaration ii
Certificate iii
Acknowledgement iv
Table of Content v-vi
Abstract vii
List of Figures viii
List of Abbreviations ix
Chapter One: Introduction 1-21
1.1 CAN BUS Protocol Speed and Range 2
1.2 Advantages of CAN Protocol 2
1.3 CAN Communication 3
1.3.1 CAN Node 5
1.3.2 CAN Controller 5
1.3.3 CAN Transceiver 5
1.3.4 CAN Bus 5
1.3.5 CAN Bus logic 5
1.4 CAN Communication Principle 6
1.5 CAN Message Frames 6
1.5.1 CAN Frames 6
1.5.2 Data Frame 7
1.5.3 Standard CAN Data Frame 8
1.5.4 Extended CAN Data Frame 8
1.5.5 Remote Frame 9
1.5.6 Addressing 9
1.5.7 SOF(1Bit) 10
1.5.8 Arbitration Field(12 or 32 Bits) 10
1.5.9 Control Field (6 Bits) 11
1.5.10 Data Field 11
1.5.11 CRC and Acknowledgment 11
1.5.12 Acknowledge Field (2 Bits) 12
1.5.13End of Frame Field (7Bits, recessive) 14
1.5.14 Bit Stuffing 15
1.5.15 Principle of Bus Access 15
1.5.16 Bitwise Bus Arbitration 15
1.517 Prioritization 16
v
1.6 Principle of Data Protection 17
1.7 Logical Error Detection 17
1.7.1 Error Tracking 19
1.7.2 CAN Message types 19
1.7.3 Bus Arbitration and Signaling 20
1.7.4 Inverted logic 20
Chapter Two: Literature Survey 22-27
2.1 Inference Drawn 27
Chapter Three: System and Software Requirements 28-35
3.1 Component Requirement 28
3.2 Note on MCP2515 CAN Bus Controller 28
3.3 Schematic of MCP2515 CAN Bus module 29
3.4 Arduino Uno 30
3.5 Circuit Design of MCP2515 with Arduino 32
3.6 Software Requirement 34
3.6.1 Coding 34
3.6.2 Transmitter code 34
3.6.3 Receiver code 35
Chapter Four: Working and Application 38
4.1 Application 38
Chapter Five: CONCLUSION AND FUTURE SCOPE 39-40
5.1 Conclusion 39
5.2 Future Scope 40
REFERENCES x

vi
Abstract
CAN (Controller Area Network) is a serial communication technology used
especially for reliable data exchange between electronic control units (ECUs) in the
automobile.

Data exchange between the electronic control units was initially implemented
conventionally, i.e. a physical communication channel was allocated to every signal
to be transmitted.

However, intensive wiring effort enabled just limited data exchange. The only
solution that seemed to offer a way out of this dilemma came from serial bit
exchange of data via a single communication channel (bus). This led to the need to
conceptualize a serial communication system tailored to the requirements of the
automobile.

In this project, we will learn about the MCP2515 CAN Controller Module, how to
interface the MCP2515 CAN Bus Controller with Arduino and finally how to enable
communication between two Arduino board with the help of two MCP2515 CAN
Controllers and the CAN Protocol.

Based on requirements of modern vehicle, in- vehicle Controller Area Network


(CAN) architecture has been implemented. In order to reduce point to point wiring
harness in vehicle automation, CAN is suggested as a means for data communication
within the vehicle environment. The benefits of CAN bus based network over
traditional point to point schemes will offer increased flexibility and expandability
for future technology insertions. This paper presents the development and
implementation of a digital driving system for a semi-autonomous vehicle to
improve the driver- vehicle interface. It uses an ARDUINO based data acquisition
system that uses ADC to bring all control data from analog to digital format and
visualize through LCD. The communication module used in this project is embedded
networking by CAN which has efficient data transfer.

vii
LIST OF FIGURES

S.No. Description Page No.

Figure 1 Basic CAN Structure 2


Figure 2 Advantages of CAN 3
Figure 3 CAN Bus Structure 4
Figure 4 Comparison between CAN and TTL Logic 4
Figure 5 Can Frames 7
Figure 6 Standard CAN Data Frame 8
Figure 7 Extended CAN Data Frame 9
Figure 8 CAN Standard and Extended Frame 9
Figure 9 Arbitration field with 11-bit identifier 10
Figure 10 Arbitration field with 29-bit identifier 11
Figure 11 Control Field 11
Figure 12 CRC Field 12
Figure 13 Range of checksum application 12
Figure 14 Acknowledgement field 13
Figure 15 Acknowledgement function 14
Figure 16 End of Frame field 15
Figure 17 Bit stuffing range 16
Figure 18 Bus access in CAN network 16
Figure 19 Prioritization of CAN messages 17
Figure 20 Form check 18
Figure 21 Bit monitoring and stuff check 18
Figure 22 CRC 19
Figure 23 ACK check 19
Figure 24 CAN output/input 20
Figure 25 CAN Bus Arbitration with different voltage 21
Figure 26 MCP2515 CAN bus module 28
Figure 27 MCP2515 CAN controller 29
Figure 28 Schematic of MCP2515 30
Figure 29 Arduino Uno schematic pin diagram 31
Figure 30 Original diagram 32
Figure 31 Pin module of MCP2515 32
Figure 32 Circuit diagram 33

viii
LIST OF ABBREVIATIONS

IEEE Institute of Electrical and Electronics Engineers


CAN Controller Area Network
CRC Cyclic Redundancy Check
ACK Acknowledgement
EOF End Of Frame
SOF Start Of Frame
CANH Controller Area Network high
CANL Controller Area Network low
DLC Data length code
IDE Identifier Extension
RTR Remote Request frame
ID Identifier
IFS Inter frame Space

ix
REFERENCES

1. Li Ran, Wu Junfeng, Wang Haiying, Li Gechen. “Design Method of CAN BUS


Network Communication Structure for Electric Vehicle”, IFOST 2010
Proceedings IEEE.

2. Yujia Wang, Hao Su, Mingjun Zhang., “CAN-Bus-Based Communication


System Research for Modular underwater Vehicle”, 2011 IEEE DOI
10.1109/ICICTA.2011.

3. Chin E. Lin, S. F. Tai, H. T. Lin, T. P. Chen, P. K. Chang, C. C. Kao “Prototype


Of A Small Aircraft Avionics Using Hybrid Data Bus Technology” 2005 IEEE.

4. Chin E. Lin, Hung-Ming Yen, “A Prototype Dual Can-Bus Avionics System For
Small Aircraft Transportation System” 2006 IEEE.

5. Claesson, C. Ekelin, N. Suri, “The event-triggered and time- triggered medium-


access methods”, 6th IEEE International Symposium on Object-Oriented Real-
Time Distributed computing, May 14-16, 2003, pp. 131-134.

6. Chris Quigley, Richard McLaughlin, “Electronic System Inte- Gration For


Hybrid And Electric Vehicles”.

7. Chin E. Lin, H. M. Yen, “Reliability And Stability Survey On Can- Based


Avionics Network For Small Aircraft” -7803-9307- 4/05/2005 IEEE.

Potrebbero piacerti anche