How to switch between video inputs


Closed Thread
Results 1 to 14 of 14

Hybrid View

  1. #1
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697

    Default How to switch between video inputs

    Hi. I have a bunch of cheap CCTV cameras that have SCART outputs. The video uses the normal video pins that can be wired directly into a phono sockets (the yellow one on the front of the TV). I want to be able to switch between cameras on both a timer and by PC control.

    How can i switch between the video inputs? I was thinking of using a PIC chip to control which input gets to the output but im now sure what to use as a switch. In the past ive used relays for this but they are big, noisey and use a lot of power. Is there an IC that simply acts like the relay would. When it gets an input from the PIC it connects the video input to the output?

    Audio isnt a big concern but is there something that would handle that too? A simple switching IC would be ideal because it would be able to handle both video and audio just like a relay.

    Im hoping for something really cheap because i have 5 cameras plus a few other things i would like to attach to it

  2. #2
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Easy

    Google Analog mux, for example 74HC4051. Use a Pic and muxes to switch things as you want. Maybe 4051 is not the best for you in this case because of fairly high ON resistance but the idea is the same. Use the control pins to select input and the signal is connected to the output pin. 4053 is a dual mux and will make it really easy to connect video and audio if you see a need for it.

  3. #3
    Join Date
    Oct 2004
    Location
    Italy
    Posts
    695


    Did you find this post helpful? Yes | No

    Default

    Hi,

    Use a CD4066 quad bilateral analog switch.
    http://www.fairchildsemi.com/ds/CD/CD4066BC.pdf


    Same problem you have: (See CD4066).
    http://www.petesprojects.com/stereo-video/section4.htm

    Best regards,

    Luciano

    EDIT: With 5 cameras the 74HC4051 is a better choice.
    Last edited by Luciano; - 3rd May 2008 at 19:57.

  4. #4
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Ive been looking at the datasheet for the 74HC4051. From what i can see there are 8 pins and each one can be set to an input or an output. I do have a few questions about them though. Sorry if the datasheet answers these (if it does then i didnt understand it)

    I assume i pick a pin for example pin1 (A4) and use it as an output. Then i turn each input on seperately and it will come out of the output pin.

    How do i set which pins are inputs/outputs and how do i set which input is active? Im guessing i have to send the data through "COM out/in" (pin 3). Is that serial?

    Are the address pins just so you can control multiple chips using a single data line?

    Just thinking about the in/out pins. Are they actually an input or an output or do they just turn on/off and any pins that are on will all connect together?

  5. #5
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default Datasheets

    OK, let us start with the basic idea of multiplexers. You can look at them like a "One of Eight" switch where one line of the switch stays the same in all cases. 4051 is actually a MUX/DEMUX but let us not complicate this for the moment. Let us look at the datashet for example http://focus.ti.com/lit/ds/symlink/cd74hct4053.pdf PAGE 3


    Functional diagram of 4051:
    COM In/Out HERE IS WHERE YOU CONNECT YOUR TV
    CHANNEL In/Out HERE YOU CONNECT YOUR CAMERAS
    ENABLE pin must be low to make enable the chip
    S0,S1,S2 are the Select Pins (Adress) and they decide how you switch the signal, look at the diagram under the picture in PAGE 3
    S2=0 S1=0 S0=0 >> Connect Pin 13 to Pin 3
    S2=0 S1=0 S0=1 >> Connect Pin 14 to Pin 3
    and so on


    So you see 4051 does not use serial communication, it uses a 3 pin + enable parallell interface. If you want to have many chips on the same Slect Pin bus you have to figure out a way to only enable one chip at the time, this can be done by connecting the enable pins from each 4051 to the PIC or..... Connect the enable pins to a 4051 and control enable for all chips that way. Just at matter of how many pins you have left on your PIC.
    You can also connect 2 4051 in parallell, and feed video to one chip and Audio to the other chip, by doing this you always get the audio from the selected camera.

    Does this make things more clear?

  6. #6
    Join Date
    Jun 2007
    Location
    Mansfield, UK
    Posts
    697


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by sinoteq View Post
    Does this make things more clear?
    Perfectly!

    I think i was going wrong because to me "COM" means serial. OK, i know it should be "COMM" but lots of people seem to miss off the last M. It does make perfect sense now since there are 3 address pins (2 states each) and 2^3=8 (8 inputs).

    It didnt help having pins labeled "in/out" either. Just a small question on these, does that mean i could use this chip the oposite way? (1 input and 8 switched outputs)

    I like the definition of "X" in the datasheet :P "Don't care"

    I should have realised how it worked before because when i was at school i actually use a chip that does pretty much the same thing but it was only for LEDs.

    One last question. Would i be right in saying that the grounds on the video inputs/outputs should all be connected to each other but *not* to the chip. Then the signal wires go into the correct chip pins

  7. #7
    sinoteq's Avatar
    sinoteq Guest


    Did you find this post helpful? Yes | No

    Default

    Yes, you can connect one camera and eight TV and run it backwards so to speak, that is why I said 4051 is MUX/DEMUX. I would connect all GND to the same place to make sure you get the same potential on all cameras this also includes GND to the PIC and 4051.

Similar Threads

  1. Replies: 14
    Last Post: - 26th September 2007, 05:41
  2. dip switchs & inputs
    By grounded in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 19th September 2006, 13:37
  3. Newbie - 16F628A and switch latching
    By malc-c in forum mel PIC BASIC Pro
    Replies: 45
    Last Post: - 19th May 2006, 02:35
  4. Switch Sequence
    By Tissy in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 13th February 2005, 20:36
  5. Switch Polling vs Interrupts
    By eric blair in forum General
    Replies: 1
    Last Post: - 17th October 2003, 09:38

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts