DIY Android Auto Headunit

November 2016

Ever since Google had announced their Android Auto project, I have been dying to try it out. I have always felt that when one needs to use their phone for music, navigation, and calls in the car, the result is usually a mash-up of solutions that sometimes tend to not play very well together. Since I would want to listen to everything from my phone, most head units were just a Bluetooth amplifier with countless other options that I did not want nor need. Some head units advertised music over USB for Android devices, but it hardly ever worked, and if it did, it certainly would not work for services such as Google Play Music, Pandora Radio, or SoundCloud. I have even tried MiraCast devices, but found it to be too buggy to be useful. This meant that if I wanted a truly unified solution, I would either have to buy a new car with Android Auto integrated, or gamble on a poorly reviewed $700+ Android Auto head unit. Not happy with either of those options, I looked to create a third. I recently ordered myself a Pixel phone to upgrade from my original Nexus 6. This left me with a device with a 6" touchscreen. After I noticed that the Nexus 6 fit almost perfectly in the double-DIN area of my dashboard, I begin to look for a solution.

It was not too long until I found the Headunit Reloaded project on XDA Developers, which basically can make any Android device act as an Android Auto head unit. Android Auto itself works in two parts. Your client(phone) and the server(head unit). The Android Auto app on the client does all of the processing, and runs the app locally. However, instead of displaying the result on the client's screen, it displays it on a "virtual screen." This virtual screen is just streaming video to the Android Auto server, which displays it as an H.264 stream, as well as send GPS, sensor, and touchscreen data back to the client. This is all sent over a USB cable(although Android Auto does have an unsupported and unfinished Wi-Fi option). This is great for OEMs who wish to integrate Android Auto, since they do not need a device powerful enough to run the latest Android OS; they only need to provide a terminal that can receive and display a H.264 stream.

This app works by emulating a legitimate Android Auto head unit by starting an Android Auto server on the head unit phone, as well as starting a local app to receive a video stream from the client phone. And since everything is streamed from the client phone, the head unit phone(Nexus 6 in my case), does not need any cellular or Wi-Fi connection to operate. 

(Note, during the process of building this, Google had released Android Auto 2.0, which included a standalone mode, allowing you to run the Android Auto server and client software on the same device. While this was a long-awaited feature for many people, it fell short of solving many of my problems. The standalone interface was much clunkier than the traditional interface, and it would display on my Pixel phone, meaning that I could not build it into the dashboard, and I would also have to connect my phone to a charger, connect it to the car radio, and start the app every time before driving.)

After taking measurements of the opening in my car's dashboard, I began designing a case that I could 3D print to hold my Nexus 6. To aid in the process, I found a model of my Nexus 6 on GrabCAD. This was a huge time-saver, as I was able to import the Nexus 6 into an empty assembly in Autodesk Inventor Professional, and build parts off of faces of the phone, while referencing its geometry.

I decided to design the case in three portions. 
  • The first was an easily detachable front panel. This panel had slots for the phone's speakers (since they had raised grilles), and two small slots so that if needed, I could insert a flat head screwdriver and press the power or volume buttons without removing the panel. 4 3mm holes were placed for securing the panel with M3 machine screws.
  • The second portion was the back of the case. This needed to hold the phone securely, but allow me to attach other components, a fan if necessary, and to keep it relatively open for airflow. I was able to pause the print and add M3 nuts that became fully embedded in the print, providing a solid threaded area for the front panel.
  • The final portion was what I call the interface pieces, which would bolt to the back of the case, and also to the car's head unit mounting points. It would be the piece that holds the phone exactly where it needed to be to sit flush within the dashboard.

Designing it this way had many benefits. The first was that if I had to redesign a portion of these parts, it would not necessarily mean that I would have to re-print everything. It also means that the Nexus 6 case was modular. If I ever bought a new car that also had a double-DIN mount, I would only have to design and print new interface pieces to bolt to the back of the case. Lastly, since the case and interface pieces bolt together, slots could be added to allow for minute adjustments, rather than having to re-print to shift the phone a few millimeters.

After printing the case pieces, I decided to test fit inside the trim for my car. The panel fit perfectly. The phone was not centered from top to bottom so that if I wanted to add any physical buttons or knobs under the screen, I would have some room.

At this point, my Pixel phone came in, so I was able to test the Headunit Reloaded app and the Android Auto functionality. 

I then printed the interface parts, and was able to do a dry fit of the parts in my car. 

Back Case and Interface Pieces Bolted Together

Bolted Into Factory Stereo Location

Perfectly Fits With Trim Installed

I was very pleased with the fitment, and was glad that I left room for adjustment. It was very difficult to take precise measurements, since many of them had to be "air measurements," where you have to hold a ruler in the air and eyeball where you think two pieces line up on a specific plane. 

Initially, I thought the most difficult part would be physically fitting my Nexus 6 in my car, but it turns out that was one of the easier pieces of the puzzle. 

Since I would be completely removing the existing stereo head unit from my car, which had a built in amplifier, I was going to have to use some other equipment to replace it. These are the parts I used to make the system operable. Some of them, like the phone and amplifiers, I already had lying around, making it much more cost effective. As an added bonus, the previous owner of my car fully wired the car to keep both amplifiers in the back of the car.

As I was receiving parts, I found the first setback. My original plan was to use the above linked USB OTG Hub, as it advertised that an external adapter would charge the host device, as well as the slave devices. Unfortunately, however, due to the Nexus 6's kernel configuration, this is impossible. When this hub is plugged into the phone, it will only operate as a charger, or as a hub, depending on what order the devices were plugged in. Some devices have modified kernels that could be downloaded to patch this(like the Nexus 7), but the Nexus 6 does not. To work around this, I tore apart an old Qi wireless charger, and bolted it to the back of the phone case. Once I wired it into a switched input, it would charge my Nexus 6 via Qi, while allowing the USB hub to operate. I also had to remove the 5v line going from the Nexus 6 to the USB hub to prevent the hub from trying to charge the phone, and thus disabling USB.

I still needed to find a place to mount the volume knob, as well as the USB port for plugging in my Pixel. My original plan was to put them directly beneath the screen, but I then decided I could move them to a much nicer location. I had no use for the built in ashtray, so I cut the front of it off, and replaced it with a 3D printed panel for the volume knob and USB port. It then slides right in to my dashboard.

At this point, it was time to configure the Nexus 6. I used Nova Launcher to remove my lockscreen, and keep the home screen in landscape mode. I also found a simplistic, mostly black wallpaper, which keeps the screen nice and dim. The home screen would be displayed whenever the car was on, but my Pixel was not plugged in. 
In addition to the Headunit Reloaded app mentioned above, I installed an app to enable Double Tap to Wake, and Tasker, with a profile set to turn the screen on(and keep it on) while it was connected to the wireless charger, and turn the screen off 15 seconds after the wireless charger was disconnected(when the car turns off).

Finally, my project is (mostly) complete, and fully functional!

There are a few things I would like to do in order to improve upon this project. The most important improvement is some filtering. Not only am I picking up alternator noise on the audio lines, but I am also picking up noise from the wireless charger and USB hub. I am currently working on the filtering, as seen on my other page. I would also like to add some physical buttons to my car, preferably my steering wheel. The Headunit Reloaded app can trigger media controls, as well as "OK Google" from a USB keyboard. Rather than the keyboard, I want to use an Arduino with a V-USB, to act as a keyboard, with just the buttons I wish.