Author Topic: Adresable relays  (Read 1922 times)

0 Members and 2 Guests are viewing this topic.

Offline qwertisTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Adresable relays
« on: May 14, 2019, 08:18:11 am »
Hello guys,

For a volunteer artwork project, I want to switch 30 230v light bulb - stretched over 35 meters.

Hardwired would be the best way to go ( no unstable wireless) because it needs to be robust and they will be switched on/off fast (the delay has to be minimal).

Therefore I would like to daisy chain the relays - addressable relays just like those ws2812 LEDs or DMX. Significant less cable is needed this way and I can connect them any way I want.

Preferably they have their own address so I can send a command like '14 1' which turns on the 15th relay.

Needless to say it needs to be relatively cheap. So giving each relay an Arduino with dmx shield would be a bit too much.

I envision this to be controlled by one Arduino (in addition with a dmx shield - if possible).

I've searched the internet for inspiration and similar projects but couldn't find one.

Could you tell me how you would have done something like this? Or maybe there is a better way than mine? Or is led the way to go (cost vs aesthetics, bulbs are way more beautiful)?  :)

Thank in advance for your advice,
Mark


 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Adresable relays
« Reply #1 on: May 14, 2019, 08:24:23 am »
Easy. Virtually any DMX LED dimmer with 12V relays instead of 12V LEDs connected, will do the job. Just don't send dimmed signal - either off or full brightness. [edit] Relay coil needs flyback diode to protect dimmer from overvoltages.

Just one of first internet search hits that would be OK: https://www.mossled.com/products/dmx-decoder-24-channel-16-bit-high-current Or this, cheaper one
« Last Edit: May 14, 2019, 08:29:51 am by ogden »
 
The following users thanked this post: qwertis

Offline qwertisTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Re: Adresable relays
« Reply #2 on: May 14, 2019, 09:04:44 am »
Hello,
Thank you for your reply!
This device would stand in the middle of the 30-meter path. To run two wires from this base station to all the relays would mean I need a lot of cable. I need to switch 30 bulbs, ever meter. So this means 2x1 meter + 2x2meter + 2x15 meters would add up to 242meters (x2 because you have a data + ground)(!) of cable. Okay, 12v rates cable would be way cheaper than 230v rated Cable. But still a lot of wiring.

To clarify:
I would like to use normal 230v ~25w household lightbulb.
The purpose is a 'light' show among a path of 30 meters. Each bulb is placed roughly every meter.
I am away from the speed and lifespan limitations of mechanical relays (vs solid state).
The kind of bulbs and switching times are subordinate. Most important is to daisy chain them (like ws2811 LEDs). If switching times and or watts are limited - I will be able to live with that.

See also the attached image
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Adresable relays
« Reply #3 on: May 14, 2019, 09:21:31 am »
Then use many DMX triac dimmers, one for each lamp or two.

 

Offline sorin

  • Frequent Contributor
  • **
  • Posts: 279
  • Country: de
Re: Adresable relays
« Reply #4 on: May 14, 2019, 09:27:09 am »
You can use shift register, and maybe just to be sure, you can parallel them with and port.
 

Offline ebastler

  • Super Contributor
  • ***
  • Posts: 6792
  • Country: de
Re: Adresable relays
« Reply #5 on: May 14, 2019, 09:49:59 am »
Have you estimated the cable cost for a simple, central control vs. the extra cost for the local transformers, relays and controller at each lamp? If this is for an outside installation, you will also need weatherproof enclosures for each device.

Radio-controlled LED bulbs for a cheap home automation system might be the easiest solution. (I saw that you prefer wired for reliability, but a cobbled-together wired solution will have its own interesting failure modes...)

Do you have a given budget limit for this?
 

Online mariush

  • Super Contributor
  • ***
  • Posts: 5119
  • Country: ro
  • .
Re: Adresable relays
« Reply #6 on: May 14, 2019, 10:49:15 am »
30 bulbs x 25w = 720 watts

I would suggest going with LED bulbs, which will work at 12v...24v  and will consume 3-15w depending on what you buy.
Here's some examples:


4 Pack 12V-24V AC/DC LED Edison G14 Bulbs 3W E26 Light Bulbs Low Voltage Edison AC DC Screw in Light Bulbs for Off Grid Solar Lighting Marine Boat RV 12V Interior Lighting 3000K Warm White for Camper
https://www.amazon.com/12V-24V-Edison-Voltage-Lighting-Interior/dp/B07HXLYCX8/

12 Volt 24 Volt 12V-24V LED Light Bulb, RV Camper Marine Light Bulb A19 Low Voltage 4W 470lm Edison Incandescent Bulb 40W, Off Grid Solar Battery System Lighting, E26 Base Warmwhite 2700K (Pack of 4)
https://www.amazon.com/12V-24V-Voltage-Incandescent-Lighting-Warmwhite/dp/B077Q2G7NZ/

and so on ... search amazon for "12v light bulb" or "24v light bulb"  ... but keep in mind a lot say 12v..24v though it's more like they'll tolerate 24v but aren't really designed for 24v.

Anyway... with the lower power consumption of 3-15w per bulb, with 30 bulbs you're looking at 300-500w which is more reasonable, something a cheap ATX power supply could provide.

You could use cheap ethernet cable to power everything ... you have 8 pairs of wires inside, each AWG24... use 6 wires for power , and a pair for data (bits + clock)
If you can place the controller in the middle, you can make two strands ... one with 15 bulbs , one with the other 15v bulbs, to reduce the current through the 6 wires, and the voltage drop.

You could have a basic 12v-5v ldo at each bulb, a microcontroller that reads the bits coming on the pair and pushes forward to the next if the address is not for them.. this way, the bits only need to travel between bulbs, so you don't need loads of power.
You can set the address of each bulb with a few jumpers or solder points... if you have 30 leds, 5 bits give you 2^5 = 32 unique addresses. You can go with 6 bits for expandability and then you have maximum 64 addresses.
You could also set the addresses automatically ,,, for example if you send address 0, that means the first device with no address set will respond to that command.
So for every bulb you have in the chain you send "device with address 0 , set address 1" , "device with address 0, set address 2"
"device with address 0 , set address 1" : The first device will have no address set, so it will pick up the command for address 0 and set its own address to 1"
"device with address 0, set address 2" : First device has address 1, so ignores this command and just sends it forward to next device in chain. Next device has address 0, so it takes this command and sets its own address to 1.
... and so on ...

So you'd either need a microcontroller with 6 + 2 (input data) + 2 (output data) + 2 (power+gnd) + 1 (on/off led)  = 14 pin micro , or you could even do it with an 8 pin micro with auto address assignment.
You could do it with just one data wire, by sending the signal at a fixed frequency but ethernet cable is cheap.

As for turning on and off ... with just 12v you could just use a npn transistor or mosfet to turn on 12v to the led bulb.  Save money on relays, put more money on the ethernet cable and the light bulbs.
 

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Adresable relays
« Reply #7 on: May 14, 2019, 12:40:00 pm »
I'd opt for a communication interface like CAN or RS-485. Having the nodes wired up in a line would be just perfect for this sort of communication.

The cheapest microcontroller + CAN transciever IC would run you about 2€ per node. Not a bad price, I think.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: Adresable relays
« Reply #8 on: May 14, 2019, 12:59:32 pm »
I'd opt for a communication interface like CAN or RS-485. Having the nodes wired up in a line would be just perfect for this sort of communication.

No need to reinvent wheel - just use DMX512 which is exactly that sort of communication (based on RS-485).
 
The following users thanked this post: Someone

Offline Dave

  • Super Contributor
  • ***
  • Posts: 1352
  • Country: si
  • I like to measure things.
Re: Adresable relays
« Reply #9 on: May 14, 2019, 01:06:12 pm »
No need to reinvent wheel - just use DMX512 which is exactly that sort of communication (based on RS-485).
Ah, right, that would be the way to go. Perhaps just replace the expensive XLR connectors with something like screw terminals to keep the cost down.
<fellbuendel> it's arduino, you're not supposed to know anything about what you're doing
<fellbuendel> if you knew, you wouldn't be using it
 

Offline JDubU

  • Frequent Contributor
  • **
  • Posts: 441
  • Country: us
Re: Adresable relays
« Reply #10 on: May 14, 2019, 02:20:45 pm »
Take a look at this:
https://www.tinyosshop.com/index.php?route=product/product&path=141_142&product_id=363

It has an on-board arduino that is pre-programmed to take single character ascii commands on its serial port to control the relays.  It also has an FTDI USB to serial chip as well as connectors for WiFi and Bluetooth to serial modules.  You can also reprogram the arduino to control the relays with a different command protocol.

There are a bunch of variations of this type of board from various sources.
For example:
https://www.tinyosshop.com/index.php?route=product/category&path=141
https://www.banggood.com/Wholesale-Relay-Module-c-8133.html
« Last Edit: May 14, 2019, 02:31:56 pm by JDubU »
 

Offline qwertisTopic starter

  • Newbie
  • Posts: 6
  • Country: nl
Re: Adresable relays
« Reply #11 on: May 23, 2019, 06:13:22 pm »
That is a lot food for thought! Thanks guys! :)
 

Offline ajb

  • Super Contributor
  • ***
  • Posts: 2693
  • Country: us
Re: Adresable relays
« Reply #12 on: May 23, 2019, 10:29:11 pm »
You say "the delay has to be minimal" but in electronic terms incandescent bulbs take ages to turn on and off, so there's a definite upper limit to how fast an interface is really useful.  Consider that the luminous output of the bulb appears continuous despite the fact that on AC they bulb is actually turning off and on 100-120 times a second.  This is why DMX, which was developed in the 80s, boasts a typical refresh rate of only ~40Hz, because faster isn't useful with incandescent sources.  LEDs would be a different story, and in fact LED fixtures tend to use internal timing to provide for strobe effects instead of relying on direct DMX control for timing.

Anyway, your effective maximum useful update rate for the whole array of bulbs is only going to be on the order of 40Hz, and with only on-off control that's a data rate of 1200bos.  Assuming the bulbs are spread evenly, there's only a 1m from one unit to the next, so using anything RS485 based is probably unnecessary.  You can run the whole thing like a set of cascaded 1-bit shift registers, so you just need 5 wires (Gnd, +5v, Clock, Data, Latch), and just use direct 5v logic signalling.  Preferably you'd buffer the signals at each unit, and use a schmitt trigger at least for the clock and latch lines.  You could do this with discrete ICs, but you could also just use an MCU, at the data rates in question it would be perfectly easy to bitbang.  Or, if you wanted slightly higher data rates for whatever reason, you could use hardware SPI, with MOSI on one unit connected to MISO on the next, and send an 8-bit command to each node.  Either way, the whole thing is still a shift register, so you can implicitly address each node according to its position within the chain by setting the right bit(s) in the shifted-out data.

Side note, for switching the bulbs on and off, a zero-crossing SSR would be preferable to a mechanical relay to avoid the transients that would occur if your relay happens to switch on or off at the top of the half-wave.
« Last Edit: May 23, 2019, 10:32:21 pm by ajb »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf