Page 1 of 4 123 ... LastLast
Results 1 to 10 of 36

Thread: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

  1. #1
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    ok, so with my Mega 2560 and Vixen 2.1 on the computer the SSR relays flicker when vixen runs, they are all on if vixen is off, and when started they work as they should however they all flicker like a strobe constantly until vixen shuts off, then they go back to full on again. what could be my issue.?

    I think this is the code im using, its the only one i can find so it must be:

    /*
    Allow Vixen to control Arduino MEGA outputs.
    To control 16 relay channels. RELAY1, RELAY2, etc are the relay control pins.
    This version was tested with Vixen 3.
    Also eliminated the footer feature. This version only uses a header "~!"
    in Vixen 3. In Vixen don't use the quotes, just the two characters.

    While Vixen 3 is sending data, the Arduino RX light is ON.
    */

    // pinouts used.
    #define RELAY1 2
    #define RELAY2 3
    #define RELAY3 4
    #define RELAY4 5
    #define RELAY5 6
    #define RELAY6 7
    #define RELAY7 8
    #define RELAY8 9
    #define RELAY9 10
    #define RELAY10 11
    #define RELAY11 12
    #define RELAY12 13
    #define RELAY13 14 /44
    #define RELAY14 15 //45
    #define RELAY15 16 //46
    #define RELAY16 17 //47

    // Configure outputs
    int chanDigital[] = {RELAY1, RELAY2, RELAY3, RELAY4, RELAY5, RELAY6, RELAY7, RELAY8, RELAY9, RELAY10, RELAY11, RELAY12, RELAY13, RELAY14, RELAY15, RELAY16};
    int vixByte[16]; // size of the channel array
    int chanDigitalCount = 16; // Total number of ON/OFF channels.
    int i = 0; // Loop counter

    //setup the pins/ inputs & outputs
    void setup(){
    // initalize digital Channel Pins as outputs.
    for (i=0; i < chanDigitalCount; i++){
    pinMode(chanDigital[i], OUTPUT);
    vixByte[i] = 0; //set array at 255 not 0 for relay OFF by inverting. only if mech relays used. but im using ssr so leave at 0
    analogWrite(chanDigital[i], vixByte[i]); //use either analog or digitalwrite
    }

    //setup Vixen USB serial port.
    Serial.begin(9600);
    }

    void loop()
    {
    if (Serial.available() >= chanDigitalCount+1) {
    // changed +2 to +1 in above line to have correct channels on relay board
    //int uno = Serial.read();
    //if (uno == 126){
    //int dos = Serial.read();
    //if (dos == 33){
    // We are now past the header so read and send the 16 channel data.
    for (int i=0; i<16; i++) {
    // read each byte
    vixByte[i] = Serial.read();
    analogWrite(chanDigital[i], 0 + vixByte[i]); //Send to relay pin. use either analog or digitalwrite
    }
    }
    }
    //}
    //} //end of loop

  2. #2
    Join Date
    Nov 2009
    Location
    Morrisburg, On, Canada
    Posts
    2,540
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    Hard to say. It sounds like you have no synchronization between Vixen and your Arduino.
    Did you use the header ~! in your Generic Serial setup?
    Is your baudrate 9600 in Vixen?
    You should use digitalWrite for zero-cross SSRs.

    Edit:
    Also, some SSR relays use inverted logic so you may want to verify what your relays need.
    Last edited by LightUp; 10-25-2017 at 09:14 PM.

  3. #3
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    825
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    Quote Originally Posted by thecanadiandaily View Post
    ok, so with my Mega 2560 and Vixen 2.1 on the computer the SSR relays flicker when vixen runs, they are all on if vixen is off, and when started they work as they should however they all flicker like a strobe constantly until vixen shuts off, then they go back to full on again. what could be my issue.?

    I think this is the code im using, its the only one i can find so it must be:

    /*
    Allow Vixen to control Arduino MEGA outputs.
    To control 16 relay channels. RELAY1, RELAY2, etc are the relay control pins.
    This version was tested with Vixen 3.
    Also eliminated the footer feature. This version only uses a header "~!"
    in Vixen 3. In Vixen don't use the quotes, just the two characters.

    While Vixen 3 is sending data, the Arduino RX light is ON.
    */

    // pinouts used.
    #define RELAY1 2
    #define RELAY2 3
    #define RELAY3 4
    #define RELAY4 5
    #define RELAY5 6
    #define RELAY6 7
    #define RELAY7 8
    #define RELAY8 9
    #define RELAY9 10
    #define RELAY10 11
    #define RELAY11 12
    #define RELAY12 13
    #define RELAY13 14 /44
    #define RELAY14 15 //45
    #define RELAY15 16 //46
    #define RELAY16 17 //47

    // Configure outputs
    int chanDigital[] = {RELAY1, RELAY2, RELAY3, RELAY4, RELAY5, RELAY6, RELAY7, RELAY8, RELAY9, RELAY10, RELAY11, RELAY12, RELAY13, RELAY14, RELAY15, RELAY16};
    int vixByte[16]; // size of the channel array
    int chanDigitalCount = 16; // Total number of ON/OFF channels.
    int i = 0; // Loop counter

    //setup the pins/ inputs & outputs
    void setup(){
    // initalize digital Channel Pins as outputs.
    for (i=0; i < chanDigitalCount; i++){
    pinMode(chanDigital[i], OUTPUT);
    vixByte[i] = 0; //set array at 255 not 0 for relay OFF by inverting. only if mech relays used. but im using ssr so leave at 0
    analogWrite(chanDigital[i], vixByte[i]); //use either analog or digitalwrite
    }

    //setup Vixen USB serial port.
    Serial.begin(9600);
    }

    void loop()
    {
    if (Serial.available() >= chanDigitalCount+1) {
    // changed +2 to +1 in above line to have correct channels on relay board
    //int uno = Serial.read();
    //if (uno == 126){
    //int dos = Serial.read();
    //if (dos == 33){
    // We are now past the header so read and send the 16 channel data.
    for (int i=0; i<16; i++) {
    // read each byte

    vixByte[i] = Serial.read();
    analogWrite(chanDigital[i], 0 + vixByte[i]); //Send to relay pin. use either analog or digitalwrite
    }
    }
    }
    //}
    //} //end of loop
    This code was designed to use a header of two characters. That is probably why it checks for serial available +2. You have the header test commented out, so it is not testing for those two characters but the serial available is still lookig for the channel count +1. So the data stream does not look like it is syncing up.
    You should un-comment the lines in blue above and change the serial available test back to +2 and make sure you have the header setup in Vixen controller.. Or you could try the code by Victor_PV found here - http://doityourselfchristmas.com/for...th-Random-mode
    Kevin

    2017 - Pi3 w/FPP controlling 8 ESPixelsticks driving 1250pixels and 3 Arduino MEGAS communicating with ESP-01s driving 96 channels
    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  4. #4
    Join Date
    Oct 2017
    Location
    Davis, California
    Posts
    26
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    Also, missing one of the slashes in the comment of this line:
    #define RELAY13 14 /44

    Although, I'm not sure that would cause the problems you're describing, it may cause problems assigning that pin.

  5. #5
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    yeah i fixed that, makes no difference

  6. #6
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    no idea what you mean about the headers ! and iam using vixen 3.2 i thought iwas using 2.1 but no.

  7. #7
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    update to my issues here: i am using vixen 3.2, i tried also a windows 7 computer its still the same, my board is a 2560 mega sainsmart, and the relays are also sainsmart SSR's .
    Kevin above talks about headers ?? no idea what that is.

    I made changes as per above but now nothing works, no relay movement, here is the code so far:
    /*
    Allow Vixen to control Arduino MEGA outputs.
    To control 16 relay channels. RELAY1, RELAY2, etc are the relay control pins.
    This version was tested with Vixen 3.
    Also eliminated the footer feature. This version only uses a header "~!"
    in Vixen 3. In Vixen don't use the quotes, just the two characters.

    While Vixen 3 is sending data, the Arduino RX light is ON.
    */

    // pinouts used.
    #define RELAY1 2
    #define RELAY2 3
    #define RELAY3 4
    #define RELAY4 5
    #define RELAY5 6
    #define RELAY6 7
    #define RELAY7 8
    #define RELAY8 9
    #define RELAY9 10
    #define RELAY10 11
    #define RELAY11 12
    #define RELAY12 13
    #define RELAY13 14 //44
    #define RELAY14 15 //45
    #define RELAY15 16 //46
    #define RELAY16 17 //47

    // Configure outputs
    int chanDigital[] = {RELAY1, RELAY2, RELAY3, RELAY4, RELAY5, RELAY6, RELAY7, RELAY8, RELAY9, RELAY10, RELAY11, RELAY12, RELAY13, RELAY14, RELAY15, RELAY16};
    int vixByte[16]; // size of the channel array
    int chanDigitalCount = 16; // Total number of ON/OFF channels.
    int i = 0; // Loop counter

    //setup the pins/ inputs & outputs
    void setup(){
    // initalize digital Channel Pins as outputs.
    for (i=0; i < chanDigitalCount; i++){
    pinMode(chanDigital[i], OUTPUT);
    vixByte[i] = 0; //set array at 255 not 0 for relay OFF by inverting. only if mech relays used. but im using ssr so leave at 0
    digitalWrite(chanDigital[i], vixByte[i]); //use either analog or digitalwrite
    }

    //setup Vixen USB serial port.
    Serial.begin(9600);
    }

    void loop()
    {
    if (Serial.available() >= chanDigitalCount+1) {
    // changed +2 to +1 in above line to have correct channels on relay board
    int uno = Serial.read();
    if (uno == 126){
    int dos = Serial.read();
    if (dos == 33){
    // We are now past the header so read and send the 16 channel data.
    for (int i=0; i<16; i++) {
    // read each byte
    vixByte[i] = Serial.read();
    digitalWrite(chanDigital[i], 0 + vixByte[i]); //Send to relay pin. use either analog or digitalwrite
    }
    }
    }
    }
    }
    //end of loop
    Last edited by thecanadiandaily; 11-07-2017 at 06:54 PM.

  8. #8
    Join Date
    Nov 2009
    Location
    Morrisburg, On, Canada
    Posts
    2,540
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    Quote Originally Posted by thecanadiandaily View Post
    update to my issues here: i am using vixen 3.2, i tried also a windows 7 computer its still the same, my board is a 2560 mega sainsmart, and the relays are also sainsmart SSR's .
    Kevin above talks about headers ?? no idea what that is.
    You add the headers in Vixen in the Generic Serial setup where it has a place for HEADERs and FOOTERs.

  9. #9
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    sorry man i still have no idea what to add there. whats a header? im too new to this.

  10. #10
    Join Date
    Nov 2016
    Posts
    11
    Post Thanks / Like

    Default Re: Mega 2560 and Vixen 2.1 SSR relays flicker when vixen runs

    this code here you directed me to by Victor_PV does not work at all, it random flashes and vixen does not even do anything with it.

Page 1 of 4 123 ... LastLast

Bookmarks

Posting Permissions

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