Small Lighting Controller PCB

Thread Starter

mbasile35

Joined Nov 2, 2011
23
Hey everybody

I'm trying to design and build a lighting controller with a pc output interface and a custom desgned relay board. Basically, i want to use this board along with an external 12vdc source to power relays which will power on 120vac outelts. These outlets will have lights plugged into them, and i'll use of a few different software options to drive the output board to program lighting sequences.

Here is the custom relay board i would like to make:


At the top is a screw terminal connector. The first terminal (all the way to the right in the picture) is from the 12v source and is supplied constant to the relays and the LEDs on the right (which are just test indicators for the relays) Then the next 4 terminals on the block are the grounds for each "channel" of lighting. The output board i picked pulses ground rather than voltage so thats why i did it like this. Each ground is connected between one relay and one LED in parallel. So connected to the top terminal will be the 12 volt source and the ground for each seperate channel of light. Then the bottom connector has the 120vac source all the way to the left and then to the right of that it has the 4 seperate "switched" wires the will get connected to the outlets for the output lighting. Also if you can't tell in the middle of the board those are just the holes for the relays which can be seen here

Okay so my question is: will it work? I've tested one "control" circuit without the 120VAC ouput and it worked.

I'm confident it will work I'm more concerned with the indicator LEDs how they're wired and then the actual layout of the traces and components on the board. I think i convered the whole circuit, if you need help deciphering anything i did just let me know. Thanks in advance for any help


Mike
 

Attachments

R!f@@

Joined Apr 2, 2009
9,918
Welcome to AAC.

If you can on off relay thru ur PC ( say you can hear the relay clicks ) then sure it will work.

{ed}
Aaah! u like to go further..sure it's no biggie .. if we cannot figure out a way for that to work, no one can.

It's do-able. But there are precautions.

Do you have the PCB's ?
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
thanks for the quick reply! Unfortunately, no, i don't have the pcb's yet. I'll be ordering the output board tonight. I should have mentioned above when i did my test it was with a NO pushbutton breaking and connecting the ground, simulating the output board. I did, however, just connect my single channel test circuit up to an outlet and it worked perfectly. what do you think of the LED wiring on the PCB design. should that work?
 

SgtWookie

Joined Jul 17, 2007
22,230
There is no path for the LV ground signals to turn on your LEDs.

If you rotated the resistors to the right 90°, you wouldn't have to use two sides of the board.

You are running traces completely through pads. It's best if you have traces terminate at pads (ie: only one trace coming into a pad and stopping there). If you have more than one trace entering/leaving a pad, it makes soldering much more difficult, and you may wind up overheating the pad, causing it to lift from the board. If that happens, the board is ruined.

Your 12VDC supply to the relay coils are pretty good, except for the one on the right - where you run the trace through the pad. The 120v line needs to be offset from the pads. Also, the 120v line runs unnecessarily close to R4.

It would be a good idea to include a fuse on the 120v input side. If there is no fuse and a fault develops, you will have a trace burn up instead.

You do not have diodes across any of the relay coils; this will cause your USB output driver board to be destroyed.

A quote from the page you linked to:

IMPORTANT: When connecting solenoids you must connect a diode across each coil to eliminate "back-EMF" discharge through the driver board. The diode is connected with the end marked with a line to the power-supply [positive] end of the coil. Diodes are not required when connecting LEDs.
 
Last edited:

Thread Starter

mbasile35

Joined Nov 2, 2011
23
There is no path for the LV ground signals to turn on your LEDs.

If you rotated the resistors to the right 90°, you wouldn't have to use two sides of the board.

You are running traces completely through pads. It's best if you have traces terminate at pads (ie: only one trace coming into a pad and stopping there).

Your 12VDC supply to the relay coils are pretty good, except for the one on the right - where you run the trace through the pad.

You do not have diodes across any of the relay coils; this will cause your USB output driver board to be destroyed.

A quote from the page you linked to:
ahh oops! i got a little too excited and forgot to finish the paths to the leds before posting. thanks for that. How's this look?

i ended up using both sides just for ease. As far as diodes go, what kind would you reccomend? I'm not too knowledgeable at all really when it comes to diodes. Thanks again!

Mike
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
Your 120VAC line is still unnecessarily close to the 12v line by R3 & R4. Move R3 & R4 up some. Pull the 120VAC trace down some.

The low side (green) trace comes a bit close to the left pad for R1 on LED1.

You could pull the right-hand side 120V secondary down a bit.

As far as the relay diodes, 1N914/1N4148 diodes would work just great. They are very fast, compact, and cheap. You must have one on each relay coil, cathode towards the +12v supply.
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
Okay so i've reworked the board. I really hope i have the diodes hooked up right. Again i cannot thank you enough for all of your valuable input SgtWookie

 

Attachments

Several questions come to mind regarding the board...
- How much current are you expecting in each of these traces? Generally, looking at most boards with high current, the practice is to make the traces as wide as possible. The copper on PC boards is very thin (1oz copper is 1.4mil thick usually). Think of starting with a full sheet of copper and cutting small gaps rather than starting with a blank sheet and adding traces and you'll get the idea.
- What sets or limits the current into the relay coils?
- Fusing and other precautions with 120Vac is critical, as others have mentioned.
- What case/enclosure will this go into, and how will the board be mounted and grounded?
- How will the 120Vac wires be brought in and strain-relieved? Or will you have outlets on the case for the 120Vac lights?

Other suggestions:
- Take a good hard look at other similar products' schematics and boards, and make sure you're learning and following best practices for design and assembly. There are certainly other lighting controllers out there, and you can probably pick up a used one from a music store or on eBay.
- It would be helpful to have a schematic that you are checking the board against (layout-versus-schematic), both for review by others and to be sure your layout is correct.

Lastly, it can't be emphasized enough that you need to be absolutely sure you know what you are doing when line voltages are involved. And if you don't, ask someone that does that can look over your shoulder and give advice. The things that can go wrong lead to electrocution or fire... so be careful. Some shop practices I'm aware of: use only one hand on the board at a time - other stays behind your back (tucked into your belt), start by using an isolation transformer when testing so a short won't put 20A into your board, don't test it without someone nearby that can call for help if needed, etc. I don't know your experience level, so you may be on top of this stuff already, but it's important to point out if not. Others on AAC can probably point to good sites about safety and design practices.
 

SgtWookie

Joined Jul 17, 2007
22,230
Good points, mixed_signal. The relay coil is 720 Ohms, so with a 12v supply, current is < 17mA.

I've been trying to get our OP to keep the 120v traces away from the low voltage stuff, but now the HV traces are crammed together too tightly and not wide enough.

I've already suggested adding a fuse, but perhaps they are considering adding that externally to the board. In any event, at least the hot lead needs to be fused at a lower amperage rating than the traces or the relays. The relays are rated 250V/3A.

The HV traces definitely need to be beefier, and the spacing needs to be wider. I feel like I'm herding cats at the moment.
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
Thanks guys, i'm definitely going to be making sure this is safe, i'm just trying to lay the board out for now.

Mixed Signal:

- How much current are you expecting in each of these traces?
The current in i'm specting is pretty low. Like Sgt Wookie said the the coils will draw about 17 mA. Plugged onto the 120 VAC lines will be led christmas lights rated at 20 mA.

- What sets or limits the current into the relay coils?
This is where i still need work. Most likely ill add a fuse inline from the 12v screw terminal before it makes contact with anything.

- Fusing and other precautions with 120Vac is critical, as others have mentioned.
Again, i still gotta work on it but, each seperate "switched" line will get overload protection.

- What case/enclosure will this go into, and how will the board be mounted and grounded?

I'm not positive on an enclosure yet, but basically the whole thing will be grounded to ground on the house through a three prong grounded plug.

- How will the 120Vac wires be brought in and strain-relieved? Or will you have outlets on the case for the 120Vac lights?

The case will have outlets for the lights t plug into.

Thanks for your concern, i really apreciate all of the insight. I'll be working on getting this thing overload protected and safe within the next few days,.


Sgt Wookie, thanks again for your insight. When i first started layig out this board i was afraid i wasnt going to be able to fill it, now i'm cramming things on there. Its going to take me a few tries but i'll keep messing with it and hopefully i'll figure it out.


Thanks again!
Mike
 

SgtWookie

Joined Jul 17, 2007
22,230
Mike,
It's looking better, but now you need to make those 120vac traces wider, and give the traces on the left a bit more separation; you pulled the "hot" 120v trace down too far.

The diodes are fine, btw.
 

SgtWookie

Joined Jul 17, 2007
22,230
Something I didn't really pay attention to before is that it appears you have used the same connector for both the low and the high voltage. This is not good, as you could accidentally plug the 120VAC into the 12V side, which would instantly kill a relay and a diode, and possibly damage traces on the board.

It would be a good idea to use different sized connectors so that can't happen. If you really need to use the same connectors for some reason, then make the pin used for the "hot" 120v an unused pin on the 12v side. This will prevent harm from occurring should it accidentally be connected up incorrectly.
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
Thanks

I'm still tweaking the thing but i think i'm getting there. I've got a few questions though

1-As far as current protection goes, what needs to be fused? What i was thinking was have the main 12 volt line go into 4 fuses each rated for the relay coils, and then those fused lines going to the relay coils. I'm confused however when it comes to the indicator LED's. Should these be fused as well? Also when it comes to the 120 Vac should i just fuse the main 120 line and not worry about the individual switched lines?

2-I was thinking of using solid state relays rather than traditional relays. The one i found is here. I know the current rating of the contacts is pretty low but as i said before the LED christmas lights are rated at 20 mA. I'm a bit confused on the wiring of these SSRs. This kinda what i get from it..


I'm pretty sure what i have there is right, but what confuses me is the "Trigger LED" and what the other legs of the chip are for. If you could help me clear that up itd be great.


Mike

EDIT-jsut realized the lv ground and positive 12volt wires should be switched

EDIT-I'me reading further into it now. From what i understand the trigger led is sort of like the coil in a traditional relay and it causes the Photo triac to close the 120 vol circuit?
 

Attachments

Last edited:

SgtWookie

Joined Jul 17, 2007
22,230
As far as fuses...
On the 12v side, a 1/2A/500mA 32v or higher voltage rated fuse on the 12v hot will be fine.

On the 120v side, use 1/2A 250V rated fast blow fuses on each SSR output.

On the primary side of the SSR, pins 1, 3 and 4 are all connected together.
You should connect just one of those pins to the output PCB.
Pin 2 needs to connect to 12v via a suitable resistor.
The IR emitter has a typical Vf of 1.21v @ 20mA. So, (12v-1.21v)/20mA = 539.4 Ohms.
Standard decade table is here:
http://www.logwell.com/tech/components/resistor_values.html
The closest E24 decade value to 539.4 Ohms is 560 Ohms.

[eta]
Wait a minute - are you going to power the SSR IR emitters from 5v on the output PCB, or from the 12v input to this board? Whichever you use, the output PCB and this board need to share a common ground.
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
At the moment, I'm just going to place all my components on a pre made PCB for now and connect everything with wire until i get it working how i want it to be. I mapped out how everything on the board will be connected. Does this look alright?



I'm still unsure whether the indicator LED's should be fused or not. Other than that i think i've got it. I ordered the SSRs and i have all the other components so I'm just waiting for the relays and the output pcb then i can get some tests goin

Mike
 

Attachments

SgtWookie

Joined Jul 17, 2007
22,230
I guess it's OK. I can't really tell, because there is no scale to it.

You aren't leaving much room for the HV fuses.

No, the LEDs don't need to be fused.
 

R!f@@

Joined Apr 2, 2009
9,918
by scale means that from ur drawing Sgt cannot figure out the actual distance between the traces.
U see when designing PCB's there is regulation to follow when using HV and LV on the same board, mostly HV. The distance between a L & N should be chosen such that with time and moisture from atmosphere will not effect the gap between the traces.

Two opposite polarities running close will create shorts and arcing in HV circuits.
 

Thread Starter

mbasile35

Joined Nov 2, 2011
23
I've been messing around again with the board now that i have a schematic done and i know for certain what needs to connect to what. I know my 120 traces might me a little close to the low voltage traces but I'm trying to keep them on opposite layers if the have to get close. How's it looking so far? I still have to connect the indicator LEDs but the main "functioning" part of the circuit works. If it gets to hard to get the traces in on the board for the indicator LEDs then i'll probably just not include them. It was be a nice feature to have though as the SSR's dont click like electromechanical ones. This is a pretty small board too (about 2"x3") so i can even make it bigger, i'd just prefer a nice compact size. anyway here it is:




Thanks again, all
Mike
 

Attachments

Top