Schematics / Video / Remote Controlled AV Switch with S-Video, Composite Video, and Audio
Introduction
After plugging the new DVD player into the s-video connector of the big screen TV and seeing the image, I knew there was no going back to composite video. A few weeks later I purchased a programmable remote to control my home theatre system and I became a highly-optimized couch potato. But my happiness would not last.
A few months ago we added a new digital cable service. After installation, I realized that the decoder box had an s-video output. The problem was that my TV had only one s-video input and the DVD player was connected to it. I looked around and found a manual s-video switch box at Radio Shack. It saved having to switch out the cable behind the TV but I was now a sub-optimal couch potato. Happiness (and optimization) could only be found with a remote controlled s-video switch. It was time to heat up the soldering iron and write some PIC code.
The requirements for this project consisted of:
| 1. | Use a common IR format and detector so that a standard, off the shelf remote could act as the controller. |
| 2. | Support 4 input channels of s-video, composite video, stereo audio. |
| 3. | Have a "learn" mode so that codes other than the programmed default can be used to switch channels. |
| 4. | Mechanical form factor shall be no larger than Radio Shack mechanical switch. |
| 5. | Channels can be selected with front panel switches as well as with a remote. |
Before starting this project, I researched the format of IR remote controls. There are a few major standards for IR protocols including the ubiquitous RC5 codes. This format consists of 14 bits that are transmitted using Manchester codes. I eventually settled on the one used by Sony which is also known as the RECS 80 standard. The reasons for this were:
| 1. | It's a simple protocol and easy to decode. |
| 2. | Sony has a number of excellent, after-market "universal" remotes controls. |
| 3. | I own a "universal" Sony remote control. |
| 4. | It's logical to map the codes for the different channels to the audio amplifier. I own a Sony amplifier. |
Sony uses a 12-bit protocol that consists of a 5-bit ID code followed by a 7-bit command code. The data is transmitted least significant bit first after a Start or AGC bit. On my oscilloscope, I observed the Start bit to have a duration of 2.6msec. A "1" was low for 1.44msec and followed by a 440usec terminator. A zero was low for 760usec and followed by a 440usec terminator.
The code to set a Sony amplifier to the Video1 input is 822 Hex and can be seen, LSB first, in the observed data stream shown below.
Other observed codes for input selection for a Sony amplifier were:
| 1. | 822H - Video1 |
| 2. | 81EH - Video2 |
| 3. | 81DH - AUX |
| 4. | 821H - Tuner |
| 5. | 825H - CD |
| 6. | 823H - Tape1 |
| 7. | 869H - Tape2 |
| 8. | 86AH - TV |
| 9. | 820H - Phono |
I chose, as default codes, Video1, Video2, CD, and TV. However, you can teach the switch to remember any combination of codes as long as it adheres to the Sony format.
Circuit
The three main devices which make up this design are the Panasonic PNA4613MOOYB IR sensor (available from DigiKey), the PIC16F84 microprocessor, and the Linear Technology LT1204 4-input Video Mux. Just for fun, I used bi-color LED's to provide a visual indication of the selected channel. Note that you can easily modify this circuit to perform tasks other than switching a video mux. Just tap off ADDR0 and ADDR1 with your own circuit. Or you can use the LED drivers as a set of 1 of 4 outputs.
The Panasonic IR sensor provides the optical sensing, 40Khz filtering, amplification, and detection circuits necessary to extract the signals from the remote.
The PIC chip has five pushbutton-inputs, one IR Sensor input, four LED indicator outputs, and two coded address selection outputs. An 8Mhz crystal results in an instruction cycle of 500nsec or roughly two million instructions per second - more than adequate bandwidth for this application. The bi-color LED's have a simple circuit which allow them to be controlled by a single line. When the input is high, the green LED is on and the transistor is off. When the input is low, the green LED is off and the transistor turns on to provide current for the red LED. The PIC chip outputs can source up to 25mA which is more than enough for an LED.
The LT1204 4-input Video Mux has a 30Mhz bandwidth which is adequate for these signals. In our application we are terminating the inputs with 75ohms. Because of this, we have to boost the gain by two on the output. Other devices can be substituted for this multiplexer including the Analog Devices AD8184 or the MAX454. Note that if the Analog Devices part is used, a video amplifier with a gain of two will have to follow the outputs. For the audio switching, a CD4052 dual 4:1 mux is used.
Power for the circuit is provided with a 5 volt linear regulator driven by a common 9VAC wall transformer. To get the -5VDC required by the muxes, a Linear Technology LTC660 inverter is used. An LC circuit is used to squelch any residual switching noise from the inverter before going to the muxes.
The schematic has been partitioned into three sections: 1) the front end which includes the PIC chip, the IR sensor and the LED's, 2) the back end which consists of the muxes and connectors, and 3) the power supply.
advertisement
advertisement



