CarPC – Corsa D – Part 2: Interfacing radio buttons

One main thing I wanted was buttons from the factory radio to work with Kodi (XBMC). I will also have steering wheel controls, but working radio buttons is damn cool!

Corsa D Radio Buttons

I had some ideas in my head. I started with what I had – Raspberry Pi. It has GPIO pins. You can use them to interface buttons with your software, like Kodi. And that was one approach. One other idea that clicked in my head was – keyboard controller. It has 100+ key commands you can use, it’s dead simple to interface with Raspberry Pi – via USB, it’s also very easy to set them to work with XBMC, just edit the keymaps. Also, the best thing – GPIO pins will remain free for other modules.

I started with finding compatible keyboard with your Raspberry Pi (most work, but be sure to check). I have disassemble it, and checked where each key on the keyboard goes in which pin – this is best done with continuity tester. I had this option on my multimeter. You can also do it with tracing the etched conductive tracks, but it’s harder. I had 2 separate connectors on my USB keyboard controller, lets call it A and B. A has 20 and B has 8 pins. Combination of some A and B pin gives number/letter or special character. For example – A1 pin and B4 pin gives letter A. I think this is keyboard model specific so you better check each key one by one.

zPjzJTx

Then, I rewired all 20 buttons on my factory radio. I first started on having independent wires on each button, but then I realized I can use one common wire for 9 buttons, that means 3 common wires for entire board.  That also means reducing the number of wires.

I got my breadboard with all connections from the USB controller lined up. I used it for testing each button separately to check it if it works directly in Raspberry Pi.

yejDO2A

I made my final connections, soldered them and put several layers of heatshrink, just to be sure. Those 5 wires still sticking out are from the rotary encoder. They will remain like that for now, because I still have to find a way to connect it to the Raspberry Pi to act as a volume control.

KhlYjOO

Here is the USB keyboard controller placed in the radio enclosure, taking minimal space. I removed the CD circuitry as I won’t use it from now on since I’m installing CarPC, and also I needed space for Raspberry Pi and it’s modules.  And this is the perfect space.

OGGEeaW

I programmed the keys in Kodi with it’s official Programs add-on Keyboard Editor. They work flawlessly. I’m very happy with the results.

 

 

 

2 thoughts on “CarPC – Corsa D – Part 2: Interfacing radio buttons

  1. Andrei

    WOW! I was looking for that. But I have no idea how to work with breadboard and where should I start. My idea is to pull out all of the contents of my 1din car stereo out, replace them with RPi and power it with my 1TB 2,5” HDD. The only thing is, that I don’t want to use touchscreen as a main control and be able to use rotary knob to control the volume, use open/close screen panel button, play, pause etc. Could you please advise how could I do it? You example showed that it can be done, but how? Would you be able to explain me in details? That would be much appreciated.

    Reply
    1. Dimitar Post author

      Hello Andrei! If you plan on using Kodi as a media player on your Raspberry Pi this is the easiest and the best method. You will need a USB keyboard and remove its controller.
      You don’t have to use a breadboard, but using one is easier to track the different combinations to send keystrokes to the RPi.
      You can see on the pictures that I used one common wire for more buttons plus one wire per button. That way you can save on wires haha :).
      There is an addon for Kodi/XBMC called Keymap Editor where you can map the keys for each action. For example key ‘a’ to be Next, key ‘s’ Previous, key ‘d’ Play/Pause, key ‘f’ Mute and so on.
      For finding out the keystroke combinations I just plugged the USB keyboard controller on PC and opened Notepad.
      I haven’t figured out a way to connect the rotary encoder fitted on my stereo, but it should be simple with standard rotary knobs available for RPi or Arduino.

      Reply

Leave a Reply

Your email address will not be published. Required fields are marked *