Using 3 Channel Video Switcher Module with Arduino - Page 1
Forum section: electronics / projects

author: Stealthrt
author_rank: Regular Contributor
timestamp: December 07, 2014, 04:38:16 am
content: Hey all I am wondering how to go about switch from camera 1, 2 or 3 using this 3 Channel Video Switcher Module on ebayhere.Since there's only V+, V- and signal for the "switch" it looks to take a PWM but I am not quite sure if that's correct or not. If correct then how would I (in code) send that out for each camera to change?UPDATEWell I've tried the following code:Code:int LED_pin = 9; // must be one of 3, 5, 6, 9, 10 or 11 for PWMvoid setup() {pinMode(LED_pin, OUTPUT); // Initialize pin for output}void loop() {int dtwait = 1000; // Pause interval, millisecondsint V1=20, V2=220, V3=120; // 8-bit output values for PWM duty cycleanalogWrite(LED_pin, V1);delay(dtwait);analogWrite(LED_pin, V2);delay(dtwait);analogWrite(LED_pin, V3);delay(dtwait);}and just to test it I hooked up 2 green LEDs to digital pin 9 and I can confirm it does light the led's in 3 stages. From bright, medium and then dim-ish.So I went ahead and powered up the FPV by hooking it up like so:I'm not getting any voltage off that pin on the FPV. I even hooked up a volt meter and tested it without the LEDs attached to that pin and still had no reading.Someone suggested looking at this posthttp://www.rcgroups.com/forums/showthread.php?t=1955631but there so much code that I'm not sure what i need and what i don't need.What could I be doing incorrectly?

author: Stealthrt
author_rank: Regular Contributor
timestamp: December 07, 2014, 05:58:10 am
content: One looks like it says P15V 331QE BZ10While the other side has one that maybe says STC 15F104E F-4V938.A

author: LukeW
author_rank: Frequent Contributor
timestamp: December 07, 2014, 06:07:49 am
content: This does look similar to modules that are commonly used to select between multiple cameras in the RC hobby community.http://www.hobbyking.com/hobbyking/store/__29651__Hobbyking_3_Channel_FPV_Video_Switcher.htmlThe interface/architecture is probably similar to that.But that's pretty much all I know.

author: Alex Eisenhut
author_rank: Super Contributor
timestamp: December 07, 2014, 02:12:43 pm
content: Quote from: LukeW on December 07, 2014, 06:07:49 amYeah if it says - + S with a .100 3 pin header that's RC stuff.You need to send 20ms "frames" with a square wave that varies a bit.http://www.endurance-rc.com/ppmtut.phpBasically I don't think you'll see much with a LED with that duty cycle, so just test it "live" you won't hurt anything.So maybe 1ms means ch1, 1.5ms is ch2, 2ms is ch3. Something along those lines.If you want to mess around with it without coding, get one of thesehttp://www.ebay.ca/itm/Steering-Gear-Tester-Servo-Motor-Tester-Electrically-Controlled-Tester-brand-new-/390994870595?pt=Radio_Control_Parts_Accessories&hash=item5b091c4143

author: Seekonk
author_rank: Super Contributor
timestamp: December 07, 2014, 05:12:36 pm
content: Interesting multiplex method, looks like the PWM creates an analog voltage and comparing that selects the MUX for video. Bet you could put a pot between 5 and gnd and select video that way. Have to bookmark that board.

author: Stealthrt
author_rank: Regular Contributor
timestamp: December 07, 2014, 08:39:48 pm
content: Happen to have any arduino code handy that I can use per your example?

author: Stealthrt
author_rank: Regular Contributor
timestamp: December 08, 2014, 04:52:52 am
content: Alright I got it.Using the#include <Servo.h>Servo library I was able to get the following values confirmed that switched the video input:Code:cam1 = 0-64 and also 153-180cam2 = 65-123cam3 = 124-152The arduino code looks like this:Code:#include <Servo.h>Servo myservo;int pos = 0;void setup(){myservo.attach(9);Serial.begin(9600);}void loop(){for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees{ // in steps of 1 degreemyservo.write(pos); // tell servo to go to position in variable 'pos'Serial.println(pos);delay(1000); // waits 1 minute so i can see the value}}