Stellaris LaunchPad Composite Video Line Multiplexer

Posted by Jarren Long at 2013-01-07 21:21:07

After five days of next to non-stop school and work (sleep? what's that?), I've decided to take a few hours for myself to relax and do some R&D on my first Stellaris LaunchPad project, a USB Composite Video Line Multiplexer. For the less than geeky out there, you can think of this as a KVM switch for RCA video devices (remember the Red, White, Yellow cables that used to go into the back of your Standard Definition TV? They're still pretty popular...). Why would I want to revive a dying technology using cutting-edge hardware? Simple: I was robbed for the 5th (count them: 1, 2, 3, 4, 5) time since moving into my house (just shy of 8 months ago). Argh!!! Naturally, my response to this rash of repeat crime was to (call the Spokane Police Dept? Nah, I'd rather not get shot) stop by my local hardware store and pickup an array of security lights, cameras, and motion sensors/alarms. Two hours and $200 later, any motion within 50' of my house will light up an entire city block (all non-drug addicted neighbors cleared it, said they didn't mind waking up to summer-time daylight at 2AM in November, awesome people), sound an alarm, and immediately target the motion source using two mechanized 5.56mm SARs (of my own design) with rubber rounds (overkill? No kill, they're rubber...Excessive show of force? Maybe... ).

Impressive security system for cheap? Very much so. :) Back on topic: After installing my new system, I realized I had one major problem: The cameras I picked up both stream NTSC (black & white) video and single-channel audio over Yellow/White RCA cables. No problem. My (borrowed) TV only has one RCA input. BIG PROBLEM!!! How am I supposed to monitor two security cameras, let alone record the A/V they capture with only one RCA input?

  • Idea #1: Just unplug one camera and plug the other in. Results: Horrible idea, pain in the ass, and the cables are cheap and already getting loose after a few connections.
  • Idea #2: Get a TV/VCR/DVR with 2+ RCA inputs. Results: I managed to carry my ancient 32" RCA CRT TV up two very narrow flights of stairs, only to find out that it takes ~45 seconds to fully switch from Line 1 to Line 2. Better, but still a pretty big delay, and I can still only record one line at a time using the built-in VCR.
  • Idea #3: Go drop a few grand on a real security system. Nope. Won't do it.
  • Idea #4: Wait! I'm an engineer! DIY multiplexer to the rescue!

So, what is a multiplexer? From Wikipedia: In electronics, a multiplexer (or MUX) is a device that selects one of several analog or digital input signals and forwards the selected input into a single line. To simplify: A MUX allows you to have multiple input lines, and then select which one will be forwarded to the output line. In this sense, your typical bathroom sink is a MUX, allowing you to select whether you want hot or cold water. Awesome, this is (a fraction of) exactly what I need!

To refine the idea further, this device will need to be able to:

  1. Sample video data from one or more RCA inputs (using the cameras for a live feed).
  2. Convert the video data received from each input into a suitable digital format for MUXing
  3. Pass the digital input data into froom each input line into the MUXer to create a single video image
  4. Forward the final video image out the device via USB to a PC/Laptop for monitoring/recording.

Now that I've refined the project goals (to some extent), it's time to get crackin' on the fun part, building it! While I'm probably a week ahead of these posts on the project, I will leak this one picture of the first input line wiring breadboard (untested, who knows if it actually works or not, much more to do before the power gets turned on):

Stellaris with two RCA and analog joystick inputs

Next article: A brief overview of the RS-170A (NTSC) video protocol, and hopefully a working demo of NTSC video decoding using the Stallaris LaunchPad!