1. New to Christmas lighting? Get started with the AusChristmasLighting 101 Manual:
    auschristmaslighting.com/wiki/AusChristmasLighting-101

Advice Using Arduino's to power relays

Discussion in 'DMX, E1.31 & Networking' started by Lishfish, Jan 22, 2017.

  1. Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    I am hoping someone could help give me advice on weather this would work or not.
    Here's what I would like to do.
    -Using an Arduino Mega to power two 16 relay boards. How and what parts required? (Obviously an Arduino mega and relay boards :p )
    - Running store brought lights as per the picture below. I figure one relay can power half/switch on and off and the other with the other half? (Power wire on one relay and negative on the other)
    [​IMG]

    Using an Arduino and relay board keeps my cost dramatically down :)
    Thanks in advance
     
  2. lytnin

    lytnin Apprentice Elf

    Joined:
    Jul 26, 2010
    Messages:
    89
    Likes Received:
    3
    Location:
    North Richmond NSW
    Hi Lishfish,
    You don't need to switch both the positive and the negative.


    Switching just one or the other will do the job. (I prefer switching the negatives).
    If it's AC voltage then either side will work.


    A couple of other things to note:-
    - you should just want to switch the low power side only. (ie Not the 240v)
    - avoid rapid on/off changes
    - dimming would be a problem if not out of the question.


    Cheers
    Dave
     

    Attached Files:

  3. OP
    OP
    Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    Hey thanks for your response. Wouldnt that only turn the entire set of lights on and off?
     
  4. David_AVD

    David_AVD Bite my shiny metal ass!

    Joined:
    Jun 12, 2010
    Messages:
    3,412
    Likes Received:
    43
    Location:
    Victoria Point (Brisbane)
    Find Me On:
    What else were you wanting to do?

    EDIT: Ah, so the LED strings are 2-wire, 2-channel (polarity swap) types?

    If so, hook the LED string between the COM terminal as you originally posted. Then connect the NO terminals of each relay to V+ and the NC terminals of each relay to V-.

    Activating one relay will turn one channel on or activating the other relay will turn the other channel on. Turning both relays on will turn the LEDs off (same as both relays off).
     
  5. lytnin

    lytnin Apprentice Elf

    Joined:
    Jul 26, 2010
    Messages:
    89
    Likes Received:
    3
    Location:
    North Richmond NSW
    David, wouldn't you have to flip both relays at the same time, to reverse both wires polarity at once?

    If you only turned on either relay, both wires would be +ve, or -ve depending which one was used.

    Wouldn't you then also need a third relay to disconnect power totally if you wanted no lights for a period?
     
  6. lytnin

    lytnin Apprentice Elf

    Joined:
    Jul 26, 2010
    Messages:
    89
    Likes Received:
    3
    Location:
    North Richmond NSW
    Ok, so disregard my last post.


    I see where the logic is now. I had to draw it out to make sense of it.


    Code:
    String Wire       Relay 1  Relay 2
                      Off/On   Off/On
    Wire A           -ve/+ve
    Wire B                     -ve/+ve
    
     
  7. David_AVD

    David_AVD Bite my shiny metal ass!

    Joined:
    Jun 12, 2010
    Messages:
    3,412
    Likes Received:
    43
    Location:
    Victoria Point (Brisbane)
    Find Me On:
    Yep, it's the same method used to operate a DC motor in either direction using relays.

    Both relays on or off results in no output.
     
  8. diyer

    diyer Full Time Elf Generous Elf

    Joined:
    Jan 5, 2013
    Messages:
    115
    Likes Received:
    7
    Location:
    Sunbury
    If your relays are DPDT you could do it like this (attached)

    You would still need another relay to disconnect (all off)


    Sent from my iPad using Tapatalk HD
     

    Attached Files:

  9. elnino

    elnino Full Time Elf

    Joined:
    Aug 1, 2014
    Messages:
    137
    Likes Received:
    0
    The arduino will drive those boards directly. A low signal energies the relay.
     
  10. battle79

    battle79 Full Time Elf

    Joined:
    Dec 8, 2012
    Messages:
    384
    Likes Received:
    0
    Location:
    Chirnside Park, Victoria, AU
    Lishfish,


    I think you will find what you are looking for here:-
    http://www.hansonelectronics.com.au/product/dmx2-18/


    Specifically designed for running the 2wire light sets, uses DMX input, so you will need something to output DMX. If your using any pixels then most controllers for pixels also have DMX outputs.


    Not trying to temper your DIY passion, just maybe saving you from finding this later and going doh!


    Smartalec has been known to dabbles with Arduino code and may have some input on that side.


    Regards,
    Rowan
     
  11. OP
    OP
    Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    Thanks for all the responses guys.


    To clarify, I want to be able to run half on the lights on a sting at a time; There are two lots of colours that flash at a time which alternates with the other 2 that are on the string. (If that makes sense)


    I also have been forwarded to hansonelectronics many a time but for my first year trying to keep the cost down (We have a whole big box and half storage cupboard full of store brought lights so spending $100 at the moment seems daunting, plus I enjoy DIYing anyways.


    And the only reason I am wanting to go with arduino's as they are cheap as well.


    Not trying to sound like a tight person but have a lot going on this year on the side. :)
     
  12. OP
    OP
    Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    Could you draw this out? I think I get what you mean but just want to clarify
     
  13. OP
    OP
    Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    Heres what I understand
    [​IMG]
    As the arduino's power the relays directly off of the pins
     
  14. lytnin

    lytnin Apprentice Elf

    Joined:
    Jul 26, 2010
    Messages:
    89
    Likes Received:
    3
    Location:
    North Richmond NSW
    Here you go.
     

    Attached Files:

  15. OP
    OP
    Lishfish

    Lishfish Full Time Elf

    Joined:
    Dec 26, 2016
    Messages:
    133
    Likes Received:
    11
    Location:
    Adelaide
    Find Me On:
    Thanks.
    Does this mean I have to power each set of lights via the 2 relays?
     

Share This Page