32 channel lighting controller

Thread Starter

masterful

Joined Feb 12, 2014
10
Hello to all.

I am in the design process of making a controller to switch 32 channels of DC led lighting.

So far I am at the following stage.
Using an arduino uno to control 2 tlc5940 chips switching power MOSFETs through logic invertors.

Can anyone advise or help me. I wish to change the design and use a pic to control the chips. With a stand alone PSU. And of course a usb.
Currently I use vixen lights software.

Many thanks indeed

Matt
 

Thread Starter

masterful

Joined Feb 12, 2014
10
Thanks for getting back to me.
The arduino is great. It was just a long term thought I suppose. Think I should probably stick with something I know rather than dive into the unknown.

On another note is there a design spec guide for making an ac 4 channel solid state relay powered by 5 volt DC for the control side.
I have bought some moc3021x optocouplers to use as relays but am worried about overloading the arduino.
Sorry if I'm posting this in the wrong place.

Cheers

Matt
 

mcgyvr

Joined Oct 15, 2009
5,394
If you know PIC then use PIC..
Arduino is just as easy if not easier IMO..

"overloading" concerns are identical with a PIC or Arduino.. As long as you are using optos, feeding the coils of the relays from their own supply and keeping opto LED current at 20mA or less there aren't any problems.

Just google "Vixen lights arduino" there are TONS of videos/tutorials/reading.. Just start learning from those.. I'm sure there is more than enough info in those to complete your project.
 

Thread Starter

masterful

Joined Feb 12, 2014
10
Many thanks for your input.

This is the part where i really fall short.
"overloading" concerns are identical with a PIC or Arduino.. As long as you are using optos, feeding the coils of the relays from their own supply and keeping opto LED current at 20mA or less there aren't any problems.

I assume i would need to design a circuit to control the opto seperatley?
this side of things is new to me as i used omron prebuilt solid state relays last year. they had a 5 volt dc input to drive the relay contacts. is it possible to make a similar circuit using a moc3021x, the spec says the leds draw 10mA per unit.

thanks
 

fnicoli

Joined Apr 8, 2014
3
I know little to nothing from the world outside AVRs (the micro-controllers used in Arduinos), but I'm aware that some PIC families have built-in USB device peripherals, which would be a good choice if you want a slim design.

About the AVRs, you don't need the whole Arduino board to control your design. It's all about the chip. You can program the ATMega on the board and remove it to your design. This would keep you in a known environment (the Arduino IDE and libraries you might be using), but I do not know any <16 pin AVR with built-it USB features. That would force you to use either external UART/USB converters, such as an FTDI chip, or choose a big (and maybe not so cheap) AVR with a higher pin count. Note that not all AVR chips are compatible with the Arduino IDE.

If I was to choose the better option, for me it would be to learn how to use the PIC.
 

mcgyvr

Joined Oct 15, 2009
5,394
Many thanks for your input.

This is the part where i really fall short.
"overloading" concerns are identical with a PIC or Arduino.. As long as you are using optos, feeding the coils of the relays from their own supply and keeping opto LED current at 20mA or less there aren't any problems.

I assume i would need to design a circuit to control the opto seperatley?
this side of things is new to me as i used omron prebuilt solid state relays last year. they had a 5 volt dc input to drive the relay contacts. is it possible to make a similar circuit using a moc3021x, the spec says the leds draw 10mA per unit.

thanks
I/O pins on any micro have "limits" to how much current they can supply..
You just can't make them "source" more current that they can supply.. All devices have limits..

Its nothing to be scared about.. You just size the resistor for the optocoupler LED properly to ensure that its not pulling more current than the pins can supply..

It is this simple..
Say the pin is limited to 20mA...
Using ohms law we know that.. R = V/I
V = 5V and I = 20mA
5/.02 = 250 ohm resistor..
If we do 5V and 10mA
Its 5/.01 = 500 ohm.. So anywhere from 250 to 500 ohm (330 is perfect IMO) and you are "safe"

and "usually" optos will operate just fine from a min of 5mA up to 50mA.. (that info is in the datasheet)..
 

Thread Starter

masterful

Joined Feb 12, 2014
10
That's excellent. Thanks for that. The more I dig the more I learn.

Am I right in thinking that the arduino mega can source a max of 200ma. So using the mega to power the TLC chips will provide 20 ma per channel max using an iref of 2.2kohm. That should be more than enough to fire the opto.

Would a seperate 5volt supply to the relays be beneficial or not.

Thanks again

Matt
 

mcgyvr

Joined Oct 15, 2009
5,394
That's excellent. Thanks for that. The more I dig the more I learn.

Am I right in thinking that the arduino mega can source a max of 200ma. So using the mega to power the TLC chips will provide 20 ma per channel max using an iref of 2.2kohm. That should be more than enough to fire the opto.

Would a seperate 5volt supply to the relays be beneficial or not.

Thanks again

Matt
To switch an opto from a digital arduino pin you simply put a 250 to 1000 ohm resistor in series with the side of the opto.. I use 330 ohm.. Not sure where you got 2.2k??
the 200mA limit is for the Vcc/GND pins so assuming you use a 500 ohm resistor then each pin will be drawing 10mA.. 200/10=20.. So you can essentially have 20 optos on 20 digital pins all on at the same time continuously.. 40 if you use multiple ground pins..

The reason you can't drive most relays directly from the output pins is because they require more current to operate than what you should safely provide from the digital pins.. So optos or transistors or mosfets are commonly used as they require less current with a separate/split supply powering the relays.
Optos also provide physical isolation for safety reasons as the only connection from one side to the other is the beam of light from the LED not electrical connections.


As for the power supply question..
Well the arduino can take a 5V (regulated) power supply and you can pull right from the Vin pin to get 5V (up to a certain amount of current) or the arduino can take a higher voltage supply and using the onboard 5V regulator the 5V output pin gets you 5V like that (up to a certain amount of current again)..

or you can simply split the wires before it goes into the arduino and use one of the splits to power your 5V stuff and the other to power the arduino..

or you can use 2 different supplies ..
lots of choices..
 

Thread Starter

masterful

Joined Feb 12, 2014
10
OK that clarifies a few things for me.

How would I power the opto with an inline 5volt supply.
I thought the output pin of the arduino powered the opto. Or am I getting confused. The 8 channel omron relay has a separate input. So it doesn't require a supply from the arduino only a digital output and ground.

The tlc 5940 chipset I'm using to power mosfets controlling a DC load. The 2.2kohm Resistor limits the current through each channel on the chip to 20ma max.
It has a 5v supply from a PSU.
 

mcgyvr

Joined Oct 15, 2009
5,394
I thought we were still talking about optos/relays instead of the tlc so sorry I got a bit confused.. but here is an image of how you would use an opto to power some leds from a separate 9v supply.. The led side of the opto is driven from the digital pin (5V) but the 9v side is totally isolated from the arduino side
http://www.varesano.net/files/optocoupler_circuit_scheme.png

And still confused because I'm not sure why you are even using the tlc in the first place..
the mega can control 54 mosfets (logic level) directly just with its built in pins .. tlc could be used with a smaller arduino board if you run out of digital i/o pins and need to "expand" by adding that chip.
 

Thread Starter

masterful

Joined Feb 12, 2014
10
Good morning.
I am using the TLC chip because I want to make all channels dimmable where a the mega can only pwm 12 channels. Also I am looking to dim around 12 ac 230volt channels of lights consuming between 30 and 150 watts each channel. The rest will all be LEDs rated at between 3 and 7 watts per string.
 

Thread Starter

masterful

Joined Feb 12, 2014
10
Hi there.
Been a long time but I'm still working on this project.
Could I use a 12volt pull up on the TLC output to control an irf530 MOSFET as they require 10volt saturation.

Could this work?
 
Top