Composite video switch with a momentary switch

Hello,

I pull an RV with my truck and have since added a few cameras to help assist. I have a module that displays composite video on the factory Sync3 screen. It works great but I want a way to switch between multiple inputs.

I found a Ford Camera button that I can put into my dash that works as a momentary button and keep the factory look. My plan is to utilize this button to switch between the composite (yellow) RCA video feeds. There isn’t any audio (Red/White).

I tried using an Arduino Nano and 12v 4-channel relay but it seems the nano data pins don’t seem to output more then 5v and it wouldn’t switch the relays. The LED indicators on the board switch as expected though.

I wrote code so each time the momentary button is pressed it passes low signal to one input (on) and high signal to the other 3 (off) - each time it’s pressed it turns on one and the other three off in order and loops back around. The code seems to be working as expected.

Can someone help suggest which hardware would be best suited for this? I bought a 12v relay because the trucks native voltage is 12v. Should I be using a 5v relay instead? Is the nano the best board for the job or should I consider a different one?

Thanks in advance!


That relay board is designed to run from 12V power at the "JD-VCC" pin. So on the relay board, add a wire from that pin to +12V. BE CAREFUL, if it touches or shorts to the adjacent "VCC" pin which is 5V power, it will smoke everything.
Said another way, your circuit looks fine but you need NO JUMPER between JD-VCC and VCC, and add extra wire soldered on to the JD-VCC node, either soldered to a relay pin.
You circuit should have a fuse and running a Nano in the car I would include some surge/transient protection as well.

Have you run video signals through the relays to see what you get?

I am not saying it won't work, just curious.

Recently I needed to switch four video signals input, and I was down the road of using a real video switch IC by Maxim I think, when I ran across something like this I just googled up

http://www.vwlowen.co.uk/radio/videoswitch2/index.htm

which I could hardly believe would work, but did, perfectly well as far as I can tell.

I think I used 2N3904s, my goto NPN transistors from forever. Anything similar would probably work as well as the BC547B in the diagram at the link.

Just an idea for you.

HTH

a7

Hi, thank you for the reply.

To confirm, you are suggesting wiring like this?

look into a CD4067 multiplexer module. it switches low current data signals. no good for motors, fine for video.

The relays' terminal block middle pin (2) is the relay contact common. Right (3) is Normally Closed, Left (1) is Normally Open, I think. The silkscreen marking is misleading.
So instead take Video Out from say the contact common/second (middle) pin 2 of each relay terminal block.
Otherwise that looks right - remove jumper, connect +12V power to "JD-VCC" only. For that I would just solder a wire to the PCB backside relay coil common. Or if you provide +12V at the jumper pin, make sure the soldering will not short to adjacent "VCC" or it will roast the Nano which is no fun. Heatshrink tubing can insulate pins.

Switching camera video should work fine here, the relays are big- designed for switching power, not so much low level video signals. There is a chance they will act a bit noisy because they are not "signal" relays with nice plated contacts. But they will clean up after you cycle them a few times though. Just so you don't get lost thinking it's a bad connection when it's oxide.

@prairiemystic - thank you!!

@Geek_Emeritus - this is interesting to me because it seems like it could save some space. I’m not familiar at all with these chips though… can it be used with a momentary switch and Nano?

Would you be able to draw a wiring diagram up so I can see how this would be configured?

An example here: 4067 reading in analog values - Arduino Learning. Instead of routing the SIG signal to A0 on the Arduino, route it to your display setup.

@prairiemystic

Taking a second look at this… if I remove the jumper then the bottom VCC won’t have any power, right? And as such the Nano won’t have power either?

My first go around I hooked the 12v source directly to the vin on the Nano which from research it should be able to accept 12v there.

The nano VIN was also connected to the bottom
VCC port on the relay, which if the jumper is present should apply 12v to the JD-VCC, right?

No it will not work for composite video because the sync pulses are negative with respect to the ground, and also those are not fast enough anyway. You need to be able to pass through a 5MHz signal.

Also at such high frequencies the cross talk between channels is very high.

The confusion is because this relay board needs two voltages for power yet only has one connection for it. The jumper connects the two together but we don't want that.

Jumper is out.
+12V IGN goes to Nano VIN and to YD-VCC on relay board supplying 12V for relay coils.
Nano 5V goes to VCC on relay board, supplying 5V (from the Nano) to the LEDs and relay drivers on the relay board.
Vehicle ground (closest to NAV) connects to Nano and relay board GND like you have drawn.

If you did have the jumper in and YD-VCC connected to 12V, then the relay board (driver side) VCC is 12V not 5V so inputs would sit at high voltage around 9V which the Nano will not like at all. The LED's would all stay lit I imagine.
Although the Nano can take 12V power on VIN, its I/O pins are low voltage only 5V. So the relay board backfeeding more than that, is no good.

For your pushbutton, don't forget to turn on the pullup or it will pick up noise and act unpredictably. Like this maybe:

int pushbutton_pin = 2; // for D2

pinMode (pushbutton_pin, INPUT); 
pinMode (pushbutton_pin, INPUT_PULLUP);

@prairiemystic sorry, I’m trying to get up to speed with this stuff but it’s still a little new to me.

I thought you said above the diagram was correct minus the common terminals on the relay blocks…. But it seems from your recent post that is no longer correct?

Do you mean wiring it like this now?

Please avoid mentioning obsolete versions of ICs.

You meant to say a 74HC4067 which has upgraded specifications to satisfy Mike. :grin:

We're not out of the woods yet. Sorry to confuse you, these relay boards don't always have decent documentation and it's a matter of getting the hardware compatible. Your latest diagram is right with one catch...
Do you have details of your relay board? I checked and many generic ones like this out of china have relays with 5V coils. What does the relay part number on the top say? Songle SRD-05VDC? I assumed you knew what you bought and it was 12V but this is learning.

http://wiki.sunfounder.cc/index.php?title=4_Channel_5V_Relay_Module

So my approach to connecting JD-VCC to 12V is too much voltage for the 5V relays if that is what you have. You cannot run the relay coils from the Nano 5V when in your truck because that requires too much current (89mA) and the 5V regulator will overheat with a 12V input at VIN.
It all would work and run cool on your desk from USB though- because your computer USB is supplying the 5V, not the Nano's regulator IC. So you can run it on your desk with the jumper in and VIN left disconnected.

If they are 5V relays, then you would need to add a stronger 5V power supply module to use the board in the truck. There are many 5VDC buck-converter modules that will supply 5V at say 400mA or more (worst case all 4 relays on is 89mAx4 plus LEDs and Nano).
Or change them out to 12V coil relays.

Sorry to take so long getting it right, I have to guess what the board is about with no part numbers or source and "VCC is system power source, and JD_VCC is relay power source. Ship 5V relay by default. Plug jumper cap to use" needs some explanation lol

@prairiemystic

No need to apologize - you are helping me, remember? :smiley:

These are the boards I bought:

I purchased the 12v version figuring that would be best compatible with the trucks 12v but that was just a stab in the dark. I was following some diagrams online and already fried one of the Nano chips in the process (accidentally swapped 12v and ground on the nano board - oops..) :smiley: .

Figured I’d head over to the experts, haha.

Maybe a simple ring counter (instead of the Nano) would be easier to control the relays if all you need is switching between a few inputs.
I couldn't find a specific IC to suggest though...

Or just use a 4-position switch, but you'll lose the "factory look". You can make it fancy by sticking a small figurine on the switch, so it "moves" between the positions, lol.

@rainyshadow

I appreciate the alternate suggestions (which I’m completely open to BYW) - but I’d really want to keep the factory momentary switch if at all possible.

Okay, that's the same relay board design but just a 2-channel version. Could not find the exact schematic, so have to make assumptions...

J2 looks like the 5V input side, so VCC to Nano 5V and GND to GND, IN1 and 2 to the Nano outs.
J1 looks like the relay (coil power) side, so no jumper and RY-VCC to +12V, GND to GND and NEVER short RY-VCC to VCC as that activates the auto-destruct sequence.

If you aren't sure about things, you can take the relay board ONLY connected to 12V and use a multimeter to check what is on the pins that would connect to the Nano, looking for nothing over 5V.

One unknown is the board has 12V relays but is it still 5V inputs? I'd have to see the resistor values etc. but we will know once it gets 5V in if it's going to work.

@prairiemystic

Shoot, the Amazon link went to the wrong board because there are multiple options on that particular page. It is the 4 channel / 12v option like the original post wiring diagram shows.

image

I did some digging and found this post - look starting at post #12. This looks to be a similar setup only with a different arduino board.

I wonder if I can apply this configuration to my setup?