Custom Raspberry Pi/Android Auto head unit with on-dash mounted display

Started by bobbe, February 14, 2022, 13:10

0 Members and 1 Guest are viewing this topic.

bobbe

Over the last few months I've been working on this project to add a custom head unit to my 2002 MR2. I initially wanted an Android Auto head unit mounted in the dash, but I concluded that the space in the dash for the stereo was too low down for my liking and would involve having to take my eyes off the road too much. So I decided to build a custom system that had all the computing stuff in the dash but connected to a touchscreen that sat on top of the dash, much closer to my line of sight. This is the result:





The core is a Raspberry Pi 4B running OpenAutoPro (which gives me wireless Android Auto), connected to the car via a CarPiHat, which gives a real time clock and safe shutdown.

The display is the 7" Raspberry Pi Official Touchscreen, which is a pretty neat wee thing. It sits on top of the dashboard but from my sitting position the top of it is below the line of the window, so it doesn't obstruct my view.

For this, I custom designed a steel enclosure to slide into the mounting frame for the Sony head unit installed by the previous owner and had it manufactured in 1mm steel. This has standard single DIN stereo dimensions and matches up with the locking mechanism in the frame, and allows the new enclosure to be removed using the standard Sony keys:



I also designed and had manufactured a steel frame that sits on top of the dashboard, held in place by 3M double sided automotive tape (the black surface in this represents the dashboard, which is annoyingly curved):



I then designed a 3D printed surround for the display (and painted, sanded, and polished it up to a nice finish):





The surround screws into the back of the display through the frame, which holds it all in place.

In the flat part of the rear of the surround you can see two square holes. The smaller is for a light sensor which automatically dims or brightens the screen depending on the ambient light. The bigger hole is for the latch mechanism for the lid of the dash cubby, holding it closed. The lid of the cubby can be opened and closed as normal.

Inside the cubby is wiring to connect the display and the light sensor to the Raspberry Pi:



These cables route through two small holes drilled in the back corner of the cubby and down into the head unit.

And I also designed a front panel for the enclosure which sits neatly in the dash, with two rotary encoders - one to control playback, the other to control volume:



In the top of the front panel, there is a RGB LED strip providing a nice orange down glow that matches the lighting in the rest of the dashboard.

Finally, I designed a custom PCB that sits between the car's stereo harness and everything else:



(Left is the top of the board, right is the bottom)

This does a few things:
  • First, it provides transient voltage suppression across all power inputs, which mitigates the risks of load dump destroying the electronics.
  • Second, as well as passing through the 12V constant and 12V switched lines to the CarPiHat, it takes the car's 12V power and provides two 5V pins and two 12V pins which can be used for various things.
  • Third, I have a standard four pin PC fan header on it that connects the data lines to the Raspberry Pi while drawing 12V from the car, which allows me to run a 40mm Noctua PWM fan drawing air out of the rear of the enclosure to ensure that heat doesn't build up.
  • Fourth, it provides a pull up resistor circuit that allows me to use a Sony RM-X4S steering wheel controller to control audio etc (which you can see lying on the floor in the first photo above, as I haven't got round to mounting it to the steering wheel yet). This is connected to an Adafruit Trinket M0 microcontroller running a custom Python script to interpret the inputs from the steering wheel controller (which is a simple resistor ladder). The microcontroller is connected to the Raspberry Pi via USB and works as a USB HID input device, which makes things quite straightforward

I have plans for a couple more additions to this:
  • I want at some point to add a reversing camera, which will probably be a Raspberry Pi camera connected through the rear bulkhead and mounted through the black plastics in the rear bumper, below the number plate.
  • I also want to add an OBD II reader as OpenAutoPro has OBD integration. I already have a bluetooth OBD reader, but I want to make a custom harness to connect it to the car's OBD port so that I can use a MOSFET to switch it on and off automatically wen the Raspberry Pi starts up and shuts down. I have the components I need and it should be a relatively easy job (splicing the MOSFET into an OBD extension cable and supplying a control signal from the Pi) and would allow me to leave the OBD reader permanently connected without worrying about battery drain.
  • I want a better amp as the one I have is a bit weedy, but it does the job for now
  • I'm also half planning to replace the OEM dashboard clock with a small (orange!) OLED display hooked up to the Raspberry Pi that will show the current time as well as outside temperature and other info, probably with a button to cycle through information. For that I should be able to use a 1 wire temperature sensor, so hopefully not too difficult


All in all this has been a fun little project that has kept me busy for a couple of months. I don't have a background in any of this stuff (other than a bit of coding in the past) so I was very much starting from scratch and learning as I went. I think it's turned out pretty well! This was all done in Fusion 360 and Eagle (for the PCB) and I'm happy to share any of the design files with anyone who wants them.

Carolyn

Perry Byrnes Memorial Award 2016, 2018.  Love this club. 
https://www.mr2roc.org/forum/index.php?topic=63866.0

J88TEO

Great!
How about producing a batch for members who may be interested?

bobbe

Sadly I'm moving into a smaller flat without the outdoor space for spraying, etc so that's not something I'd be able to do, but like I say I'm happy to provide the designs for anyone who's interested

Carolyn

I think we have another lady engineer amongst us!  Super dooper!!
Perry Byrnes Memorial Award 2016, 2018.  Love this club. 
https://www.mr2roc.org/forum/index.php?topic=63866.0

McMr2

Quote from: bobbe on February 14, 2022, 13:10Over the last few months I've been working on this project to add a custom head unit to my 2002 MR2. I initially wanted an Android Auto head unit mounted in the dash, but I concluded that the space in the dash for the stereo was too low down for my liking and would involve having to take my eyes off the road too much. So I decided to build a custom system that had all the computing stuff in the dash but connected to a touchscreen that sat on top of the dash, much closer to my line of sight. This is the result:





The core is a Raspberry Pi 4B running OpenAutoPro (which gives me wireless Android Auto), connected to the car via a CarPiHat, which gives a real time clock and safe shutdown.

The display is the 7" Raspberry Pi Official Touchscreen, which is a pretty neat wee thing. It sits on top of the dashboard but from my sitting position the top of it is below the line of the window, so it doesn't obstruct my view.

For this, I custom designed a steel enclosure to slide into the mounting frame for the Sony head unit installed by the previous owner and had it manufactured in 1mm steel. This has standard single DIN stereo dimensions and matches up with the locking mechanism in the frame, and allows the new enclosure to be removed using the standard Sony keys:



I also designed and had manufactured a steel frame that sits on top of the dashboard, held in place by 3M double sided automotive tape (the black surface in this represents the dashboard, which is annoyingly curved):



I then designed a 3D printed surround for the display (and painted, sanded, and polished it up to a nice finish):





The surround screws into the back of the display through the frame, which holds it all in place.

In the flat part of the rear of the surround you can see two square holes. The smaller is for a light sensor which automatically dims or brightens the screen depending on the ambient light. The bigger hole is for the latch mechanism for the lid of the dash cubby, holding it closed. The lid of the cubby can be opened and closed as normal.

Inside the cubby is wiring to connect the display and the light sensor to the Raspberry Pi:



These cables route through two small holes drilled in the back corner of the cubby and down into the head unit.

And I also designed a front panel for the enclosure which sits neatly in the dash, with two rotary encoders - one to control playback, the other to control volume:



In the top of the front panel, there is a RGB LED strip providing a nice orange down glow that matches the lighting in the rest of the dashboard.

Finally, I designed a custom PCB that sits between the car's stereo harness and everything else:



(Left is the top of the board, right is the bottom)

This does a few things:
  • First, it provides transient voltage suppression across all power inputs, which mitigates the risks of load dump destroying the electronics.
  • Second, as well as passing through the 12V constant and 12V switched lines to the CarPiHat, it takes the car's 12V power and provides two 5V pins and two 12V pins which can be used for various things.
  • Third, I have a standard four pin PC fan header on it that connects the data lines to the Raspberry Pi while drawing 12V from the car, which allows me to run a 40mm Noctua PWM fan drawing air out of the rear of the enclosure to ensure that heat doesn't build up.
  • Fourth, it provides a pull up resistor circuit that allows me to use a Sony RM-X4S steering wheel controller to control audio etc (which you can see lying on the floor in the first photo above, as I haven't got round to mounting it to the steering wheel yet). This is connected to an Adafruit Trinket M0 microcontroller running a custom Python script to interpret the inputs from the steering wheel controller (which is a simple resistor ladder). The microcontroller is connected to the Raspberry Pi via USB and works as a USB HID input device, which makes things quite straightforward

I have plans for a couple more additions to this:
  • I want at some point to add a reversing camera, which will probably be a Raspberry Pi camera connected through the rear bulkhead and mounted through the black plastics in the rear bumper, below the number plate.
  • I also want to add an OBD II reader as OpenAutoPro has OBD integration. I already have a bluetooth OBD reader, but I want to make a custom harness to connect it to the car's OBD port so that I can use a MOSFET to switch it on and off automatically wen the Raspberry Pi starts up and shuts down. I have the components I need and it should be a relatively easy job (splicing the MOSFET into an OBD extension cable and supplying a control signal from the Pi) and would allow me to leave the OBD reader permanently connected without worrying about battery drain.
  • I want a better amp as the one I have is a bit weedy, but it does the job for now
  • I'm also half planning to replace the OEM dashboard clock with a small (orange!) OLED display hooked up to the Raspberry Pi that will show the current time as well as outside temperature and other info, probably with a button to cycle through information. For that I should be able to use a 1 wire temperature sensor, so hopefully not too difficult


All in all this has been a fun little project that has kept me busy for a couple of months. I don't have a background in any of this stuff (other than a bit of coding in the past) so I was very much starting from scratch and learning as I went. I think it's turned out pretty well! This was all done in Fusion 360 and Eagle (for the PCB) and I'm happy to share any of the design files with anyone who wants them.

This is the business.
 
2004 Silver. Stock(ish).

Ardent


1979scotte

I couldn't even be bothered to wash mine let alone do all that.

Well done you.
First they came for the socialists, and I did not speak out—because I was not a socialist.
Then they came for the Jews, and I did not speak out—because I was not a Jew.
Then they came for me—and there was no one left to speak for me.

Free Ukraine 🇺🇦

Joesson

@bobbe
Very well thought out and executed. I particularly like the automatic compensation for ambient light, great attention to detail, seldom seen in a one off and thank you for sharing with those that may follow your lead.

puma2

 :) master piece in the making  8)  8)
the time and effort was well worth it O:-)  O:-)

TheTigerUK

Very well executed !! as I keep being told there are never two MR2s alike :)
Say it with love, say it with flowers but never, never, say it in writing.

                                     The idea is to die young as late as possible :)

Tags: