0

Background


I'm very new to electronics/IoT dev. I'm trying to create a solution to be able to read my wife's Car's CAN Bus signal (messages) and store it to an SD card. I hope to analyze the data and build a dashboard based on the car's telemetry.

This specific question is in relation to a chip (STM32F1) on an IoT board (MXChip AZ3166) I already own, which I hope to incorporate into my overall solution as the data acquisition layer.

For reference the:

Chips is the: STMicroelectronics STM32F103C8T6, 32bit ARM Cortex M3 Microcontroller

and the IoT board is the: (MXChip AZ3166 IoT DevKit)

Reading the MXChip AZ3166 board's spec and after doing some research, I have found out that the MXChip AZ3166 comprises two main chipsets:

Vendor Part Number Ref Link
STMicroelectronics STM32F103C8T6 https://uk.rs-online.com/web/p/microcontrollers/1023545
MXChip EMW3166 https://www.mxchip.com/en/products/module/54

Main Question


  1. The product specification mentions the STM32F1 features Comprising of motor control peripherals plus CAN and USB full speed interfaces, it also states it has 1x CAN Channel. Does that mean I can interface the MXChip AZ3166 board featuring this chip via the GPIO pins to the CAB bus in my wife's car and receive the CAN Bus signals (I presume adhering to the ISO 11898-1 CAN data communication protocol).

  2. How would I find out which pins to connect to the CAN Hi & CAN low connections on the cars CAN Bus?

  3. Concerning power, how would I determine that the CAN signal received doesn't fry the MXChip Board with a stated max Operation voltage of 3.3v?

Josh_BI_UK
  • 87
  • 5
  • 7
  • 16

1 Answers1

0
  1. Yes you'll want an MCU with a built-in CAN controller for communicating on a CAN bus. However, the CAN standard only covers the physical and data link layers. You need to know the application layer in order to meaningfully interact with a bus.

    The application layer on a car may or may not be proprietary. It may even be encrypted. If you don't know what protocol is uses, then no can do. Reverse-engineering CAN protocols is hackish, hard and dangerous. Plugging into a CAN bus where you have no clue about timing considerations etc is also very dangerous.

    But cars usually have an "on-board diagnostics" (OBD) port used for service purposes, with standardized application layers, through which you may have access to various parts of the car. There's lots of different standards for OBD and older ones didn't even use CAN. It depends on the car model.

  2. In case of the OBD port the pinouts are standardized and you can find them on the Internet. Otherwise it is very simple to find out which signal that's CANH and CANL with an oscilloscope. CANH goes 2.5V +1V and CANL 2.5V -1V. A more hacky solution is to measure this with a multimeter, but it's perfectly possible since one signal with be slightly above 2.5V and the other slightly below.

  3. CAN is standardized so if you have a CAN bus on the board, you connect there. In some cases there may be 12V supply wired together with the signal and that's the only one which could fry something.

Overall, please note that the project you describe here is very difficult and not a beginner task. It sounds as you have next to no experience of electronics/embedded systems, so I would recommend picking a far simpler project.

Furthermore, modifying car electronics or installing your own electronics in a car is illegal in most parts of the world. Third party type approvals with EMC tests are mandatory (and very expensive). If your car is involved in an accident and they find custom electronics without type approval in it, you could be facing serious legal consequences.

Lundin
  • 195,001
  • 40
  • 254
  • 396
  • Hi Lundin, thank you for your response. To avoid any doubt, I don't plan to modify any of the car's electronics. Only to listen to the ECU's communication over the CAN Bus. I don't intend to send any signals. I plan to use the ODB port as mentioned. – Josh_BI_UK Feb 16 '23 at 22:05
  • @Josh_BI_UK If you mount any electronics inside a car it might still affect EMC so you still need a type approval. Authorities are extra picky with this, it actually more demanding EMC-wise to put electronics in a car than in most forms of heavy machinery. Check out the UN ECE R10 directive. – Lundin Feb 20 '23 at 07:46