Page 2 of 2 FirstFirst 12
Results 11 to 16 of 16

Thread: Arduino, Vixen 3 and LED tree installation

  1. #11
    Join Date
    Jun 2018
    Posts
    10
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    Good evening, I take this opportunity to thank each of those who took their time to answer my questions. I'm just starting with this theme of Christmas shows and I've found many limitations. If someone can answer my questions, I would really appreciate it ...

    1. How easy is it to make a power supply with input: 110v AC to output: 25v DC? (and if you have an outline of this I would appreciate it if you allow it)

    2. What transistors can I use for a 110v AC installation to manage its four series independently?

    Thank You, I am sorry for my English, I using Google Translate

  2. #12
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    2,957
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    Most of us buy the Power Supplies. There are thousands of power supply schematics available on the web. At its core a power supply is a transformer + bridge rectifier + regulation stage. A switching power supply (significantly more efficient) gets much more complicated.

    AC is not controlled using transistors. You control AC using things like mechanical relays or using a device called a Triac. You can see examples of AC control circuits by looking at the Wiki on this forum and searching for SSR (Solid State Relay). A Mechanical relay cannot do dimming. An SSR has the ability to support dimming via PWM signals on its input that are in sync with the AC line.


    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.

  3. Thanks Diego thanked for this post
  4. #13
    Join Date
    Jun 2018
    Posts
    10
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    Good evening, I bought a four-channel relay (I attached a photo at the end) and discovered that they are with reverse logic, I tried to change it, if it works, but when entering Vixen they turn on without working, I tried several solutions from this forum but without positive results. I add IMG to the problem and code that I am using, thank you very much.

    Code:
    int A = 2;
    int B = 3;
    int C = 4;
    int D = 5;
    int E = 6;
    int F = 7;
    int G = 8;
    int H = 9;
    int I = 10;
    int J = 11;
    int K = 12;
    int L = 13;
    
    
    int i = 0;
    int incomingByte[12];
    
    
    void setup()
    {
      Serial.begin(9600);
    
    
      pinMode(A, OUTPUT);
      pinMode(B, OUTPUT);
      pinMode(C, OUTPUT);
      pinMode(D, OUTPUT);
      pinMode(E, OUTPUT);
      pinMode(F, OUTPUT);
      pinMode(G, OUTPUT);
      pinMode(H, OUTPUT); 
      pinMode(I, OUTPUT); 
      pinMode(J, OUTPUT); 
      pinMode(K, OUTPUT); 
      pinMode(L, OUTPUT);  
    
    
    digitalWrite(I, HIGH);  
    digitalWrite(J, HIGH);  
    digitalWrite(K, HIGH);  
    digitalWrite(L, HIGH);
    }
    
    
    void loop()
    {
      if (Serial.available() >= 12)
      {
        for (int i=0; i<12;i++)
        {
          incomingByte[i] = Serial.read();
        }                                       // Arduino pins
        digitalWrite(A, incomingByte[0]);  // Pin 2
        analogWrite(B, incomingByte[1]);  // Pin 3
        digitalWrite(C, incomingByte[2]);  // Pin 4
        analogWrite(D, incomingByte[3]);  // Pin 5
        analogWrite(E, incomingByte[4]);  // Pin 6
        digitalWrite(F, incomingByte[5]);  // Pin 7
        digitalWrite(G, incomingByte[6]);  // Pin 8
        digitalWrite(H, incomingByte[7]);  // Pin 9
        digitalWrite(I, incomingByte[8]);  // Pin 10
        digitalWrite(J, incomingByte[9]);  // Pin 11
        digitalWrite(K, incomingByte[10]);  // Pin 12
        digitalWrite(L, incomingByte[11]);  // Pin 13
      }
    }
    IMG_20180725_012921746_LL.jpg IMG_20180725_011724425.jpg
    Last edited by Diego; 07-25-2018 at 02:55 AM.

  5. #14
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    2,957
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    A show player (Vixen or any other) sends 0 == output off through 255 == full on. You need to modify your software to work with that. Since you are using relays, you need to modify your software to convert those values to a zero or one. Sending the full byte is not correct and can cause undefined operation.

    Your main loop is also missing any sort of sync operation so you will get trash at random times.


    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.

  6. Thanks Diego thanked for this post
  7. #15
    Join Date
    Jun 2018
    Posts
    10
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    thanks friend for your answer, my knowledge is very basic programming, can you help me with the code ?, I want to manipulate different relays to time, relay (from the previous photo) and relays of solid state.

  8. #16
    Join Date
    Dec 2012
    Location
    Hudson MA
    Posts
    2,957
    Post Thanks / Like

    Default Re: Arduino, Vixen 3 and LED tree installation

    Sure. At the moment I have no access to an arduino compiler so the code below has not been built and tested. But it shows the basics of what needs to be done. It processes one byte per iteration of the loop. You can modify it to process more. There is no need to wait for an entire frame to be received before processing. It is possible (but not likely) that you could receive more than one byte in a loop time. You would need to set the serial speed much higher than 9600 bps for that to happen.

    Code:
    // Set the GPIO ports for the relays here
    #define RELAY_1_GPIO_ID 10
    #define RELAY_2_GPIO_ID 11
    #define RELAY_3_GPIO_ID 12
    #define RELAY_4_GPIO_ID 13
    
    
    // set based on the type of relay in use and how it is connected
    #define RELAY_ON  HIGH
    #define RELAY_OFF LOW
    
    
    // intensity value at which the relay will turn on
    #define RELAY_TRIGGER_LEVEL 128
    
    
    // table used to translate a relay index into a GPIO port value
    byte XlatIndexToGpio[] = 
    {
        RELAY_1_GPIO_ID,
        RELAY_2_GPIO_ID,
        RELAY_3_GPIO_ID,
        RELAY_4_GPIO_ID
    };
    byte CurrentRelayIndex = 0;
    
    
    // string to search for at the start of a frame so we can sync to the frame
    // you must add this string to the show player and have it sent at the start of every data frame.
    byte FrameHeader[] = {"FindMe"};
    byte FrameHeaderIndex = 0;
    
    
    void setup()
    {
      Serial.begin(9600);
    
    
      // set up the output ports
      for(byte CurrentPort : XlatIndexToGpio)
      {
        pinMode(CurrentPort, OUTPUT);
        digitalWrite(CurrentPort, RELAY_OFF);
    
    
      } // end set up the output ports
    
    
      // set up for a new frame
      FrameHeaderIndex = 0;
      CurrentRelayIndex = 0;
    
    
    } // setup
    
    
    
    
    void loop()
    {
        do // once
        {
            // is there data to process?
            if(0 == Serial.available())
            {
                // no data. Go away
                break;
            } // end no data
    
    
            // have we completed the header sync yet
            if( FrameHeaderIndex < sizeof(FrameHeader)-1)
            {
                // still searching for the header
    
    
                // is this an expected byte?
                if( Serial.read() != FrameHeader[FrameHeaderIndex++])
                {
                    // not the expected value. Start searching at the beginning again
                    FrameHeaderIndex = 0;
                }
    
    
                // go away and process the next byte in the next loop iterration.
                break;
            } // end look for header
    
    
            // we get to here if this byte is ment for the relay
            digitalWrite(XlatIndexToGpio[CurrentRelayIndex], (Serial.read() < RELAY_TRIGGER_LEVEL) ? RELAY_OFF : RELAY_ON);
    
    
            // move to the next relay
            CurrentRelayIndex++;
    
    
            // have we sent all of the relay data?
            if( CurrentRelayIndex == sizeof(XlatIndexToGpio))
            {
                // start searching for the next frame
                FrameHeaderIndex = 0;
                CurrentRelayIndex = 0;
            } // end move to next frame
    
    
            
        } while(false);
    
    
    } // loop
    Last edited by MartinMueller2003; 08-30-2018 at 06:18 AM. Reason: corrected code error


    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.

  9. Thanks Diego thanked for this post
Page 2 of 2 FirstFirst 12

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
  •