how to: interface steering wheel controls with an arduino (stepped resistor)

Поделиться
HTML-код
  • Опубликовано: 8 сен 2024
  • I show you how i interfaced my SWC(steering wheel controls) to crankshaft. A linux distribution for running android auto.
    Components:
    Car: 2005 Jaguar X-Type
    Computer: Raspberry pi model 3B+
    SWC Interface: Arduino Micro (with ATmega32U4 chip for usb support)
    custom protoboards: voltage divider circuit, optocoupler circuit
    Arduino micro listing:
    www.amazon.com...
    Documentation:
    The steering wheel controls in this case is a stepped resistor. This required analog interpretation of multiple buttons over a single wire. If you have separate wires per button (probably not due to clock spring restrictions in a lot of steering wheels), then it is way easier. just hook up the gpio connectors through an optocoupler board.
    Find out what the wiring in you car looks like. Just google for the wiring schematics and search for the infotainment part. For my car it showed up in google at the top (section 15.1 is relevant here): www.jagrepair.c...
    Test the wiring with a multimeter, set it to measure resistance. hook up the meter so it completes a circuit with the SWC.
    Hook up the arduino with script + voltage divider.
    script:
    pastebin.com/3...
    voltage divider:
    www.khanacadem...
    Connect the arduino to the RPI running crankshaft / another system and setup the software to read GPIO or accept keyboard commands
    ...
    I know I could've bought a control unit that does all this for me, but where is the fun and learning in that :) Ofcourse im not responsible for your ability to think clearly and that you should not use this while driving, or basically doing anything fun ever. dont get distracted, dont run over people, blablabla disclaimer, dont judge me for stupid actions or breaking your car or parts of you car blablabla.

Комментарии • 45

  • @rutgerdegraaf5277
    @rutgerdegraaf5277  5 лет назад +10

    I haven't discussed it in the video, but this method of interfacing allows you to get even more possible button combinations from your steering wheel because you can press buttons simultaneously and get a unique analog readout. You can even modify the script a little bit and get it to recognize double presses, or short and long holds fairly easily. and then map those to different functions/buttons.

    • @chillmethodman
      @chillmethodman 5 лет назад +3

      Great work. That's the solution I was searching for. Read voltage from a resistor based schematic (SWC) on A0 and use it to trigger some gpio at the rasp. Didn't know that conect the GND of both systems do not work. Work is still in progress in the car, but man that helps a lot for recognize where the prob is. Excellent work and specially thanks for uploading and sharing your knowledge. Thumbs up

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад

      @@chillmethodman thats great to hear! Good luck with the project

    • @Remcola46
      @Remcola46 Год назад +1

      Hi, I'm not really experienced with coding. How would you add long presses to the script?

  • @frankwren8215
    @frankwren8215 3 года назад +2

    Very cool video. I didn't even think of just using the resistance signal near the stereo; I was going to build an arduino with bluetooth into the wheel itself. This is a lot simpler.

  • @FutureProofNothing
    @FutureProofNothing Год назад

    Thank you for the video.
    I'm trying to find bluetooth receiver that also works with stearing wheel buttons and I come across this video.
    Maybe it's possible to sniff on can bus that connects to head unit and catch button press'; then forward it to diy BT receiver to pause or do other controls.
    Thanks again for sharing you work.

  • @LoganFan
    @LoganFan 5 лет назад +1

    THX for your great Video!

  • @markjagodzinski1850
    @markjagodzinski1850 Год назад

    I'm currently attempting to make a car radio out of a Pi for my '04 X-Type as a final project for one of my college classes, and I stumbled upon this gem of a video in my search for a way to use my steering wheel controls with said Pi. I am using LineageOS for my build, as I have an iPhone and therefore need to use CarPlay rather than Android Auto. Button mapping/AKC codes are as follows:
    Volume rocker >> volume up/down (AKC 0x0018/0x0019)
    Track rocker >> next/previous track (AKC 0x0057/0x0058)
    Voice button >> mute (AKC 0x00a4)
    Source button >> play/pause (AKC 0x0055)
    Seeing as all of these exist within Android as keyboard inputs, can I exclusively run USB commands? If so, how can I modify your preexisting design so as to entirely cut out GPIO control while maintaining USB control? Finally, do you have any tips I should follow seeing as we are using nearly identical vehicles?

  • @antelopepoop
    @antelopepoop 3 года назад +2

    I realize this is a late post, but why aren't you running this script directly on the Pi? Is it not able to read the resistance from the voltage divider directly into the GPIO pins?

    • @antelopepoop
      @antelopepoop 3 года назад +2

      To those wondering, yes the pi is not able to read the analog signal coming from the SWC. You need a dedicated Analog-to-Digital Converter (ADC) to read in the voltages. The pi does not come with an ADC.

  • @anycatdessai
    @anycatdessai 5 лет назад +1

    Good stuff. Will the harness be already be present, connected to a comapny fitted stereo? Also how does the android Auto by Crankshaft understand the signals coming from the arduino?

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад

      There is a harness that goes in the factory stereo yes. It is the one i replaced with a cheap open ended wire harness for about 25 euro so that i can safely cut in it. I completely removed the facrory stereo. There is a custom amplifier in there that runs the speaker wires and the raspberry pi sends analog sound to the amp.
      Crankshaft can understand keyboard strokes by simply going into the settings, there is a whole setting page dedicated to different keystrokes and functions. Gpio commands can be configured in a small config file as instructed on the crankshaft github wiki

  • @thereisnothingtv1105
    @thereisnothingtv1105 10 месяцев назад

    Ever since i put an android headunit my controlls work but thr button lights have stopped workin any possible fix?

  • @thereisnothingtv1105
    @thereisnothingtv1105 10 месяцев назад

    Hi what should the steering wheel voltage tolerate be ??!

  • @rasmus9412
    @rasmus9412 4 года назад +1

    Do you have a video where you make the head unit?

  • @felipesaldivar6270
    @felipesaldivar6270 2 года назад

    Hi good day, good night, your code its posible use part of sketch for read a steering wheel of volvo s40 2005?, thanks.

  • @Filelor
    @Filelor 5 лет назад

    What was you solution for mounting the RPI screen? I am still looking for a way to do it in my car. The only things I can think of is either epoxy or cannibalize the OEM-HU gut it and mount the screen to that, the bonus would be a nice tidy place for the opto-coupler(s), timer, etc.

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад +1

      I knew i wanted the screen in my car so bought it before i had the solution. Turned out it fits in with friction in the doubledin frame.
      Now i think thats just luck and a better way would be something more secure. The most secure is to screw it down to the rpi mounting holes itself. Theres 4 in the pi on the back. If you have a 2 long flat pieces of metal you can join these 2 in the back of the double din frame from left to right. Then drill 2 small holes in each and screw the pi into it from the back.
      I think screws are the sturdiest non-permanent fixture. All you need is a metal drill bit and some spare metal strips.

  • @djhazelzet
    @djhazelzet 5 лет назад

    Hi Rutger, gr8 story :).
    I have a VW T5 from early 2008, which doesn't have the right CAN modules and wiring to make my retrofit VW Golf 6 GP steering wheel work. The horn also doesn't work.
    What I'm wondering is, would part of this setup work connecting the USB output from the Arduino ATMega 32u4 to my Android 8 Radio?
    Or is there a way to hook up the ATMega to my Key 1, Key 2 and ground wires on my Android radio? My radio could then just learn the keys received.
    Thanks !

    • @florinedelestras3768
      @florinedelestras3768 2 года назад

      Hello Daniel, do you had a response ?
      I have a multivanT5 too and a 6-SWMF and search too use MF.

    • @kaoru007
      @kaoru007 Год назад

      If your headunit has SWC (steering wheel controls) input with auto learning feature, then you don’t need an Arduino as a middle man.
      Just connect your car’s steering wheel wires directly and proceed with the learning procedure.

  • @joepie879
    @joepie879 5 лет назад

    Hallo Rutger,
    Ben zelf hier ook mee bezig.
    Maar dan bouw ik het in de originele radio.
    Zou ik de originele knoppen van de radio ook op deze manier werkend kunnen krijgen?
    Mvg,
    Bas

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад

      Dat is een niveautje moeilijker. Wat wel vaak kan is dat je de cd of casette audiokanalen "onderschept". Zijn vaak simpele L+R audio kanalen die je kan afknippen en je eigen adapter tussen zet. Simpelste is bv een 3.5mm audiokabeltje er aan solderen. Moet wel de radio goed gedocumenteerd zijn zodat je weet welke pins de L en R audiokanalen zijn. Ook werken je radioknoppen dan niet nee.
      Of je moet helemaal improviseren en de front van je radio gebruiken en alle knoppen omleiden naar je eigen systeem. Belachelijk tijdrovend werk en heb je wel meer kennis voor nodig dan ik je kan bieden.

  • @johannesellenbeck8054
    @johannesellenbeck8054 Год назад

    Hey man, thanks a lot for the video, great solution. Would it be possible to,get in contact with you for some detailed explaination and more help?

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  Год назад

      Hi Johannes, specific questions or requests on here are fine of course, though the video is supposed to be the detailed explanation.

  • @sebastiengomez6005
    @sebastiengomez6005 4 года назад

    Bonjour,
    tu as fait un bon travail pour quelqu'un qui ne connait pas trop l'ARDUINO.
    j'ai regardé ton script et je ne trouve pas la définition Keyboard.h. Pourrais-tu le mettre en partage?

  • @MrMichael33b
    @MrMichael33b 5 лет назад

    How did you get it to play through the speakers without a radio? Most people on RUclips say you need an FM transmitter and run your sound through the factory installed radio

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад +1

      I removed the radio on purpose. Gives me more space and options. The stock radio used to simply connect with an internal factory amp to the speakers. I now have a custom amp hooked up to the speakers and drive the amp with a raspberry pi

    • @rbdesignsnh
      @rbdesignsnh 5 лет назад +1

      no. you dont, you install an aftermarket amp to drive the speakers, with the input hooked up to the pi output

  • @melle192
    @melle192 5 лет назад

    hey rutger,vraagje, mijn after-market stuurwiel bediening werkt niet goed samen met mijn pioneer radio. als ik op volume up druk veranderd hij van bron druk ik op mute gaat het volume harderenz enzik ben totaal geen verstand van elektrotechniek en hoop iemand te vinden die me kan helpen.als ik zo naar je video kijk denk ik dat je me goed kunt helpen.mocht je er voor open staan om me te helpen hoor ik het graag, uiteraard betaal ik alle onderdelen.melle

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад

      Hi melle, dat klinkt als een heel ander probleem dan in deze video. Een waar geen microelektronica aan te pas komt.
      De knoppen van een aftermarket bediening en radio moeten vaak worden gemapped aan bepaalde acties. Het klinkt alsof de default mapping niet goed staat. De meeste aftermarket headunits hebben ergens in de instellingen de mogelijkheid om de mapping aan te passen. Zoek even goed rond in het systeem en check evt website van pioneer hoe je de knoppen mapping aan kan passen.

    • @melle192
      @melle192 5 лет назад

      Mijn radio is van uit het systeem zelf niet aan tepassen. De knoppen ook niet. Ik denk aan een computertje dan tussen de knoppen en radio moet komen die de signalen vertaalt, ik zoek alleen iemand die dit voor me kan maken.

    • @rutgerdegraaf5277
      @rutgerdegraaf5277  5 лет назад

      @@melle192 ik denk niet dat het realistisch is of het waard is om dit custom te laten maken. Tenzij je een maatje hebt die je wilt helpen ligt het uurloon voor mensen die dit professioneel doen te hoog voor wat je krijgt. Als hobbyproject kan ik uiteraard zeker aanraden je te verdiepen in simpele circuits en te begrijpen adhv bedradings schemas wat er gebeurt in je auto en hoe zaken zijn aangesloten. Het lukte mij met enkel het internet en basis soldeer skills. Het luky jou zeker ook.
      En als je een concreet punt hebt waar je vast loopt kun je hier altijd een commentje achterlaten dan kijk ik of ik het antwoord voor je weet