Decoding Mazda CAN bus

While working on my projects, I did several attempts to depict Mazda CAN protocol, to find useful information. For example getting the shift position for the “smart “mirror project and the fuel level for the fuel reminder. There are many products available for OBD2 protocol. One good product is TouchScan with Mazda extension, which allows you to access every module in the car for diagnostic purposes. Using this tool, I figured out how to get access to the fuel gauge on the console, instead of using the sensor in the tank. However, while it is a very useful tool, it does not provide access to real time information available on CAN bus as broadcasted messages.

OBD2 protocol is query-respond based. You can get information by sending a request to the addressed module, but this is not the same as getting information from live broadcasted messages, without any delays.

Mazda uses two separate buses , HS-CAN or High Speed 500khz and MS-CAN Medium Speed 125 kHz. It is well documented in the Mazda Work Shop manual, but without actual IDs for each module, which is proprietary Mazda’s information, not available for public.

I decided to make a dual channel CAN logger/bridge, which will allow me to record messages from individual modules as well as logging from two buses. I found an old Raspberry Pi board, which will be perfect for this project. Two SPI CAN modules on top of it will do the job.



Assembled with CAN-SPI modules


“Black box” 3D printed enclosure with illuminated push button to start/stop logging.


Accessible USB ports for memory stick and Wi-Fi dongle.


Logging started



Using Python programming language it will be easy to do filtering and bridging between CAN segments for separate logging on common bus and individual modules.



My goal is to figure out how to control warning sounds, get access to the switches on steering wheel and central console as well as some basic information , like speed, steering position, etc.,  in real time.

First, I logged 10 minutes drive and converted to  Excel spread sheet. Next step will be logging from individual modules, using bridge option in my sniffer.


Started my list MX-5_CAN (updated on 3/14/17),  shift position,  wheels speed, steering column angle decoded,  work in progress…


Some useful links:

Wikipedia page CAN bus

Ameridian’s blog

Raspberry Pi

11 thoughts on “Decoding Mazda CAN bus

  1. Pingback: Raspberry Pi Zero W for car applications | Gadgets for my MX-5 2016 (ND)

    • MS-CAN must be configured for 125 kbps speed, otherwise was no problem. Also, I found that all the messages on MS-CAN you can catch on HS-CAN as well. Probably some device has bridge between them.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s