You are on page 1of 5

2011 IEEE International Conference on Control System, Computing and Engineering

Development of Wireless Controller Area Network


Using Low Cost and Low Power Consumption ARM
Microcontroller for Solar Car Application
Goh Chin Hock1, Choke Ven Han2, Oon Kheng Heong 3, Norashidah Md Din4, Aiman bin Ismail5, Md Zaini
Jamaludin6, Chandan Kumar Chakrabarty7
Universiti Tenaga Nasional
Department of Electronic and Communication Engineering
Jalan IKRAM-UNITEN, 43000 Kajang, Selangor
chinhock@uniten.edu.my, venhan88@hotmail.com, khoon@uniten.edu.my, norashidah@uniten.edu.my, aiman@uniten.edu.my,
mdzaini@uniten.edu.my,chandan@uniten.edu.my

Abstract—In this paper, a wireless controller area network the reliability of transmission. A software design using an
(CAN) was developed using low cost microcontroller. The system ARM processor-based controller area network (CAN) is
is low cost and low power consumption for CAN application in created to fulfill above criteria.
order to receive data such as velocity, temperature and batteries
power from Maximum Power Point Tracking (MPPT). A II. SYSTEM DESIGN
programming was written for the microcontroller to receive data
from MPPT and sent it out through wireless transceiver for a
chase car to determine whether the solar car is in the optimum
condition. However the microcontroller receives data at a baud
rate of 1Mbps need to down rates to 9600bps due the maximum
limitation of the wireless transceiver. This may cause losses of
data during transmission and as such an interval is introduced
between CAN messages by using interrupt function.

Keywords: Controller area network, ARM microcontroller,


solar car, baud rate

I. INTRODUCTION
Controller area network (CAN) is a multi-master message
broadcast system originally developed in 1986 by Robert
Bosch [1]. The purpose of a CAN is to act as a medium to
allow individual systems to communicate with each other
without the need of a host computer [2]. This can be done by
utilizing the CAN bus that is integrated in the microcontroller
and can be connected between microcontrollers or peripheral
devices that support CAN. This CAN bus works on the CAN
feature/protocol that enables communication through a
message based protocol that is designed specially for the
Figure 1. Block diagram for the project
automotive operations [3].
Figure 1 above shows that a CAN bus system is being
Recently, the use of controller area network (CAN) in applied as means of communication medium, receiving data in
automotive application such as vehicles become more and CAN format from the motor‟s controller or from the solar‟s
more popular [4]. For instance, controller area network (CAN) car Maximum Power Point Tracking (MPPT) System. The
are being implement to improve driving safety [5], to develop microcontroller, EasyArm 8962 with LM3S8962
a fuel cell vehicle [6] and use for In-vehicle law enforcement microprocessor will tap into this bus to read the data,
applications [7]. processes the data and lastly transmit the data out via RS-232
where an wireless module, MaxStream X24-009 is connected
For a racing solar car to be driven at its best speed, it is to the chase car for data processing.
essential to obtain data such as velocity, temperature and However, one point to note that, the microcontroller will
batteries power by using a low-powered communication receive the data from CAN bus at a baud rate of 1Mbps, and
device during the transmission of messages while maintaining

978-1-4577-1642-3/11/$26.00 ©2011 IEEE 244


2011 IEEE International Conference on Control System, Computing and Engineering

the output of the processed data to RS-232 is at 9600bps baud


rate due to MaxStream X24-009 maximum baud rate Start
capability restrictions. The down rate of data from 1Mbps to
9600bps at the RS-232 will surely result in losses of data and
affect the solar car performance. Hence to avoid data losses Turn on buzzer
during transmission and reception, an interval between
messages was introduced by using interrupt function. No
If Key3==0
III. INTERRUPT FUNCTION
For the interrupt to functions properly, the interrupt Yes
function is separated into CAN interrupt and KEY interrupt.
No
CAN interrupt If CAN Baud
triggered Rate==1M

Get CAN interrupt Yes


status
CAN Baud rate = 125k

Ulstatus== 1
CAN Baud rate = 1M
Yes

CAN interrupt
triggered
If Key4==0

Return from interrupt Yes

Figure 2. CAN Interrupt flow chart G_bTXFlag1=1

Start
Return from interrupt

Turn on buzzer
Figure 4. Key 3 & key 4 Interrupt flow chart

No For CAN interrupt show in Figure 2, the interrupt is


If Key1==0 triggered when there is CAN message entering the
microcontroller. When this happens, microcontroller will get
Yes the interrupt status, and clears the interrupt so that the next
incoming CAN message can be received by the
Increase UART microcontroller. Then the microcontroller will flag certain
baud rate indicators, where in the main program, the microcontroller
will start to process the received data.

Next are the KEYs interrupt. There will be 4 keys on the


If Key2==0 EasyArm 8962, all of them with specific task. Figure 3 show
Key 1 and Key 2 interrupt function. The interrupt occurs when
Yes Key 1 or Key 2 is clicked and buzzer will turn on to indicate
one of the switches is pressed. Subsequently, the program will
Decrease UART check which key is pressed. If key 1 is clicked, the UART
baud rate baud rate will increase whereas if Key 2 is clicked the UART
baud rate is decreased.

Return from interrupt Figure 4 show the Key 3 and Key 4 interrupt function. Key
Figure 3. Key 1 & key 2 Interrupt flow chart 3 and Key 4 interrupt work the similar way albeit different

245
2011 IEEE International Conference on Control System, Computing and Engineering

function. Key 3 is used to interchange CAN baud rates


between 1Mbps for the controller and 125kbps for the MPPT
while Key 4 is used to trigger the main program to send CAN
message.
IV. TEST AND RESULT
A. Self- Test

Figure 7. 70ms Interval Test

Success ratio =

Figure 5. Self-Test Hardware Setup, A: EasyArm 8962, B: LM Link, C:


CANUSB II, D: Laptop

The first test is done by connecting the microcontroller to a


computer without wireless module, MaxStream X24-009 as
shown in Figure 5. A total of 1000 CAN dummy messages are
sent from PC to ARM microcontroller via CANUSB-II to
check the efficiency of the data output from RS-232. The
CAN message sent are Tritium type messages, hence the Figure 8. 80ms Interval Test
microcontroller will display „raw‟ information by using
hyperterminal software. Success ratio =
In this test, the „#‟ is used as an indicator to show the total
number to messages that are sent out to RS-232. In order to
calculcated the success ratio, simply divide the value of „#‟
over the Total Count (number of CAN messages).

Figure 9. 90ms Interval Test

Success ratio =

Figure 6. 0ms Interval Test From Figure 6 to 9, it show that when the time interval
between message increase from 0ms to 90ms, the success ratio
Success ratio = for the transmission of data also increase until perfectly at
90ms interval per message. This is due to the different baud

246
2011 IEEE International Conference on Control System, Computing and Engineering

rate of 1Mbps for CAN and 9600bps for RS-232 which


required a down rate by setting time interval per message.
B. Collaboration Test
Another test is done by connecting the wireless module,
MaxStream X24-009 and sent out the message from the
microcontroller via RS-232 to another receiving wireless
module as shown in Figure 10. Similar to self test, 1000
dummy CAN messages was sent out.

Figure 12. 90ms Interval Test

Figure 10. Collaboration Test Hardware Setup, A:MaxStream X24-009, B:


CANUSB II, C: EasyArm 8962, D: Laptop Success ratio =

For wireless test work, the message that sent out and
received will be in bytes. Hence for 1000 messages that sent
out, the size will be 79786 bytes. The success ratio can be
calculated by using the amount of bytes shown in the receiving
part(Rx) which is shown in X-CTU divide with the total size of
1000 messages which is 79786 bytes. From Figure 12, the
success ratio is perfectly at 90ms interval per message which is
same for self test result shown in figure 9.
V. CONCLUSION
A wireless controller area network(CAN) was developed to
receive information such as velocity, temperature and batteries
power from the solar car by using EasyArm 8962 which is low
cost and low power comsumption. By using the interrupt
function to introduce time interval between messages, the
transmission and reception success rate is perfect at 90ms as
shown in the self-test and collaboration test.
REFERENCES

[1] Steve Corrigan, Introduction to the Controller Area Network (CAN) –


Texas Instruments Application Report, SLOA 101, 2002.
[2] M. Farsi, K. Ratcliff and Manuel Barbosa, “ An overview of Controller
Area Network,” Computing & Control Engineering Journal June 1999.
Figure 11. 80ms Interval Test
[3] Hanxing Chen and Jun Tian, “ Research on the Controller Area
Network,” Intenational Conference on Networking and Digital Society
Success ratio = 2009.
[4] Navet. N, “ Controller area network[automotive application],” IEEE
Potentials.
[5] Shichao Cai, M. Becherif, M.Wack, “ Context system using pervasive
controller area network bus system to improve driving safety,”
IEEE/ASME International Conference on Mechatronics and Embedded
Systems and Applications (MESA).

247
2011 IEEE International Conference on Control System, Computing and Engineering

[6] Feng Luo, Jie Chen, Juexiao Chen, Zechang Sun, “Controller area
network development for a fuel cell vehicle,” Vehicle Power and
Propulsion Conference 2009.
[7] Anthony Marino and John Schmalzel, “ Controller area network for In-
vehicle law enforcement application,” IEEE Sensors Aplications
Symposium 2007.

248

You might also like