Have an old DVD player laying around? I did, and I wanted to do something fun with it. So I jammed a Pi Zero W inside and installed Libreelec with KODI on it so it can play movies off a thumb drive!
Tools you'll need:
- Possibly some knowledge of Python or coding (if you don't have this exact DVD player)
- How to use a command line
- Multimeter- a MUST
- Soldering iron with a fine point and solder (obviously)
- Hot glue gun
- Electrical tape
- Hobby razor / exacto knife
- Wire snips
- Steady hands, patience, and good self-regulation
A bit of warning-- this is a fairly involved and technical instructable. If you attempt this, do so with the understanding you could very well end up with a dead portable DVD player (I did on my first try). Especially if you're trying this on a different brand/model of DVD player. It's okay though, you weren't using that old piece of junk anymore anyway.
Step 1: Grab Your Parts!
- The most important part is the portable DVD player itself. Preferably a Panasonic DVD-LS### model. This might work with others brands/models, but I have no idea. You're on your own in that case. So if you don't have one and you really want to do this for some odd reason you can find these selling used on ebay for $40-$50. The model I used for this mod is the Panasonic DVD-LS850. This build will vary based on the model player you have. ***The DVD player you use must have a composite auxiliary in port.***
- A Raspberry Pi Zero W ($10). (If you want to use a Pi Zero, you'll need more USB ports and a bigger hub)
- You'll need a USB hub of some kind. I had this one that needed a home. It's $10, and it nice and small- perfect for cramming into places it's not meant to go.
- Next, I would recommend a USB sound card. You can get analog sound off the Pi, but it sounds awful. Get one of these. They're on Amazon for ($5). Links to follow...
- You'll need an MCP3008-I/P Analog to Digital Converter (ADC). ($6) These work by taking in an analog signal (voltage) and sending a corresponding relative digital value to the Pi.
- A micro SD card with Libreelec flashed on it.
Step 2: Strip the USB Hub
This little thing breaks down quite nicely. With some finagling you can pull the USB headers off by hand leaving behind just the metal pins. It's super simple to de-solder those one by one. At the heart of the gadget is this tiny PCB 2xUSB hub.
Here it is for $10 on Amazon.
Step 3: Strip the USB Sound Card
This is the cheapest USB sound card I could find. Use a screwdriver or something thin to crack the plastic case. It's poorly made so it will easily fall apart. Then all you have to do is de-solder the jacks. They're barely attached to the PCB so you can make quick work of them. You won't need the microphone input, but it's hard to find USB sound cards this cheap without them.
Here it is for under $5 on Amazon.
Step 4: Get Yourself an ADC
Specifically, this 8-channel analog to digital converter - the MCP3008:
Here it is for $6 on Amazon
The DVD player buttons work by sending varying levels of voltages (0v - 3.3v) through 5 different channels depending on which button you press. So you CAN'T connect them directly to the GPIO on your Pi. You will need to convert the voltages to digital packets of data that the Pi can understand.
Step 5: Project Layout
Here's how I connected everything.
I tapped the DVD logic board for a 5v power source to run the Pi. Then I connected the TV pins from the Pi to the AUX video in on the DVD player and the USB sound card audio to the AUX audio in on the player. To see the Pi, you press the AUX button on the DVD player to switch between the DVD player (which I left intact) and the auxiliary in.
Step 6: Find a 5v Power Source
I used my multimeter to test various pads on the DVD player's logic board until I found one that read ~5v when the power to the DVD player is on and 0v when the power to the DVD player is off. This is important. You don't have your Pi to run when the DVD player is "off", just sucking the battery down. You should also test that the pads are live at 5v when the DVD player is plugged into the wall, or running off battery power.
***BE CAREFUL you don't short a connection with your multimeter probe or you will blow a fuse on the DVD's logic board. If you do that, all is not lost, you can track down the teeny fuse with your multimeter and jump it with a bit of wire.
Once you find your power points, solder your wires in place, and hot glue those suckers down because you don't want to rip out the pads. Connect your power and ground wires to Pi. I connected it to a 5v and GND pin on the Pi's GPIO, but you could solder them to the USB power pads if you are afraid of frying your Pi. (I used those pads to provide power to the USB hub, but you could use the 5v GPIO for that purpose if you go this route.)
Step 7: Sniff the Buttons
Through trial and much error, I was able to figure out how button presses are registered on this player. You can not connect the buttons to the Pi's GPIO directly. They are not momentary switches. They work by providing analog signal to the logic board over five separate channels.
There are several points you can use to tap into the channels that provide the button voltages. This model of player had some test pads I could solder little wires to. The only buttons I couldn't locate pads for were the Fast Forward and Rewind buttons since they were on the opposite side of the board from the button PCB. They were integrated right into the logic board where as the other buttons were on a separate PCB. I had to wire directly into the voltage+ joint of the Fast Forward button.
I won't get into wiring up the MCP30008 here since there are good resources out there that show you how to do this. I will note that ***thepower/GND pins on the MCP3008 should be hooked up to the DVD player 3.3v/GND pins and not the Pi since we are powering the Pi from the player. I was able to find pads for the 3.3v and GND right next to the pads for the button channels I used (the red and black wires among the blue).
***Use your multimeter to check and re-check your solder joints to make sure you don't have any jumps between wires, or you're gonna have a bad time*** Once you're confident in your soldering, GLUE IT DOWN so you don't rip any pads up. PEOPLE, I can not stress this enough. These pads were not created to be soldered on to by some modder 20 years in the future. They are fragile and will pull up if stressed.
Step 8: Connect Up the USB Hub
Connect your various USB thingies. This is basically just like plugging USB peripherals into a hub but instead of plugs you're using solder. Make sure to provide power to the USB hub using a 5v source on the Pi. Not much else to add here. You should probably color code everything to avoid confusion. Standard USB colors are Red (+5v), White (Data +), Green (Data -), Black (Ground).
Step 9: Hook Up the A/V Signals Then CRAM
Wire the A/V lines
You will have to use your Pi's TV pins to get an analog video signal. Here's an explanation on how to do that. Hook up the video signal to the DVD player's AUX video in, by soldering to the 3.5mm jack's solder points on the underside of the PCB. Then hook up the USB sound card audio to the AUX audio in in the same manner. ***I should note that different models of DVD player have different ways to hook into their AUX port. I used the RCA cable that came with it and a multimeter to make sure I was soldering my wires into the correct spot (tv signal+, GND, audio left, audio right).
Cover up any metal that could touch the DVD player's grounding plate with some electrical tape to prevent shorts. I just had to cover the back side of my Pi.
All that's left to do before software stuff is to test fit the bottom case, making cuts where needed to get things to fit. You'll also have to cut out a hole for the external USB port. Once you've got everything fitting nicely GLUE YOUR COMPONENTS DOWN. Be careful not to use too much glue. You want to leave everything low profile so you can still fit your bottom cover once the glue is in place. Cram like you've never crammed before. If you are good, you might not have to cram at all. I was not good. I crammed. And as always- don't cram too hard or you might break something.
Step 10: Fire It Up
I hope you've been testing each step along the way to make sure the Pi powers on and feeds an A/V signal to the DVD player's AUX port. Because if you power on and nothing happened, you should probably go back to the first step of this instructable. And get out your isopropyl alcohol because you're gonna need to take a nice strong whiff of it and start rubbing it all over your hot glue to remove it. You'll also be lucky not to rip up any pads on the PCB if you have to do this. Work delicately.
Plug in a mouse to your external USB port and hit the ON button. If all goes well, you will be greeted by a Libreelec splash screen followed by KODI and a few bleep bloops letting you know you didn't screw up your audio. If you hear nothing you probably have to configure KODI to use your USB audio.
As you configure KODI, you'll want to make sure ssh is enabled and set up your network connection, because we're gonna need to do that stuff next. Once you're connected to the network take note of you DVD player's IP address.
Step 11: Install Raspberry PI Tools Program Add-on in KODI
You'll need to install a KODI add-on called Raspberry Pi Tools because this installs the python GPIO library we're going to need to read the output of the MCP3008 ADC.
To get it, go into the Add Ons menu and select Download. Find 'Program add-ons' and select it. You'll find Raspberry Pi Tools in the list that follows. Select and install it.
Go ahead and power cycle your Pi at this point.
Step 12: SSH Time and Button Time
Get these files on your DVD player
Open your favorite file transfer client (I use Fetch on Mac) and connect to your DVD player. User is root and password is libreelec.
- drop the test_adc.py file into the ~/downloads directory
- drop the autoexec.py file into the ~/.kodi/userdata
autoexec.py is a python script that runs at KODI start up. You can use it to send commands to KODI. We will use this to translate our button presses into actions in the KODI GUI.
Figure out the button voltages and channel they're on:
Go to another computer and SSH into your DVD player. To ssh into libreelec:
>ssh root@DVDPLAYER_IP_HERE password: libreelec
Once you're logged in navigate to the downloads directory and run test_adc.py
Start pressing the buttons on your DVD player! When you press a button your ssh terminal will print out what channel the button is on and what the voltage the channel drops to when that button is pressed. If you aren't using my exact model of DVD player, write down these channels and voltages. You're going to need them when you inevitably must edit the autoexec.py file.
Step 13: Edit Your Autoexec.py File
If you don't have a DVD-LS850 the final thing you must do is edit the autoexec.py file. I'm sorry, but if you made it this far, I am super impressed and you are obviously very smart for figuring out my rambling instructable. That said, I imagine you can figure out how to modify the autoexec.py file to work with your DVD player. I actually do have an autoexec file that will work for a DVD-LS86, so I guess I'll put it here because why not. Obviously, you'll have to rename it to just autoexec.py before putting it on your Pi.