5

I would like to get advice about CAN bus communication with an Android tablet.

I am working into an electrical vehicle project with a colleague. We have CAN bus communication between BMS, inverter, and control logics. And I need to get data, like the speed to the cluster. The cluster will be an Android tablet. I have an Arduino shield for CAN and Bluetooth adapter to send data to the tablet. I am fairly new to Android.

  • What should I start looking for?
  • Would these OBD-II codes work, because I need to send data too.

  • In your opinion, should I decode on the Arduino or pass CAN data to Android and deal with it there? The data is COB ID/No. of bytes/ DATA. (601/ 8/ 22 98 60 00 22 00 00 00) And I am wondering were to deal with it. If for example the first two bytes are lights, the second are speed and so on. Or should I just split them by delimiter ' ' and the byte to int?
  • I am able to send data to the CAN bus from Android. I have CAN analyzer, and the controller accepts it.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Martynas
  • 627
  • 2
  • 8
  • 28
  • They sell OBD-II bluetooth adapters [like this](http://ecx.images-amazon.com/images/I/818XHEEKHdL._SX522_.jpg) that you can plug in your car's socket and read data from Android apps. Not sure if you can read the commands you need, but you can code an app to do it by yourself. What I mean is that you probably can skip the Arduino here. – Mister Smith May 20 '14 at 09:34
  • What is "CAN analyzer"? The name of a software program? – Peter Mortensen Sep 01 '17 at 00:15
  • Yes its a software, but its not widely used :) but does business – Martynas Sep 19 '17 at 21:05

2 Answers2

4

Based on your inputs, you will need to use your Arduino to connect your Android device to you vehicle. The Arduino code will translate data from CAN to Bluetooth and the other way around. Indeed your Android device can't communicate directly to your CAN bus.

Then you will have to create your Android application to send/receive data from the Arduino. To do so take a look at the Android Bluetooth guide (it could also be possible to do the same with a Wi-Fi shield or an Ethernet shield or over USB (much more difficult)).

For OBD-II codes it depends on your vehicle if those are implemented on itself.

For data decoding:

  • Decode data on the Android device. This way if you change your bridge (here the Arduino) your application still works.
  • Decode data on the Arduino and this way your Android application uses high level commands, but it will be strongly linked to your bridge implementation.
  • Decode with the language you are most at ease with.
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
JEY
  • 6,973
  • 1
  • 36
  • 51
0

Here is a simple solution here in an Android-CAN bus adapter that allows an Android device to connect to a CAN bus.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
gwentech
  • 89
  • 5
  • hi gwentech, its amazing tool, but we did a work around. As i understand these devices are analyzers and we needed bidirectional comunication. During the search in google i did found your device. Thumbs for it :) – Martynas Jun 03 '15 at 18:37