Page 1 of 5 123 ... LastLast
Results 1 to 10 of 44

Thread: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay board)

  1. #1
    Join Date
    Jan 2019
    Posts
    18
    Post Thanks / Like

    Default Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay board)

    Hello Everyone, I'm new to all this I've learned a lot from all of you. I don't know very much about arduino coding and Can't find a arduino code that works for what I want to do. I want to run 16 channels = 8 channels to run standard led light strip/Christmas bulbs with SainSmart 8-Channel 5V Solid State Relay Module Board for Arduino Uno Duemilanove MEGA2560 MEGA1280

    and

    8 LED Flood Lights that I can Dim with 8 Channel Digital Ac Programmable Light Dimmer Module Controller Board For MCU Arduino Raspberry Compatible 50/60hz 110V, 220V IOT Home Projects
    by ElectronicNuts AC Phase Dimmer 8 Channel Manufactured Quality

    Here's a link of dimmer http://www.inmojo.com/store/krida-el...odule-arduino/

    using Mega 22560 with Vixen 3

    and the code
    /*
    16 Channels Lighting Controller
    By smching (ediy.com.my)
    Allow Arduino Mega to communicate with Vixen via generic serial plugin
    */
    #define CHANNELS_COUNT 16
    ////////// PWM pin
    #define Ch1 2 // PWM Pin 2
    #define Ch2 3 // PWM Pin 3
    #define Ch3 4 // PWM Pin 4
    #define Ch4 5 // PWM Pin 5
    #define Ch5 6 // PWM Pin 6
    #define Ch6 7 // PWM Pin 7
    #define Ch7 8 // PWM Pin 8
    #define Ch8 9 // PWM Pin 9
    #define Ch9 10 // PWM Pin 10
    #define Ch10 11 // PWM Pin 11
    #define Ch11 12 // PWM Pin 12
    #define Ch12 13 // PWM Pin 13
    /////////// digital pin
    #define Ch13 18 // DIGITAL Pin 18
    #define Ch14 19 // DIGITAL Pin 19
    #define Ch15 20 // DIGITAL Pin 20
    #define Ch16 21 // DIGITAL Pin 21
    int Ch[CHANNELS_COUNT] = {Ch1, Ch2, Ch3, Ch4, Ch5, Ch6, Ch7, Ch8, Ch9, Ch10, Ch11, Ch12, Ch13, Ch14, Ch15, Ch16};
    int incomingByte[CHANNELS_COUNT]; // array to store the values from serial port
    void setup()
    {
    Serial.begin(9600); // set up Serial at 9600 bps
    for (byte i=0; i<CHANNELS_COUNT; i++) pinMode(Ch[i], OUTPUT); // declare channel pin as an output
    }
    void loop() {
    if (Serial.available() >= CHANNELS_COUNT) {
    for (int i=0; i<CHANNELS_COUNT; i++) {
    incomingByte[i] = Serial.read(); // read each byte
    if (i<12) { //arduino mega consists of 12 PWM
    analogWrite(Ch[i], incomingByte[i]); // Write current values to LED pins
    } else {
    digitalWrite (Ch[i], incomingByte[i]); // Write the Digital Output to the LED pin.
    }
    }
    }
    }

    Apparently I don't have it wired correctly or the right kind of bulb because Vixen shows lights dimming, but not out of relay board?
    I've tried different types of bulbs with No luck.
    Any suggestions.
    I know you need information so if I left anything out let me know.
    Steve

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

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    That code has almost no chance of working properly. Go look at the code published by jcook for his arduino EL wire project. Use that as a starting point to modify for your project.

    Vixen only knows what it told your board to do. You need to make sure your board is actually getting data. That includes configuring a header for the data stream.


    2019 - Going to visit my Daughter in New Zealand (again). I will be dark for the 2nd year in a row. Sigh..

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

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    That board is a bit expensive in my view. For that amount of money you could probably get some Renard controllers that would offer more channels and not have to worry about the Arduino interface.

    Having said that, a good sketch to use for an Arduino MEGA is the one from ZParticle which can be found here - https://drive.google.com/folderview?...Fk&usp=sharing. Use the file dated Sept 15, 2016.
    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
    Jan 2019
    Location
    Silver Spring Shores Florida
    Posts
    11
    Post Thanks / Like

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    Quote Originally Posted by coors40ack View Post
    Hello Everyone, I'm new to all this I've learned a lot from all of you. I don't know very much about arduino coding and Can't find a arduino code that works for what I want to do. I want to run 16 channels = 8 channels to run standard led light strip/Christmas bulbs with SainSmart 8-Channel 5V Solid State Relay Module Board for Arduino Uno Duemilanove MEGA2560 MEGA1280

    and

    8 LED Flood Lights that I can Dim with 8 Channel Digital Ac Programmable Light Dimmer Module Controller Board For MCU Arduino Raspberry Compatible 50/60hz 110V, 220V IOT Home Projects
    by ElectronicNuts AC Phase Dimmer 8 Channel Manufactured Quality

    Here's a link of dimmer http://www.inmojo.com/store/krida-el...odule-arduino/

    using Mega 22560 with Vixen 3


    Apparently I don't have it wired correctly or the right kind of bulb because Vixen shows lights dimming, but not out of relay board?
    I've tried different types of bulbs with No luck.
    Any suggestions.
    I know you need information so if I left anything out let me know.
    Steve

    Let me ask a question or two if you would be so kind. The lights hooked to the ssr's that are hooked to the Mega ( SainSmart 8-Channel 5V Solid State Relay ), are they coming on at all? Are the Arduino ready light/s coming on? Have you set the arduino in vixen as a controller, and if so what kind? Have you checked the properties in windows under printers and devices and do you see the Mega listed?

    Vixen is doing as you are asking it, if your preview is dimming then that is the effect you are setting, just because vixen dims does NOT make your ssr's dim. I have not used the board you linked to for your dimming with the arduino, I have looked at the same one in the past but was not ready to try to code for it. You must in your code/sketch account for dimming there are a few libraries out there, github is a good place to start. But your code as it is will Not dim.

    Let me know how this is working for you, I am also interested in this project, I love how stable an Arduino is.

    Dave

  5. #5
    Join Date
    Jan 2019
    Posts
    18
    Post Thanks / Like

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    Hi and thanks ,
    All the lights on the SSR's are lighting up and when I run the sequence all 16 lights do everything Vixen tells it to excecpt for the Dimming. I know very little about Arduino coding and I've tried 4 other Sketch's from ZParticle, Simon Champion and others with no luck.I know I'm doing something wrong just don't know what.
    All I want is 16 channels- 8 on/off and 8 that I can dim it can't be that hard?
    There has to be a code to insert to make it work . I'm going to look at Github even if I find something don't no where to insert into the code?
    Last edited by coors40ack; 02-26-2019 at 06:05 PM.

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

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    you did not mention dimming. to do dimming you need to add a zero cross detector, get code that can sync to the zc signal and output delayed triggers to the ssr. you need ssrs that arte designed for dimming. i suggest you get a renard board and save yourself a lot of headaches.


    2019 - Going to visit my Daughter in New Zealand (again). I will be dark for the 2nd year in a row. Sigh..

  7. #7
    Join Date
    Jan 2019
    Location
    Silver Spring Shores Florida
    Posts
    11
    Post Thanks / Like

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    I just noticed that the link you provided for the Dimmer board also has a link to their sketch, I would start there as far as the code goes, get it to just run from the arduino IDE with their sketch make sure it is doing kind of what you want, then if it does you will have to do your own code to make it work with vixen . Here is the link from that board.


    Testing sketches (50Hz) : https://drive.google.com/open?id=0B6...FZoajRDY1doZ1U

  8. #8
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    796
    Post Thanks / Like

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    What pin do you have the sync signal from the ssr board connect to On the mega? It needs to be on the correct interrupt pin for particle to work correctly.
    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.

  9. #9
    Join Date
    Jan 2019
    Posts
    18
    Post Thanks / Like

    Default Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    Hi Kevin That's what I've been trying to figure out, I don't see anything in the code for what pins are for sync?I see reference to sync to the zc signal and output delayed triggers to the ssr? I have pins 1 thru 8 on dimmer board to Pins 10,11,12,13,18,19,20,21 on mega and VCC from dimmer to 5v on mega, have no idea where to connect sync pin? I've only been doing this for a couple of months , I'm learning not there yet. I've tried other sketch's from ZParticle, Simon Champion and others nothing works so I guess my its in both my code and pin connections.20190225_113933.jpg20190225_113949.jpg20190225_114007.jpg
    Thanks for your help

  10. #10
    Join Date
    Dec 2016
    Location
    Hicksville, New York
    Posts
    101
    Post Thanks / Like

    Question Re: Help with Vixen 3 (code for mega2560 8 channel SSR and 8 CHANNEL dimmer relay boa

    Quote Originally Posted by kev View Post
    That board is a bit expensive in my view. For that amount of money you could probably get some Renard controllers that would offer more channels and not have to worry about the Arduino interface.

    Having said that, a good sketch to use for an Arduino MEGA is the one from ZParticle which can be found here - https://drive.google.com/folderview?...Fk&usp=sharing. Use the file dated Sept 15, 2016.
    If he is not using the ftdi breakout zparticle uses, change all the Serial1 to Serial. I was trying to do this in 2018 but gave up. It seemed zparticles sketch didn't even allow me to output to my relays which I was stuck on. (I wasn't using the ftdi or using a button, nor random mode so is there code that eliminates those 3?) So, could there be a bug with newer versions of Vixen? I tried with a different code from jcook and it worked, but it was not for dimming. For coors40ack and I, does anyone know of code that combines jcooks on/off with the simplest of dimming sketches?

    I can help you for the non dimmable part (Change MAX_CHANNELS to 8 and then in the array, type the pins you're using in order and delete the ones you're not using.)
    Code:
    #define MEGA_VIXEN
    
    #ifdef MEGA_VIXEN
      #define MAX_CHANNELS 52
      int channels[MAX_CHANNELS] = {2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53};
    #endif
    
    int incomingByte[MAX_CHANNELS];
    
    void setup()
    {
      int i;
      
      Serial.begin(9600); // set up Serial at 9600 bps
    
      for ( i = 0; i < MAX_CHANNELS; i ++ )  pinMode(channels[i], OUTPUT);
    }
    
    void loop()
    {
      int i;
      
      if (Serial.available() >= MAX_CHANNELS)
      {
        for (i=0; i < MAX_CHANNELS; i ++)      incomingByte[i] = Serial.read();
      }
    
      for (i = 0; i < MAX_CHANNELS; i ++ )    analogWrite(channels[i], incomingByte[i]);
    }
    So now we just need to add dimming to this sketch.
    Last edited by Spankyty; 02-27-2019 at 09:48 PM.
    Crazy Light Addict.

Page 1 of 5 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
  •