Critique my schematic

eetech00

Joined Jun 8, 2013
3,946
You don't need the diode across the relay, there's one already built into the ULN2003.
The relay is still showing a part family that I don't think has a 5v version (I could be wrong on that, i didnt do much searching)
Since the TS asked about reliability, I recommend keeping the separate diode across the relay, and kept as close to the relay as possible. The external diode is more rugged and help will keep back EMF confined to the relay.
The ULN2003A is the 5v version
 

Irving

Joined Jan 30, 2016
3,884
Alright, I will add 10uF 16v caps to the 7805 output. What are these caps for?
The 10uF adds a bit of local bulk capacitance, though it used to be shown religiously on the datasheets, it seems to have been dropped. Won't hurt to have it there, basically to provide a local reservoir against a local spike in demand (like your relay pulling in). The smaller 0.1uF is to handle fast transients and helps the regulator adjust more quickly.



This looks cool. How do I search for the connector symbol?
In KiCAD, place symbol, click on schematic to open library browser.. if you know the connector type e.g. a JST XH or whatever search for it. If you just want a pin header use the generic "conn". Note male and female, female is the bit on the end of the wire with hole in it, male is the pin on the board that sticks up :) but thats not always true. A plug that goes into a receptacle on the board is male, even though it has female sockets inside... the bit on the board is therefore female... confused, you will be!

1594647401615.png
 

Thread Starter

redgear

Joined Oct 17, 2019
136
It depends on the purpose of the switch. Not all switches need to be debounced.
Debouncing a single-pole switch in hardware is not foolproof. Software is an easier solution.
Thanks. I will stick to software debouncing then. Did you take a look at the updated schematic? Can anything be improved?

Since the TS asked about reliability, I recommend keeping the separate diode across the relay, and kept as close to the relay as possible. The external diode is more rugged and help will keep back EMF confined to the relay.
The ULN2003A is the 5v version
Thanks, I already have a external diode connected to the relay.

The 10uF adds a bit of local bulk capacitance, though it used to be shown religiously on the datasheets, it seems to have been dropped. Won't hurt to have it there, basically to provide a local reservoir against a local spike in demand (like your relay pulling in). The smaller 0.1uF is to handle fast transients and helps the regulator adjust more quickly.
Great, thanks!
In KiCAD, place symbol, click on schematic to open library browser.. if you know the connector type e.g. a JST XH or whatever search for it. If you just want a pin header use the generic "conn". Note male and female, female is the bit on the end of the wire with hole in it, male is the pin on the board that sticks up :) but thats not always true. A plug that goes into a receptacle on the board is male, even though it has female sockets inside... the bit on the board is therefore female... confused, you will be!

View attachment 212060
Yep, I found it :)
 

Thread Starter

redgear

Joined Oct 17, 2019
136
I recommend both. However, the HW debounce does not need to be as elaborate when used with SW debounce.
It can be a simple cap and resistor with the input of the switch connected to the R/C junction.
Alright, will a 0.1uF cap in addition the existing 10k pullup be enough?
 

MrChips

Joined Oct 2, 2009
30,801
Did you take a look at the updated schematic? Can anything be improved?
We usually put any GND connection down below, not up in the air.

In a much more complex drawing it is acceptable to leave out Vcc and GND connections and decoupling capacitors at the ICs but show them on the side so that they are not being ignored.
 

Irving

Joined Jan 30, 2016
3,884
On your latest rendition, try to avoid wires that travel across the entire drawing, they are a candidate for a net label, ACNeutral and ACLive are a good example.

Try to keep the flow primarily left -> right, avoid unnecessary changes in direction. Don't forget the switches need a ground connection in that connector.

To avoid the mess of those switch wires there's two options... firstly just keep them neat and allow the resistor connection to jump the traces, like this

1594652614756.png

Or you can use the Bus feature of KiCAD like this. I've also shown a resistor network rather than individual parts. I wouldn't recommend this for your schematic as its a bit of effort to set up, but on a more complex drawing this makes it easier to read.

1594652190907.png
 

bwilliams60

Joined Nov 18, 2012
1,442
@jpanhalt, The OP has been working with this format since the opening post and has made revisions as suggested. With it being a simple schematic, it was suggested that he make it into one schematic as it would be easier to read and save the block format for more complex schematics. Personally, I think he has done a great job and has asked all the right questions and made necessary changes and should just keep on doing what he is doing.
I do have a question while I am here on the subject and that is, does anyone have any good books or articles on schematic design and layout from basic to complex?
 

jpanhalt

Joined Jan 18, 2008
11,087
@jpanhalt, The OP has been working with this format since the opening post and has made revisions as suggested. With it being a simple schematic, it was suggested that he make it into one schematic as it would be easier to read and save the block format for more complex schematics. Personally, I think he has done a great job and has asked all the right questions and made necessary changes and should just keep on doing what he is doing.
I do have a question while I am here on the subject and that is, does anyone have any good books or articles on schematic design and layout from basic to complex?
That (underlined) is not how read MisterBill2's comment (post #33 ):
ONE SERIOUS COMMENT: the purpose of a drawing iis never to look tidy. The reason for a drawing is to depict the circuit of a system. A drawing split into little blocks is not very useful when there is a need for somebody to understand the system circuit. I have a lot of experience with drawings and equipment and what is useful and what is far less useful.
I read that as dogmatic and often wrong advice. Using nets, labels, and buses will often lead to a much clearer schematic. The example I gave is quite clear from a functional standpoint. It is not really just a matter of taste. For example, many electronic CAD programs do not show the power connections to logic devices on the symbol directly.
 

MisterBill2

Joined Jan 23, 2018
18,477
When creating a large logic circuit board using buss notation is fine. Likewise providing understood power connections.
But for those systems that may be be built by a tech and then serviced by one not intimate with that system. In a manufacturing plant there may be a few dozen machines, or possibly a few hundred. For servicing those machines a reasonably complete circuit is handy. Unless the service person is simply one who changes blocks until something looks fixed.
So a circuit for one of the CPU boards that will never be serviced, only replaced, or any of those modules not worth repairing, any format is fine.
 

Thread Starter

redgear

Joined Oct 17, 2019
136
On your latest rendition, try to avoid wires that travel across the entire drawing, they are a candidate for a net label, ACNeutral and ACLive are a good example.

Try to keep the flow primarily left -> right, avoid unnecessary changes in direction. Don't forget the switches need a ground connection in that connector.

To avoid the mess of those switch wires there's two options... firstly just keep them neat and allow the resistor connection to jump the traces, like this

View attachment 212068

Or you can use the Bus feature of KiCAD like this. I've also shown a resistor network rather than individual parts. I wouldn't recommend this for your schematic as its a bit of effort to set up, but on a more complex drawing this makes it easier to read.

View attachment 212066
Thank you. I will make those changes.

@jpanhalt, The OP has been working with this format since the opening post and has made revisions as suggested. With it being a simple schematic, it was suggested that he make it into one schematic as it would be easier to read and save the block format for more complex schematics. Personally, I think he has done a great job and has asked all the right questions and made necessary changes and should just keep on doing what he is doing.
I do have a question while I am here on the subject and that is, does anyone have any good books or articles on schematic design and layout from basic to complex?
Thank You. Redoing the circuit twice as the more I use KiCad the more I get used to it. I am personally liking the blocked style.

Now that the schematic is way better than it was before. I have few more questions.

1) I have been reading about TRIACS, SSR and Relays. But they seem to be contrasting. What be the best for my application? TRIAC, SSR or Relay?
2) I will be placing this PCB inside a metal box, is there any thing that I should take care of?
3) What are the failure points in this circuit? How can I identify and mitigate it?)
4) I will be driving electronic ballasts that drive the tubes, those are resistive loads I guess and there are no inductive components on board. Do I still need to worry about EMI/EMC?
5) Do I need ESD protection?
6) Is the circuit production ready?
7) Once again, Do I need anything to make this circuit more safe and reliable?

Thanks :)
 
Last edited:

Irving

Joined Jan 30, 2016
3,884
1) I have been reading about TRIACS, SSR and Relays. But they seem to be contrasting. What be the best for my application? TRIAC, SSR or Relay?

That depends on what you are switching. Triacs & SSR can do zero voltage switching, (ZVS) i.e. the switch comes on at the zero crossing of the AC and so generates little electrical noise. Its also less stressful on the part. Relays don't do ZVS so for inductive and/or high current loads you need a snubber network (R & C combo) across contacts to reduce sparking and damage to contacts.

An SSR is a Triac with supporting bits. Generally for just switching an SSR is best - if you were doing dimming or speed control you might go with a raw Triac. SSR will be more expensive than a relay for larger loads (though the differential is reducing rapidly).

When you lay your PCB out we need to talk about isolation of AC circuits as these will be on the PCB assuming your relay/SSR and mains transformer are PCB mounted. Also track widths and current capacity/loading as we don't know that yet.


2) I will be placing this PCB inside a metal box, is there any thing that I should take care of?

Your ground plane should connect to the box via one of the mounting studs. There's whole load of do's and don'ts here, best left to another thread/discussion when you lay out your PCB. Also need to consider how AC gets in/out of box.

3) What are the failure points in this circuit? How can I identify and mitigate it?)

Check power consumption of circuit and dissipation in regulator. Other than that there are no obvious failure points - though you've not talked much about your load and sizing of that. Of course this isn't the final schematic as that will show the Atmel processor, Xtal, etc. and that's the one you'll be laying out your PCB from.

4) I will be driving electronic ballasts that drive the tubes, those are resistive loads I guess and there are no inductive components on board. Do I still need to worry about EMI/EMC?

Ballasts can be inductive, you need to look at the datasheet for the specific items. I don't think however there are any significant EMI/EMC issues with this board as its essentially a remote switch. You do ned to think about SSR rating however and maybe a snubber network.

5) Do I need ESD protection?

If your user action is only through the 6 switches and they are quality items, and are physically bonded to the metal case I'd say no.

6) Is the circuit production ready?

Does it do everything you need? Have you toleranced all components across voltage & temperature extremes? Have you considered the environment its going in to?

7) Once again, Do I need anything to make this circuit more safe and reliable?

Your AC is fused and switched - do you have 1 switch or 2?
Your box grounded.
Suitable load switching assessed?
See 6.
 

MisterBill2

Joined Jan 23, 2018
18,477
THis is in response to the question about "TRIAC, SSR or Relay? "
Triacs are possibly the simplest interface method but thet are 3-terminal devices which means that the control circuit is linked directly to the power circuit being controlled. In an isolated control system that may not be a problem, but in other instances it may result in needing additional effort to avoid problems.
Solid state relays are more isolated , and come in a wide range of sizes and ratings. But the larger sizes of SSRs cost quite a bit more and take up a lot more space, and some of them require heatsinks.
Electromechanical relays can provide the best isolation, but they require more power to operate, they are a bit slower, and they take up more space than other types. They also have a shorter life-span, although they usually outlast the system that they are part of. Relays are also far more able to survive short voltage spikes and overloads.

So the choice of output devices depends a lot on the application and requirements. All three types are commonly used and so they are widely available.
 

Thread Starter

redgear

Joined Oct 17, 2019
136
That depends on what you are switching. Triacs & SSR can do zero voltage switching, (ZVS) i.e. the switch comes on at the zero crossing of the AC and so generates little electrical noise. Its also less stressful on the part. Relays don't do ZVS so for inductive and/or high current loads you need a snubber network (R & C combo) across contacts to reduce sparking and damage to contacts.

An SSR is a Triac with supporting bits. Generally for just switching an SSR is best - if you were doing dimming or speed control you might go with a raw Triac. SSR will be more expensive than a relay for larger loads (though the differential is reducing rapidly).

When you lay your PCB out we need to talk about isolation of AC circuits as these will be on the PCB assuming your relay/SSR and mains transformer are PCB mounted. Also track widths and current capacity/loading as we don't know that yet.
The load I will be switching are 6 light tubes. Each are driven by a ballast. The tubes draw a current of 0.4A each.
0.4*6 =2.4A, doubling it I get 4.8A, so I went with a 5A fuse on the mains. I'm also planning to add a 1A fuse on each tube separately.
5A is not a huge load, correct? What should I go with for most reliability? Irrespective of the choice, it should be rated for 5A, correct?
Yeah, I plan to start a separate thread when I start laying it out.

Your ground plane should connect to the box via one of the mounting studs. There's whole load of do's and don'ts here, best left to another thread/discussion when you lay out your PCB. Also need to consider how AC gets in/out of box.
Alright, Thanks!

Check power consumption of circuit and dissipation in regulator. Other than that there are no obvious failure points - though you've not talked much about your load and sizing of that. Of course this isn't the final schematic as that will show the Atmel processor, Xtal, etc. and that's the one you'll be laying out your PCB from.
Ok. I will be connecting the power hungry components(tubes in circuit) directly to mains. So the only things that draw power from the Vreg out will be the microcontroller, display and relay. So at max 500mA. As per the datasheet the 7805 can handle upto 1.5A.
I was thinking about having two relays in series, just so even if one melts and remains ON all the time, the other can cut-off the circuit.
Just to be extra safe, I have wired the circuit such that if SW23 opens no power is provide to the load irrespective of the relay's condition. But, my initial design was to wire the switch to the uC and turn on relay only if its closed. The present circuit would guarantee, cut-off but the relay might be on even if the switches are open as the uC cannot read the state of the switch. Which is better?

Ballasts can be inductive, you need to look at the datasheet for the specific items. I don't think however there are any significant EMI/EMC issues with this board as its essentially a remote switch. You do ned to think about SSR rating however and maybe a snubber network.
How can I find it from the datasheet? The datasheet provided EMC Immunity Standard certification details. Does that mean it's inductive?

If your user action is only through the 6 switches and they are quality items, and are physically bonded to the metal case I'd say no.
Yes, that's how I plan to do it. But I found a cool chip CAP1206 that let's me add capacitive touch buttons. I'm looking for capacitive buttons, I might switch to that if I find them.

Does it do everything you need? Have you toleranced all components across voltage & temperature extremes? Have you considered the environment its going in to?
It will be in a household. So nothing rugged. I have derated the caps already. I have started reading on the types(X7R, X5R,etc) and when to choose use them. I am yet to start working on the resistors.

Your AC is fused and switched - do you have 1 switch or 2?
Your box grounded.
Suitable load switching assessed?
See 6.
1 switch for the mains to load, second for microcontroller and other components.

Thanks you!
 

Thread Starter

redgear

Joined Oct 17, 2019
136
THis is in response to the question about "TRIAC, SSR or Relay? "
Triacs are possibly the simplest interface method but thet are 3-terminal devices which means that the control circuit is linked directly to the power circuit being controlled. In an isolated control system that may not be a problem, but in other instances it may result in needing additional effort to avoid problems.
Solid state relays are more isolated , and come in a wide range of sizes and ratings. But the larger sizes of SSRs cost quite a bit more and take up a lot more space, and some of them require heatsinks.
Electromechanical relays can provide the best isolation, but they require more power to operate, they are a bit slower, and they take up more space than other types. They also have a shorter life-span, although they usually outlast the system that they are part of. Relays are also far more able to survive short voltage spikes and overloads.

So the choice of output devices depends a lot on the application and requirements. All three types are commonly used and so they are widely available.
Thank You!
I just want a fail safe way to cut-off power to components when signaled by the micro or when the SW23 is opened. I read relays can get melted and form a always ON circuit which I am afraid of. Maybe 2 in series can reduce the probability of that happening?
 

MisterBill2

Joined Jan 23, 2018
18,477
Relays becoming stuck on is fairly rare, and depends on the relay type. There are also double-break relays that have two contacts in series, and they are a better choice than two separate relays. And relay sticking is very much related to the relay capacity relative to the actual load. So use 5 amp relays instead of 2 amp rated ones.
Now as for fuse ratings, 1 amp for each load is reasonable but 5 amps as the protection for the group is low, since any given load failure might pop the 5 amp fuse and disable all of the lights. I suggest a ten amp fuse, since the purpose of the inlet fuse is to protect the supply connection in the event of a fault in the control system, not the individual loads.
 

Thread Starter

redgear

Joined Oct 17, 2019
136
Relays becoming stuck on is fairly rare, and depends on the relay type. There are also double-break relays that have two contacts in series, and they are a better choice than two separate relays. And relay sticking is very much related to the relay capacity relative to the actual load. So use 5 amp relays instead of 2 amp rated ones.
Now as for fuse ratings, 1 amp for each load is reasonable but 5 amps as the protection for the group is low, since any given load failure might pop the 5 amp fuse and disable all of the lights. I suggest a ten amp fuse, since the purpose of the inlet fuse is to protect the supply connection in the event of a fault in the control system, not the individual loads.
Thanks! Great! If I go with 5A relays, do I still need a snubber network?
 

Irving

Joined Jan 30, 2016
3,884
Read up about common precautions with SSR from Omron, particularly the section on sizing.

Don't over-think things. Safety is important but relays & switches have been around for years and are well understood. Your load isn't massive, so a little common-sense is needed, rather than over-engineering.


Your AC mains switch, I'm still not clear if that's 1 physical switch or two separate switches? Either way, switching AC you should alwas use double pole switches. Assuming its one switch, switching power to both load and controller then the following is correct:

1594728474194.png

If its two switches, one for load, one for controller then, assuming 1 mains input connection (how do you envisage that, IEC c

1594728800638.png
 

Thread Starter

redgear

Joined Oct 17, 2019
136
Read up about common precautions with SSR from Omron, particularly the section on sizing.

Don't over-think things. Safety is important but relays & switches have been around for years and are well understood. Your load isn't massive, so a little common-sense is needed, rather than over-engineering.


Your AC mains switch, I'm still not clear if that's 1 physical switch or two separate switches? Either way, switching AC you should alwas use double pole switches. Assuming its one switch, switching power to both load and controller then the following is correct:

View attachment 212148

If its two switches, one for load, one for controller then, assuming 1 mains input connection (how do you envisage that, IEC c

View attachment 212149
Thanks again.
Yeah. I'm just a little paranoid since it's my first time playing with AC mains.
Yes, it's two physical switches. One would power the controllers when switched. The other is actually a microswitch that makes sure the cabinet is closed before the ballasts are powered.
I decided to do it that way so even if the mcu or the relay fails, the power gets cut-off as soon as the microswitch is open.
 
Top