Page 10 of 12 FirstFirst ... 89101112 LastLast
Results 91 to 100 of 112

Thread: Arduino Uno & Vixen 3: Need help with sketch

  1. #91
    Join Date
    Jul 2017
    Posts
    50
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Kev, Since I will have 3 boards, can we do digital reads/writes in same sketch as analog read/writes? If so I can use the two megas for all led lights and my uno for the ac elements.
    Last edited by resjsu; 11-10-2017 at 08:22 PM. Reason: 1st was unreadable haha

  2. #92
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    515
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by resjsu View Post
    Kev, Since I will have 3 boards digital reads/writes in same sketch as analog read/writes? If so I can use the two megas for all led lights and my uno for the ac elements.
    This is exactly what I was going to suggest depending on the sketch you are going to use. We might be able to modify your sketch to do AC as well as PWM.
    Kevin

    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  3. #93
    Join Date
    Jul 2017
    Posts
    50
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Kev,
    If I can use analog read/writes and digital read writes in same sketch then I could actually just use the two megas for everything correct? So maybe the easiest thing to do is to combine the two codes that are listed towards the begnining of this thread? Is this a possibility?

  4. #94
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    515
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by resjsu View Post
    Kev,
    So I have been reading up on zero cross detectors and I have what could turn out to be a dumb question; why do I need a zero cross detector to dim my led strips that run off of dc power?

    So I get what the zero cross detector does with an ac current wave form and what it is trying to prevent but can you in words simply describe how it helps us dim leds? I am not making the connection of how knowing when the signal is crossing zero is used in the code to tell the led strip to properly dim.

    Needless to say I am pretty stuck at the moment.
    Well, as you have read, the Zero Cross circuit detects when the AC signal crosses zero. It crosses zero 120 times per second. A sketch can use the 120 crossing points to turn on/off the output pin. It can turn on/off the output pin sooner or later depending on the value sent by Vixen (or other sequence program). As far as the SSR is concerned, it really does not matter whether it is switching AC or DC ( as long as you have the right transistors/mosfets/triacs). It will turn on or off just like a PWM signal. So for a DC signal, if you are using transistors or mosfets that can switch fast enough, the sketch will turn them on and off just like the PWM pins. This means that you can use ANY pin for dimming. As I mentioned earlier, last year I had my MEGAs controlling 48 channels that were all dimmable.
    So, if you wanted to use more pins on the MEGA, you would have to invest in a zero cross detector and the correct SSRs that will work. The mosfets you have been using to will probably still work. The SSR boards from Sainsmart will not. But a lot of folks on here have replaced the SSRs that come with the Sainsmart board with ones that are dimmable. Unfortunately, the replacement SSRs cost a lot. The alternatieve is to buy someone else's board or build your own. I opted to build my own. Mine cost about $2.00 per channel. But I missed the first year that I had wanted to put up a display because of the time it takes. It took me a year to figure everything out. And of course this year I am adding pixels which is a whole new ball game. The reason I have gone on so long is...if you want a display this year, I suggest keeping it simple. Go big next year and bigger the year after that. This year, use the MEGAs for the PWM controlled strips and the UNO for your AC on/off elemets.
    Kevin

    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  5. #95
    Join Date
    Jul 2017
    Posts
    50
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by kev View Post
    Well, as you have read, the Zero Cross circuit detects when the AC signal crosses zero. It crosses zero 120 times per second. A sketch can use the 120 crossing points to turn on/off the output pin. It can turn on/off the output pin sooner or later depending on the value sent by Vixen (or other sequence program). As far as the SSR is concerned, it really does not matter whether it is switching AC or DC ( as long as you have the right transistors/mosfets/triacs). It will turn on or off just like a PWM signal. So for a DC signal, if you are using transistors or mosfets that can switch fast enough, the sketch will turn them on and off just like the PWM pins. This means that you can use ANY pin for dimming. As I mentioned earlier, last year I had my MEGAs controlling 48 channels that were all dimmable.
    So, if you wanted to use more pins on the MEGA, you would have to invest in a zero cross detector and the correct SSRs that will work. The mosfets you have been using to will probably still work. The SSR boards from Sainsmart will not. But a lot of folks on here have replaced the SSRs that come with the Sainsmart board with ones that are dimmable. Unfortunately, the replacement SSRs cost a lot. The alternatieve is to buy someone else's board or build your own. I opted to build my own. Mine cost about $2.00 per channel. But I missed the first year that I had wanted to put up a display because of the time it takes. It took me a year to figure everything out. And of course this year I am adding pixels which is a whole new ball game. The reason I have gone on so long is...if you want a display this year, I suggest keeping it simple. Go big next year and bigger the year after that. This year, use the MEGAs for the PWM controlled strips and the UNO for your AC on/off elemets.
    Kev,
    Fair enough, sounds like a good plan. As for the sketch would it be as simple as combining the 2 sketches I posted towards the beginning?

  6. #96
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    515
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by resjsu View Post
    Kev,
    Fair enough, sounds like a good plan. As for the sketch would it be as simple as combining the 2 sketches I posted towards the beginning?
    duplicate
    Kevin

    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  7. #97
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    515
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by resjsu View Post
    Kev,
    Fair enough, sounds like a good plan. As for the sketch would it be as simple as combining the 2 sketches I posted towards the beginning?
    Maybe use the PWM sketch on the MEGAs and Victor_PV sketch on the UNO. I don't think that I would have time this year to muddle my way through either of them to make them work for both PWM and the extra AC channels. I will take a quick look though. Can you tell me which post contains the correct sketch that you know works for the strips? Or post it anew.
    Kevin

    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  8. #98
    Join Date
    Jul 2017
    Posts
    50
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by kev View Post
    Maybe use the PWM sketch on the MEGAs and Victor_PV sketch on the UNO. I don't think that I would have time this year to muddle my way through either of them to make them work for both PWM and the extra AC channels. I will take a quick look though. Can you tell me which post contains the correct sketch that you know works for the strips? Or post it anew.
    Kev,
    Youve def been more than enough help as it is dont try to do the code. The two sketches are in post #30. I will use the victor sketch on the UNO and the PWM sketch on the MEGAs to start and once I have everything set up if I have time to modify code and refine I will but I think this will work. Im getting anxious for all of my material to arrive so I can start testing it all out.

    Thank you again!

  9. #99
    Join Date
    Dec 2014
    Location
    Southern California
    Posts
    515
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Sounds like a plan.
    Kevin

    2016 - 184 channels of Blinking/Flashing using 4 Arduino MEGAs and cheap home-made props.

  10. #100
    Join Date
    Jul 2017
    Posts
    50
    Post Thanks / Like

    Default Re: Arduino Uno & Vixen 3: Need help with sketch

    Quote Originally Posted by kev View Post
    Sounds like a plan.
    Kev,
    Got my one of my MEGAs and both SSRs today. Wired up a ssr and tested it with modified victor_pv code and I think I have it working right. I was pretty nervous powering up the lights, I mustve checked the leads about 60 times haha.

    https://www.youtube.com/watch?v=bzHUON4hbg0

    So far so good.
    Last edited by resjsu; 11-11-2017 at 11:26 PM.

Page 10 of 12 FirstFirst ... 89101112 LastLast

Tags for this Thread

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
  •