SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By xburningmikex
#65920
hello, I'm new here and new to using an arduino, but I'm not worried about understanding its possibilities.

I am, however, working on an art project and have come into an issue regarding control.

Some of you may remember this question, but I can't find it in the search. I have asked it before, but time has passed and I suppose the information has been deleted. So here goes..

I need to control a/c powered bulbs, individually in a grid system of 4x8.
I've been told in the past that I should construct/arrange the bulbs and relays in a matrix, but I don't know how to approach the wiring to make this happen.

Supposedly, I should need 12 total relays for the grid (4 across, 8 up) to make the ability to call up coordinates to turn on/off a bulb, but I'm not too sure how this would be affective in controlling the bulbs individually.



Any insight into my problem?
By VStar650CL
#65921
What AC voltage, and what wattage on the bulbs? If they're "tree bulbs" and draw less than ~6W, you could control them with 100mA opto-triacs, something like MOC3011's. It would make for a smaller layout than relays and give you the same isolation advantages.
By emf
#65927
Will there only be one bulb lit at a time? Or do you want to have several bulbs lit at the same time?
By xburningmikex
#65932
The board is to be flexible enough to allow anywhere from 1 bulb to all bulbs lit at once.

25w, 120v bulbs. The sockets are fiberglass standard sockets with 2 screws for each contact on the back to allow for serial wiring in rows, but a grid/matrix is confusing to me.

thanks for your help so far.
By muntron
#65936
xburningmikex wrote:The board is to be flexible enough to allow anywhere from 1 bulb to all bulbs lit at once.

25w, 120v bulbs. The sockets are fiberglass standard sockets with 2 screws for each contact on the back to allow for serial wiring in rows, but a grid/matrix is confusing to me.

thanks for your help so far.
I still think that you should consider opto triacs (see http://www.signindustry.com/electric/ar ... inted.php3). You need one for each bulb. The problem then becomes a diode matrix. There are many article on controlling a diode matrix display.
By xburningmikex
#65937
Well, in effect, isn't the opto-triac basically acting as a relay? I'm not sure what advantages it'll have over my existing structure.

I asked this question a little over a year ago and I got a response that included something along the lines of constructing an a/c matrix, that the coordinates of a bulb on the plane would be the manner in which it would be controlled.
From what I'm gathering, though, is that we'll eventually just need to admit defeat and always construct an individual circuit for each bulb, including a relay(or triac) for each output. Is this the final answer?


***

Now I'm separating this part because it's a totally different issue, but eventually, I'd like to be able to control not only the light being on and off, but having the ability to control the voltage of the bulb would also be quite useful. I'm not sure how I would go about being able to control a/c through a d/c system like the arduino, since the final resulting signal sent to the a/c line through the relay/opto-triac is still, esencially still just an on/off.

That's the big concern, I believe.
By VStar650CL
#65938
He'll still need to use standard triacs triggered by an opto, I don't know of any OT's that will directly handle 25W. He should also use relays (solid state or otherwise) for the short (4-element) leg of the array... hooking up triacs in series is a dangerous business, since N is still present and can send huge negative currents back through the gate of the downstream triac. Some triac gates can conduct almost as much current as the mains, so at the very least the gate resistor is instantly fried.
By VStar650CL
#65941
You can control dimming with a triac, just like a wall dimmer. You detect "zero cross" for the AC and then start a dimming timer, then turn the triac on only when the timer expires. In this way, you deprive the bulb of current for part of each AC phase, and voila... dimming.
By xburningmikex
#65943
VStar650CL wrote:You can control dimming with a triac, just like a wall dimmer. You detect "zero cross" for the AC and then start a dimming timer, then turn the triac on only when the timer expires. In this way, you deprive the bulb of current for part of each AC phase, and voila... dimming.
Hm.. well, that's maybe a bit more than I know. I'm new to this whole business (I'm an art student, this is my first big project), so help me understand the terms..

"zero cross"? detecting zero cross?
dimming timer? what do you mean? where does this get placed in the whole circuit? is it controlled by the triac or do I have to send another signal to another piece of hardware?

I'm confused, but learning.
By emf
#65944
xburningmikex wrote:Well, in effect, isn't the opto-triac basically acting as a relay?
It is. There are some nice things about opto-triacs (they're quiet, they are simpler to drive, they don't wear out as fast), but aside from that you could do it using relays to turn lights on and off just as easily.

The idea with a matrix layout is that you only display one row at a time, but you cycle through the rows many times per second to create the illusion that the bulbs are lit constantly (and for incandescent bulbs, they actually would be). Relays would wear out pretty quickly when used like that.

For the voltage control part of your question, well, use the google to read up on how triac dimmers work. There are quite a few beginner-ish pages out there that describe how they do their thing, then you can ask better questions here. It doesn't take much more hardware to control the brightness, it's mostly in the software. Dimming is something you can't do with relays.

I haven't seen one done, but it seems like you could do a four row matrix with dimming with just row/column triacs, but that's yet another layer of complication (if it would work).
By muntron
#65945
xburningmikex wrote:Well, in effect, isn't the opto-triac basically acting as a relay? I'm not sure what advantages it'll have over my existing structure.
Yes, the triac is acting like a solid state relay but has differences, I suggest you look up triacs in electronic texts (for example http://www.tpub.com/neets/book7/26e.htm). One difference is in the noise, but then you might like the clicking sound :-) . Another difference is speed, thus allowing dimming.
xburningmikex wrote:I asked this question a little over a year ago and I got a response that included something along the lines of constructing an a/c matrix, that the coordinates of a bulb on the plane would be the manner in which it would be controlled.
From what I'm gathering, though, is that we'll eventually just need to admit defeat and always construct an individual circuit for each bulb, including a relay(or triac) for each output. Is this the final answer?
The matrix is a simple method to allow control of many devices using less wiring. There are other possibilities like using shift registers. Most microprocessors have limited I/O which also necessitates using such methods. The matrix method simply arranges things in rows and columns. Only one column (or row) is enabled at one time. All the rows (or columns) associated with that column (or row) are then enabled appropriately. This works with diodes because the diodes prevent the current from flowing when not wanted. This does mean that you have to continuously refresh the display, but also provides the opportunity of dimming.
xburningmikex wrote:Now I'm separating this part because it's a totally different issue, but eventually, I'd like to be able to control not only the light being on and off, but having the ability to control the voltage of the bulb would also be quite useful. I'm not sure how I would go about being able to control a/c through a d/c system like the arduino, since the final resulting signal sent to the a/c line through the relay/opto-triac is still, essentially still just an on/off.

That's the big concern, I believe.
Relays will not be able to dim the display, they are not fast enough. While the control is just on/off, there is this thing called PWM. By varying the On/Off times, the effective average power is reduced and this gives dimming.
By VStar650CL
#65947
Bear in mind, that because the cycle length of AC is fixed at 50/60Hz, you can't "charlie-plex" in the traditional sense, especially if you are dimming and not just switching. The power company controls the frequency, not you. Also, triacs are latching devices, just like an SCR... the only difference is that they are bi-directional. While it is possible to drive every 3rd or 4th phase, the result will be quite dim and flickery. Whether this is acceptable for an "artful" application is up to the OP. If not, he will need 32 triacs.
By MrPotatoHead
#65982
Why not run the bulbs with DC? Running it from DC would allow any scan frequency to be used. Instead of triacs, power mosfets would be the switch.

From what I remember, using DC to power an AC bulb will burn it out faster. For an artish style project, I doubt long life span is a concern.

Yes, I know that a 120 Volt DC supply at the current level he needs is not a simple task.
By emf
#65984
Yep, that looks like the standard triac circuit. You can get the parts at any of the big name suppliers -- Digikey, Mouser, Newark. If you're going to do dimming, you will need some way to detect the zero cross events -- something like a 22K resistor, a 4N25 optoisolator, and a pull-up resistor if the arduino doesn't have it built in.

I've only dealt with bigger triacs and solid state relays, so I'll avoid recommending specific components. You might want to consider using solid state relays instead of building your own. Digikey lists a few random-turn-on SSRs (the kind you'd need for dimming) in 8-pin DIP packages that would be around $1 each if you're buying 32 of them. That might be a few pennies more than a DIY version, but it would save a lot of headache.

Do make sure you have a pretty good idea how everything will work before you build it. Places like Digikey will often have the parts to your door two or three days after you order them, even without paying for expensive shipping options, so you can afford to wait until you know what you need to order it.
Last edited by emf on Wed Feb 11, 2009 9:58 pm, edited 1 time in total.