Introduction: CoPiLot : Mobile Media Center PC
This project is basically a home theater PC (HTPC) built to be used in a vehicle so it is mobile. I had been calling it an MTPC, but my kids just call it "The Little Black Keyboard" when they ask to use it.
My wife's Dodge Grand Caravan came with a really great entertainment system, but I thought I could make it better. It plays mp3 and other audio files from a hard drive built into the double DIN dash unit, but for video it can only play DVDs and it can't store video files. This means you have to carry a bunch of DVDs around, cluttering the car.
I wanted a way to play files from a thumb drives instead of from disks because there is less possibility of the disks getting ruined or lost. There is also the added benefit of the kids being able to change the movie from the back seat, so they don't have to wait until the passenger can change the disk and the passenger doesn't have to read the movie list for the viewers. On long car trips, this thing is a huge help.
Some minivans are starting to include HD entertainment systems, but the 2013 Caravan wasn't one of them. There are 3 RCA inputs behind the left sliding door, so if I was going to play movies I needed an analog source (which is increasingly difficult to find these days).
I have had a Raspberry Pi B+ that I bought to tinker with and use as an Octoprint 3d print server, but I thought I needed something like the Pi model B because it had the 1/8" headphone and the yellow RCA for analog video. Then I discovered that the 1/8" connector on the B+ is actually a 4 conductor jack that provides stereo audio and video as long as you have the right cable to use it. Since we were planning a family roadtrip, I quickly threw this thing together and I was really pleased with the result. If you bring an HDMI cable along for the ride, you can even use it to play movies when you stop in a hotel.
Step 1: Parts
- The Pi 2 model B is recommended for OSMC, but I am running this on a Raspberry Pi B+ with only a little overclocking and there is very little hesitation
- Micro SD card
- Pi A/V cable or a 4 conductor 1/8" jack or HDMI cable if your car can accept that input (the Pi 2 model B uses the same cable as the B+)
- Large capacity thumb drives (mine is 64gb and holds about 60 movies). If you look around you can find some that are very low profile made by Sandisk and the other big brands.
- USB wifi adapter (I got this USB Wifi adapter for about $5 on a website named after a South American jungle/river)
- USB remote/mouse/keyboard (your pick - there are a dozen you can get on the same website for less than $20. I picked this keyboard because it had a rechargeable battery and the keys could be backlit which I thought would be easier to use in the car. The battery held a charge for over 2 weeks while on an extended road trip without being recharged.)
- HDMI cable (optional)
Step 2: Pi A/V Cable
I have a few of these 4 conductor 1/8" jacks to RCA component cables lying around, but unfortunately they don't follow the right standard to work with the Pi. I could cut them up, but then they wouldn't work for what they came from originally (Roku, camcorder, etc).
I went to my local electronics shop and found 2 replacement 4 conductor jack ends that I could splice into a regular RCA to RCA patch cable. As TVs get more and more HD, these cables are less and less useful. I decided I could use a longish cable and a very short one for the Caravan. With a short cable, I wouldn't have to wind the wire around the mounting bracket in a messy ball of wires.
These plugs didn't want to take my flux core solder at all, so I had to use some extra flux. I had some plumbing flux laying around and sure enough, it works great on electrical connections. Without the extra flux, I might have melted the delicate plastic insulation between the leads on the plug.
I found a retractable iPod A/V cable but I didn't know if the pins would match the layout I needed for the Pi. (they did in this case, but it doesn't hurt to be careful, there are a lot of competing standards here)
I found the pinouts were similar enough that they would work (left and right audio channels may be swapped).
I also bought a couple of these retractable USB micro cables to make the power connection neater as well, but it still hasn't been delivered.
Step 3: Printed Raspberry Pi Case
I like this case because it is simple and prints in the fewest pieces of all the cases I've found. The Pi slides in from the top and still has all the necessary ports accessible.
This version is for the Pi B+ and the Pi 2.
The version above for the Pi 2 and the original have a great following and there are plenty of mounting brackets already made for them. If my bracket on the next page doesn't work for you, one of these might.
Step 4: Mounting Bracket
The Caravan has a little panel behind the left middle seat with connections for video, AC and DC power. The Pi will run off of most USB power sources, but I am choosing to use the AC jack for the power adapter, and the DC adapter as a mounting point to hold the Pi in place. The AC outlet is controlled by a switch on the dashboard, so if it is plugged into this outlet it can be turned off when not in use. This will also help to prevent the Pi from booting and rebooting when you start the car.
At first I used a customizer I found on Thingiverse to make a cord reel to hold the wires neatly around the Pi case. The customizer wasn't making exactly what I wanted so I decided to make my own, borrowing the smooth curved design and adapting it to the dimensions of the case I already had printed. I attached a cigarette lighter plug I also found on Thingiverse as a mounting bracket. Unfortunately, the road trip came while I was still tinkering with the dimensions so to clear the plugs on the input panel in the car, I had to glue an old version to my best reel as a spacer.
The new version of the bracket is twice as long, and thinner at the bottom so it won't get in the way of the wires and other protrusions in the tight space. I attached the file to this step and I also posted it on Thingiverse.
Step 5: OSMC and Kodi
Kodi is a great media player which comes from the XBMC project that came out of the original Xbox modding community. Since then a lot has changed and the name no longer made any sense, so it is now Kodi. Kodi runs on a lot of different devices, but a group has made a Linux distribution for Raspberry Pi that is centered around Kodi and making the best media player and media manager it can be.
Make your card image
- Download the card image
- Download an image writing application and install it (I used Win32DiskImager)
- Load the card image and insert a micro SD card to write to.
- Connect the Pi to a TV with a keyboard and mouse and follow the prompts to complete the install.
There are only a few changes that I had to do to after the initial setup.
- Connect the Pi to your wireless network. This was easier for me with the on-screen keyboard. For some reason, the external keyboard was not allowing me to type the wireless key in successfully.
- Turn up the text size for viewing on standard definition video.
- Resize the screen from the menu options so you can see the white corners. For me, the analog signal was still a little off after calibrating the screen on the HDMI cable. If you are using the analog cable, you should probably just calibrate the video with that signal.
- I was tempted to use this auto-resume script that I found, but I decided not to risk the corruption and just shut the Pi down normally each time.
- Test the video files you have. In my case, I found that MP4 files worked best and the software codecs had no problems decoding the video. I have seen the Pi lock up with other MPG files. I read that you can improve mpeg playback by paying for a key to unlock hardware decoding in the Pi, but it wasn't necessary with the MP4 files.
Step 6: Assembled Unit
I am very happy with how this turned out. My 8 year old daughter has become an expert at navigating the menu, picking and controlling the movie playback, and shutting the Pi down when we are ready to turn the car off. She managed to learn the controls on this little keyboard in the dark after only a few minutes.
I have read that the micro SD card can be corrupted if you shut the Pi down unexpectedly, so I always make sure that it is shut down before we turn the car off. Because the Pi would get power if the key is in the ignition, you have to be a very deliberate about how you leave the AC inverter switch when you turn off the car. If we shut the Pi down through the software, I wait for the little pop in the speakers that tells me that the Pi has suspended and then I turn off the AC inverter. This way I can make sure the Pi doesn't come on, then go off, then come back on again when the car is started again.
A few missing features have come to mind since we've used this system in the car. First, the audio in the car has to be turned all the way up (24/30) in order to hear the audio from movies that you play. This varies from movie to movie, but it is usually a drastic change when you turn the Pi off and the audio changes back to the radio. I think I need a small pre-amp to amplify the audio just a tiny bit before it goes into the car.
Another thing missing is a battery or capacitor backup. It would be really cool to have a circuit with a minute of backup power that when called upon, would start a 30 second timer. If the power isn't restored in 30 seconds, the circuit would send a signal to the OS to trigger the shutdown process. This would protect against the momentary power interruptions like starting the car and would power the Pi down correctly every time you shut off the car.
These ideas are a long way off, but I would like to get there with this project.
Participated in the
Full Spectrum Laser Contest 2016
Participated in the
Hack Your Day Contest
Participated in the
Raspberry Pi Contest 2016