Connect with us

Using 3 Channel Video Switcher Module with Arduino

Discussion in 'Microcontrollers, Programming and IoT' started by StealthRT, Dec 7, 2014.

Scroll to continue with content
  1. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    Hey all I am wondering how to go about switch from camera 1, 2 or 3 using this 3 Channel Video Switcher Module on ebay here.

    [​IMG]

    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?

    UPDATE

    Well I've tried the following code:
    Code:
    int LED_pin = 9; // must be one of 3, 5, 6, 9, 10 or 11 for PWM
    
    void setup() {
      pinMode(LED_pin, OUTPUT); // Initialize pin for output
    }
    
    void loop() {
      int dtwait = 1000; // Pause interval, milliseconds
      int V1=20, V2=220, V3=120; // 8-bit output values for PWM duty cycle
      analogWrite(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:
    [​IMG]

    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 post http://www.rcgroups.com/forums/showthread.php?t=1955631 but there so much code that I'm not sure what i need and what i don't need.

    What could I be doing incorrectly?
     
    Last edited: Dec 7, 2014
  2. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    What's the IC on there? And why have you connected an LED to it? It's a three-to-one video signal selector, right?
     
  3. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    I hooked the leds up so i know what video IN is currently being triggered via the PWM. I can not find the IC's manual it uses nor have any help from the few that sell it on eBay.
     
  4. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    But you have a module there, do you? What are the markings on the IC?
     
  5. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    One looks like it says P15V 331QE BZ10
    [​IMG]

    While the other side has one that maybe says STC 15F104E F-4V938.A
    [​IMG]
     
  6. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    Any other help from anyone?
     
  7. (*steve*)

    (*steve*) ¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd Moderator

    25,387
    2,772
    Jan 21, 2010
    I think you need a datasheet on that module.
     
  8. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    i cant find one...
     
  9. KrisBlueNZ

    KrisBlueNZ Sadly passed away in 2015

    8,393
    1,268
    Nov 28, 2011
    I guess that's a good reason to buy from real companies like sparkfun instead of anonymous eBay vendors. No doubt that module was cheap, but if you can't use it because there's no documentation, it has no value at all :-(
     
  10. StealthRT

    StealthRT

    129
    2
    Sep 4, 2010
    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-180
    cam2 = 65-123
    cam3 = 124-152
    
    The 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 degree 
        myservo.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
      }
    }
    
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-