Announcement

Collapse
No announcement yet.

Cheap CAN bus adapter?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Cheap CAN bus adapter?

    I'm about to start work on my Mazda 3, and I would like to interface to the CAN bus. My main goal is to use the steering wheel controls, but I would also like to control the stock LCD screen, and monitor whatever else I can on the CAN bus. To complicate things, the Mazda 3 has two CAN buses, HS-CAN and MS-CAN.

    I have a bluetooth ELM327 device (cheap Chinese knock-off), but I'm constantly getting Buffer Full errors and it's operating on the HS-CAN bus rather than MS-CAN. I expect all similar OBD-II adapters would also connect to HS-CAN. So I've been looking at alternative CAN adapters, and they're all pretty expensive as far as I'm concerned, but then I found this:

    Microchip MCP2515 Demo Board (2 for US$55)

    These things are basically CAN to USB adapters without the pretty packaging, but with a very attractive price. I'm wondering how easy it would be to write some code to interface with these things. It sounds like they use their own custom USB driver in Windows, but I would be working in Linux.

    Does anyone have any thoughts on this idea?

  • #2
    Originally posted by StevePER View Post
    I'm about to start work on my Mazda 3, and I would like to interface to the CAN bus. My main goal is to use the steering wheel controls, but I would also like to control the stock LCD screen, and monitor whatever else I can on the CAN bus. To complicate things, the Mazda 3 has two CAN buses, HS-CAN and MS-CAN.

    I have a bluetooth ELM327 device (cheap Chinese knock-off), but I'm constantly getting Buffer Full errors and it's operating on the HS-CAN bus rather than MS-CAN. I expect all similar OBD-II adapters would also connect to HS-CAN. So I've been looking at alternative CAN adapters, and they're all pretty expensive as far as I'm concerned, but then I found this:

    Microchip MCP2515 Demo Board (2 for US$55)

    These things are basically CAN to USB adapters without the pretty packaging, but with a very attractive price. I'm wondering how easy it would be to write some code to interface with these things. It sounds like they use their own custom USB driver in Windows, but I would be working in Linux.

    Does anyone have any thoughts on this idea?
    if You are brave enough, then the easiest way to get a PIC board is to hack Your chinese ELM327 clone ! its a PIC18F2480/2580 with integrated CAN controller + MCP2551 CAN transciever + FT232 serial to USB controller + OBD connector cable and stable casing for as low as 20$ shipped, costs less than the half of anything else

    then You need a programmer - You can build Your own or buy it for ~34$+shipping
    http://uk.farnell.com/microchip/pg16...0&Ntt=PG164120

    then You need a programming environment - the best i think is the Mikroe family, You can start with C, Pascal os Basic too
    http://www.mikroe.com/eng/categories...pic-compilers/
    the free version is able to do nearly everything that You want, the code limit is high enough...

    im planning the same with it, but i had no enough time to get in the project yet...
    "case": Skoda Superb Elegance 1.8T
    Asrock G41MH-GE, E2180 2GHz dualcore, 1024MB DDR2/800, Samsung F1 750GB/7200RPM/32MB, M4-ATX, Lilliput FA1011 HDMI touchscreen, ASUS Xonar DG PCI, homemade Quectel L10 USB GPS

    Comment


    • #3
      If you are serious about hacking the CAN bus, and you think your time is worth something, OBDLink is the way to go. Its RAM buffer is several times larger than ELM's, and it doesn't suffer from BUFFER OVERFLOW errors. Perhaps more importantly for your application, it lets you set up multiple pass/block filters, so you can specify precisely which messages you are interested in seeing.
      OBDLink MX: world's smallest, fastest, most advanced OBD/Bluetooth adapter with SW and MS CAN support. Read the review to learn more.
      Need to look up a diagnostic trouble code? Try the most up-to-date, free DTCsearch.com!

      You cannot send me a private message using this forum. Use my email instead: vitaliy[@]scantool.net.

      Comment


      • #4
        Originally posted by Vitaliy View Post
        If you are serious about hacking the CAN bus, and you think your time is worth something, OBDLink is the way to go. Its RAM buffer is several times larger than ELM's, and it doesn't suffer from BUFFER OVERFLOW errors. Perhaps more importantly for your application, it lets you set up multiple pass/block filters, so you can specify precisely which messages you are interested in seeing.
        I'm sure the quality is much better than the cheap thing I've got at the moment. But would this allow me to access both CAN buses?

        OBD pinouts for Mazda, showing both CAN buses

        Comment


        • #5
          Originally posted by FPeter View Post
          if You are brave enough, then the easiest way to get a PIC board is to hack Your chinese ELM327 clone ! its a PIC18F2480/2580 with integrated CAN controller + MCP2551 CAN transciever + FT232 serial to USB controller + OBD connector cable and stable casing for as low as 20$ shipped, costs less than the half of anything else
          That doesn't sound easy to me! I would rather pay a little more for hardware that works, and focus on the software side of things (which is my area of expertise).

          Comment


          • #6
            Originally posted by StevePER View Post
            I'm sure the quality is much better than the cheap thing I've got at the moment. But would this allow me to access both CAN buses?

            OBD pinouts for Mazda, showing both CAN buses

            If you want to listen to both busses at the same time you will need 2 "ELM" knockoffs at the very least. You could use one ELM and switch the speeds manually, but then you would have a HS CAN and MS CAN wired into the same pins on your ELM. This may cause issues for either bus and you may miss messages while you're listening to the other bus. Of course you could always add some sort of switch that would only allow one bus to be connected to your ELM at a time.

            Comment


            • #7
              Have you even varified that you can acheive your goal of collecting/controlling these items on the CAN BUS?

              Before making a large investment, do this first.

              Next, spend a little more and get a device like ValueCAN. It supports both CAN channels at once and has a free API that comes with it. It costs a lot more, but you will not have any problem with buffers, it can handle 90+ % on two 500 kpbs CAN without any issue.

              It comes with free software to get yourself started. I use a more profession version of the hardware and software and have for years. It have specialized features for reverse engineering and a tool called CAN Cracker is free from the company's web site (intrepidcs.com).

              Good Luck.
              Hack your car's CAN BUS at www.canbushack.com

              Comment


              • #8
                Originally posted by chewwtoy View Post
                Have you even varified that you can acheive your goal of collecting/controlling these items on the CAN BUS?
                Yes, I have verified I can collect it using my cheap and dodgy ELM327 clone, and there is some stuff on the web about controlling the LCD.

                Next, spend a little more and get a device like ValueCAN. It supports both CAN channels at once and has a free API that comes with it. It costs a lot more, but you will not have any problem with buffers, it can handle 90+ % on two 500 kpbs CAN without any issue.
                Way too expensive - I'll stick with the Microchip development boards if I end up getting anything. I feel fairly confident that I can make it do what I want.

                Comment


                • #9
                  Originally posted by StevePER View Post
                  ...Way too expensive - I'll stick with the Microchip development boards if I end up getting anything...
                  microchip dev board = ELM327 chinese clone, but without FT232 RS232>USB, casing, obd connector cable for 2-3x the price... PCB quality of the clone is absolutely correct ( click here ) and the quality of the clone firmware does not matter if You swap it to a custom one (but it looks ok too, i tested it with some car and worked ok everywhere )
                  "case": Skoda Superb Elegance 1.8T
                  Asrock G41MH-GE, E2180 2GHz dualcore, 1024MB DDR2/800, Samsung F1 750GB/7200RPM/32MB, M4-ATX, Lilliput FA1011 HDMI touchscreen, ASUS Xonar DG PCI, homemade Quectel L10 USB GPS

                  Comment


                  • #10
                    Well I went ahead and bought the demo boards and I've written some Linux software to use the boards as a CAN monitor. I haven't implemented message sending yet, but that won't take long. Once I hook it up to my car I'll post my results.

                    Programming information and example code

                    Overall this seems very promising, but only for those with programming skills.

                    Comment


                    • #11
                      I have successfully received CAN messages from my car in this super-dodgy initial test, where I connected the CAN adapter to the input to the LCD.

                      I received 9 different CAN message IDs while the car was not turned on, the only one of which I understand (thanks to madox.net) is the 0x400 message. This gave me an an average speed of 44 km/h (which seems about right for my last trip), average fuel consumption of 7.0 L/100km (also about right), and fuel remaining of 343 km (definitely not right).

                      Next I need to work out why my software decided to exit after only a couple of seconds, make a slightly less dodgy wiring harness for testing, and try it out while driving.

                      Comment


                      • #12
                        I found a site which already offer a ready can-adapter. Ordered for the Mazda 3. You have seen this site and the manufacturer? Someone may say something about them?

                        Comment

                        Working...
                        X