Results 1 to 9 of 9

Thread: First Christmas and Can't Figure This Out so Far

  1. #1
    Join Date
    Jan 2017
    Location
    Gainesville, Fl
    Posts
    19
    Post Thanks / Like

    Exclamation UPDATE: First Christmas and Can't Figure This Out so Far

    So I have been following Dee's Channel in putting this all together. I'm using a MEGA 2560 and 8 channel SSR boards and Vixen. It seems like I have everything plugged in correctly. I can only get the LEDs on the relay board to light up when plugged directly into the relay board. When I try to plug the relay board to its own power 5v power supply nothing lights up on the relay board. I can't get the Vixen sequence to run at all. Please let me know what additional information you might need to help me diagnose what the probably might be?

    Thanks in advance,

    Greg

    UPDATE:

    So I changed the code (I'll post the code I'm currently using in a reply) and the Ardunio seems like its reciving data but still nothing on the relay board. The am powering the relay board with its own plug and not from the Ardunio but still LEDs lighting on the relays. It seems like the Ardunio is not transmitting the data to the relay board but I can't figure out why. Of course I could be wrong.
    Last edited by blurredvsi0n; 11-24-2018 at 08:53 PM.

  2. #2
    Join Date
    Dec 2013
    Posts
    68
    Post Thanks / Like

    Default Re: UPDATE: First Christmas and Can't Figure This Out so Far

    Can you post the code you are useing and a few pictures of the setup?

    Sent from my LG-H931 using Tapatalk
    Mostly C9 Light Show, powered by Arduino. 48A Full On last year. "It feels like a carnival"
    https://www.facebook.com/ItsaDillonChristmas/

  3. #3
    Join Date
    Aug 2011
    Location
    Zephyrhills, FL
    Posts
    129
    Post Thanks / Like

    Default Re: First Christmas and Can't Figure This Out so Far

    Make sure when you plug in the power supply to to the relay board, that you have the negative from the power supply and the arduino connected. It would also be helpful to post some clear pictures of the setup so we can see the type of relay board and wiring.

  4. #4
    Join Date
    Jan 2017
    Location
    Gainesville, Fl
    Posts
    19
    Post Thanks / Like

    Default Re: UPDATE: First Christmas and Can't Figure This Out so Far

    Quote Originally Posted by xGROMx View Post
    Can you post the code you are useing and a few pictures of the setup?

    Sent from my LG-H931 using Tapatalk
    I forgot to post the code like I said I would. I forgot where I got it from but here it is:

    #define CHANNEL01 2
    #define CHANNEL02 3
    #define CHANNEL03 4
    #define CHANNEL04 5
    #define CHANNEL05 6
    #define CHANNEL06 7
    #define CHANNEL07 8
    #define CHANNEL08 9


    #define RANDOM_MODE_PININ 52
    #define RANDOM_MODE_PINOUT 53
    #define RANDOM_MODE_SPEED 1000

    int channels[] = {CHANNEL01,CHANNEL02,CHANNEL03,CHANNEL04,CHANNEL05 ,CHANNEL06,CHANNEL07,CHANNEL08};

    #define CHANNEL_COUNT 8
    #define VIXEN_COM_SPEED 57600
    #define PC_COM_SPEED 57600

    boolean startingVixen = true;

    void setup()
    {
    Serial.begin(PC_COM_SPEED);
    Serial1.begin(VIXEN_COM_SPEED);

    pinMode(CHANNEL01,OUTPUT);
    pinMode(CHANNEL02,OUTPUT);
    pinMode(CHANNEL03,OUTPUT);
    pinMode(CHANNEL04,OUTPUT);
    pinMode(CHANNEL05,OUTPUT);
    pinMode(CHANNEL06,OUTPUT);
    pinMode(CHANNEL07,OUTPUT);
    pinMode(CHANNEL08,OUTPUT);


    // set up the switch for Vixen or Random mode
    pinMode(RANDOM_MODE_PININ, INPUT);
    digitalWrite(RANDOM_MODE_PININ,HIGH); // turn on the internal pull-up resistor
    pinMode(RANDOM_MODE_PINOUT, OUTPUT);

    turnLightsOff();
    }

    void loop()
    {
    if(digitalRead(RANDOM_MODE_PININ)==LOW){ // blink at random mode
    startingVixen=true;
    doRandomLights();
    }else{ // play from Vixen mode
    if(startingVixen==true)
    turnLightsOff();
    readFromVixen();
    }
    }

    void turnLightsOff()
    {
    //turn them all off
    for(int channelIndex=0;channelIndex<16;channelIndex++){
    analogWrite(channels[channelIndex], 0);
    }
    }

    void doRandomLights()
    {
    randomSeed(analogRead(0));
    Serial.println("Writting random values.");
    for(int channelIndex=0;channelIndex<CHANNEL_COUNT;channelI ndex++){
    int randNumber = random(255);
    analogWrite(channels[channelIndex], randNumber);
    Serial.print(randNumber, DEC);
    Serial.print(",");
    }
    Serial.println("");
    delay(random(100,RANDOM_MODE_SPEED));
    }

    void outputToLights(unsigned char* buffer)
    {
    for(int channelIndex=0;channelIndex<CHANNEL_COUNT;channelI ndex++){
    analogWrite(channels[channelIndex], buffer[channelIndex]);
    Serial.print(buffer[channelIndex], DEC);
    Serial.print(",");
    }
    Serial.println("");
    }

    void readFromVixen()
    {
    Serial.println("Waiting for data from Vixen.");
    startingVixen = false;
    char *footer="VIXEN_END";
    unsigned char buffer[CHANNEL_COUNT];
    char buffer2[CHANNEL_COUNT];
    int index=0;
    unsigned long time = millis();

    waitForVixenHeader();
    while (true) {
    int inByte = Serial1.read();
    if(inByte==-1){
    if(index==0 && millis()-time>1000) // we haven't read anything in a second
    return;
    continue;
    }
    time = millis();
    buffer[index] = inByte;
    buffer2[index] = inByte;
    buffer[index+1] = 0;
    buffer2[index+1] = 0;
    index++;
    if(index==9 && strcmp(footer,buffer2)==0){
    Serial.println(footer);
    return;
    }
    else if(index==CHANNEL_COUNT){
    outputToLights(buffer);
    index=0;
    }
    }
    Serial.println("");
    }

    void waitForVixenHeader()
    {
    char *header="VIXEN_START";
    char buffer[12];
    int index = 0;
    unsigned long time = millis();

    while (true) {
    int inByte = Serial1.read();
    if(inByte==-1){
    if(index==0 && millis()-time>1000) // we haven't read anything in a second
    return;
    continue;
    }
    time = millis();
    buffer[index] = inByte;
    if(buffer[index]!=header[index]) {// not the right sequence restart
    index=-1;
    }
    buffer[index+1] = 0; // add null
    index++;
    if(index==11 && strcmp(header,buffer)==0){
    Serial.println(header);
    return;
    }
    }
    }

  5. #5
    Join Date
    Jan 2017
    Location
    Gainesville, Fl
    Posts
    19
    Post Thanks / Like

    Default Re: First Christmas and Can't Figure This Out so Far

    Quote Originally Posted by wirenut1980 View Post
    Make sure when you plug in the power supply to to the relay board, that you have the negative from the power supply and the arduino connected. It would also be helpful to post some clear pictures of the setup so we can see the type of relay board and wiring.
    How would I connect the negative to the Arduino? I donít think I understand what you mean but I have a feeling that you may be on to something.

    Here is several pictures of my setup. (Sorry I set it up quick on my kitchen table.)




    Sent from my iPhone using Tapatalk

  6. #6
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    3,188
    Post Thanks / Like

    Default Re: First Christmas and Can't Figure This Out so Far

    Negative, aka ground/V-/common/reference, Must be 'common' (aka connected) between any device driving a signal and a device receiving a signal. The minimum number of wires between a source device is 1 (the common wire) plus 1 (or more) data wires. This is true for relays / pixels / communications lines etc.


    2018 - Moving and going to visit my Daughter in New Zealand. Most likely I will be dark or nearly dark, Some static stuff that is simple to put up.

  7. #7
    Join Date
    Aug 2011
    Location
    Zephyrhills, FL
    Posts
    129
    Post Thanks / Like

    Default Re: First Christmas and Can't Figure This Out so Far

    The external power supply for the relay board (black and yellow wires in the pic) needs to have the black(V- com/ground) pig tailed to the gnd pin on the arduino. As MartinMueller2003 stated "The minimum number of wires between a source device is 1 (the common wire) plus 1 (or more) data wires". and currently you have 8 (red wires) data from the arduino to the relay board but no common (black) wire.

  8. #8
    Join Date
    Jan 2017
    Location
    Gainesville, Fl
    Posts
    19
    Post Thanks / Like

    Default Re: First Christmas and Can't Figure This Out so Far

    Quote Originally Posted by wirenut1980 View Post
    The external power supply for the relay board (black and yellow wires in the pic) needs to have the black(V- com/ground) pig tailed to the gnd pin on the arduino. As MartinMueller2003 stated "The minimum number of wires between a source device is 1 (the common wire) plus 1 (or more) data wires". and currently you have 8 (red wires) data from the arduino to the relay board but no common (black) wire.
    So I created the piggyback of the grnd from the relay board to the grnd on the Arduino and that did make the relay board turn on. However, all the LEDs on the relay board are on and stay on even when trying to run the sequence in Vixen. What can I check to try and figure out why its not running the sequence in Vixen.

    Thanks for your guys help so far!

  9. #9
    Join Date
    Nov 2011
    Location
    Dayton, OH
    Posts
    47
    Post Thanks / Like

    Default Re: UPDATE: First Christmas and Can't Figure This Out so Far

    The turnLightsOff() function appears to be over indexing the channel array. That could be your issue.
    lights, blow molds, and cut outs; no blinky-flashy yet

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
  •