First PCB: Simple DIY Ambilight

Hello,

I’m working on my first, very simple PCB with kicad. It’s supposed to replace the breadboard based prototype of a DIY ambilight. The prototype consists of:

  • Arduino Nano
  • WS2801 LED strips
  • Resistors between Nano and LEDs for data and clock lines
  • Decoupling capacitor after the 2.5mm Barrel Jack
  • 5V 4A PSU (DC)

Power is supplied to both ends of the LEDs. Controller and LEDs are connected through two female 4-pin JST cables.

The major (intentional) difference from the prototype is the fuse. The LEDs need 2.4A in the worst case, connectors and wires to/between the strips are rated for 3A. So I thought about using a 2.5A or 3A slow-blow fuse like this. The current track width for power and ground should be large enough for 4A (assuming 30° temperature rise) to leave some room for more LEDs.

I am a complete beginner, both in terms of circuits and kicad. I expect that parts of my PCB are … well, suboptimal or wrong :slight_smile: But I’m happy to learn from my mistakes. I started with Fritzing and switched to kicad shortly afterwards, which I really like so far.

Any hints regarding obvious mistakes or possible improvements would be highly appreciated. Things I’m still thinking about:

  • The placement of the capacitor.
  • The mounting holes. Should I rather use those with a pad to prevent the screw heads from touching the power plane?
  • From what I have read, choosing the right fuse seems like a science in itself.

Thanks in advance,
Jean

Some basic practice.
Define some trace and via sizes for a given project.
Adhere to a base component placement grid, 1.27 mm is a good start.
Stick to it unless your components get real small.
Reduce that grid in multiples if needed.
No need to draw wires between pins if they are part of copper zones.
Play with copper zone settings to get a feel for it.
That capacitor is meant to be there for the consuming components.
Mounting holes e.g. for M3 appear to placed best about 5mm from the edge/s
Connect traces at 90° to pads if possible.
Give enough space between traces and pads if copper is meant to flow around them.
etc. ad infinitum

@je21 BTW, if you are wondering where that odd-ball 1.27mm comes from, many through-hole parts (ICs, pin headers, radial capacitors, etc) are actually designed on a 0.1" grid. 1.27mm is simply half 0.1". Just looks funny out of the unit system that it comes from.

As a stubborn American, I apologize to the world.

1 Like

No worries.

I am well aware of that inch system. Many components are still manufactured to that base grid. However, as of recently I went back strickly to metricas as much as possible except for those inchy things.

Just checked my settings. I Set the two custom grids to 25 mil (Alt+1) and 5 mil (Alt+2) for quick access. Very handy for laying out tracks and components.

As it turns out I actually was meant to write 0.635 mm (25 mil) as a starting base grid.

All good :sunglasses:

We were all beginners at one point. Welcome to the community. :slight_smile:

The workflow of KiCad works best if you start with a schematic. You can skip the schematic, but it isn’t advised and the tricks you need to do are really advanced tricks. If you discover that you need to change connections, add or remove components, etc you should make the changes to the schematic then push the changes to the board.

Regarding your three points:

  • You may, actually, want multiple capacitors. One large one near the DC input jack for filtering the supply (the wire from the power supply to the DC jack may pick up some noise from the house wiring), and one near each connector for the LED strip(s). You shouldn’t need one for the Nano since they already have their own on-board bypass (power filtering) caps.
  • For your mounting holes, I’d probably go with a non plated (NPTH) mounting hole with a large enough clearance to enforce a non-copper area under where you expect the screw-head and/or mount stud to rest against the board. In your schematic you can place as many mounting holes (in the Mechanical symbol library) as you think you will need (find an unused corner of your schematic sheet, mark it something like “Mechanical”, and put your mounting holes there). When you assign footprints you may need to create your own based on the existing mounting hole footprints because I didn’t see any NPTH mounting holes with enforced clearances in the standard libraries. When you get to that, feel free to ask questions if you don’t understand what to do.
  • There is a little bit to fuse choice. I don’t think you need to use a slowblow fuse. They are used where you expect a large inrush current. An arduino and a bunch of WS2801 LEDs shouldn’t have much inrush, so a fast acting fuse should be fine. For what you are doing, a 3A fuse should be fine, if something shorts out the fuse should blow before your 3A rated connectors and wires get too hot. I would highly suggest using a fuse holder to make changing the fuse easy. Also think about where you can get the fuses if you need one. If you go with the automotive blade fuses, any local auto-parts store should have replacement fuses for when you need one on the weekend. But, they can take up a lot of board real estate. (There is a footprint for the Keystone 3568 mini-blade fuse holder in the standard footprint libraries.)

Since you are just starting, and likely to have to start creating your own symbols and footprints, check out this FAQ entry on library management. Don’t worry, making symbols and footprints in KiCad is much easier than in Fritzing. Most of the time you will be copying a symbol or footprint from the standard libraries to your own custom libraries and modifying them. Occasionally you may create a symbol or footprint from scratch.

1 Like

Have you hear of https://eyrie.io/ ? Cool tool to see KiCAD files on the browser :wink:

The library management post might not be what people need at the very start. At the beginning the kicad internal libs should be enough (to keep the learning effort low for the first project.)

And even when something is not available other FAQ topics might be better suited.

And of course the link to the FAQ in general: (Start Here) Frequently Asked Questions

Thanks so much for all the feedback so far!

Things I’ll try to do right away:

  • Use the suggested grid settings and realign components accordingly.
  • Remove power and ground wires. Makes total sense to me, the wires already felt wrong.
  • Try to create NPTH mounting holes.
  • Use 5mm padding from mounting holes to edges.

Some points I would like to address in more detail:

The workflow of KiCad works best if you start with a schematic.

I’m actually using a schematic. The mounting holes should be the only components missing from it. My intuition was that these kinds of things don’t need to be in the schematic. But I guess as a beginner, my intuition is worth only so much :slight_smile:

You may, actually, want multiple capacitors. One large one near the DC input jack for filtering the supply (the wire from the power supply to the DC jack may pick up some noise from the house wiring), and one near each connector for the LED strip(s).

Interesting, I think I’ll have to read more about this to understand the motivation and also what kind of capacitors I would need. Would additional capacitors simply be closer to the connectors and still directly connected to power and ground nets just like the big one?

There is a little bit to fuse choice. I don’t think you need to use a slowblow fuse. They are used where you expect a large inrush current. An arduino and a bunch of WS2801 LEDs shouldn’t have much inrush, so a fast acting fuse should be fine.

Good to know! I’ll go for a fast acting fuse then.

Also think about where you can get the fuses if you need one. If you go with the automotive blade fuses, any local auto-parts store should have replacement fuses for when you need one on the weekend. But, they can take up a lot of board real estate. (There is a footprint for the Keystone 3568 mini-blade fuse holder in the standard footprint libraries.)

I was planning to use glass fuses (5x20mm). I linked to a pack of 10 in my initial post. Unfortunately, this type of fuse is rather big, especially given my small board. I’d prefer the mini-blade fuse holder if it wasn’t for the increased height in combination with the fuse.

That capacitor is meant to be there for the consuming components.

I’m afraid I can’t follow. Can you elaborate?

Connect traces at 90° to pads if possible.

Is there a way to tell kicad? Or do I have to “force” that by explicitly creating intermediate traces?

Including, or not, things like mounting holes is mostly personal preference. The only exception would be a grounded mounting hole to provide connection to chassis ground. That is an electrical connection so should be on the schematic. For me, I like to have all features derived by footprints to show up somewhere on the schematic, even if they are non circuit elements and have to be shoved out of the way into an unused corner. PCBNew does allow you to insert footprints that don’t have any corresponding symbol on the schematic. But you should be careful and remember to “lock” the footprint because there is a setting that you may at some point want to activate when updating from the schematic that removes unused footprints.

I like to think that creating a schematic is similar to writing a novel. There are general syntax, language rules, and story structure that you should follow in most cases. But the details of phrases are up to the writer’s personal style, or the tone of the story. Sometimes some of the general rules can actually be changed as well, as long as it makes sense for the particular story being told (see the “odd” syntax of Man In a High Castle), or character’s dialects for their speech and thoughts. But this bending (and sometimes breaking of rules) should be rarely done and only for specific, well thought out reasons. IMHO, whether you have your mounting holes, logos, etc on the schematic or not is one of those “writer’s personal style” things.

1 Like

Capacitors in digital applications are present mostly to deliver the high peak currents occuring due to the chip internal low/high state changes. There can be significant currents going around. Most power sources are by design unable, and not meant, to deliver those impuls currents. That’s what capacitors are there for in the digital world. Even if you think to make a track just wider won’t nessecarily do it. In fact in most cases wider tracks will not work as good as capacitors in the proper places.

That’s why the are often called decoupling capacitors to ‘decouple’ from the power source, or relieve the source in those peak moments. Even when working with power plane layers they are still needed.

See the difference?

Pcbnew | Preferences | Pcbnew has a couple tick boxes for track and line angle restrictions.

I for one generally stay with 45/90 degrees only. It routes and looks better.
The 90 degree rule does not always work though in most cases it is applicable.

I finally had time to make changes to the PCB (235.8 KB). A summary of what I did:

  • Realign the footprints to 5/25 mils grids, or at least I hope so.
  • Use different connectors for the LEDs (female -> general).
  • Add mounting holes to the schematic. I appreciate the depth of your answer, SembazuruCDE.
  • Use smaller mounting holes (M3 -> M2).
  • Create a clearance for the screw heads. I use the built-in footprint MountingHole_2.2mm_M2 as starting point. In the PCB view, I opened the properties of the pad (whose type is "NPTH, Mechanical") and set "Pad Clearance" to 1.4. As far as I understand, this should give a 5mm diameter for the entire thing: 2.2mm hole + 2.8mm clearance.
  • Move mounting holes so there is 2.5mm distance from the perimeter to the edges of the PCB. I tried 5mm, but it felt too much for the size of the board. Hope that’s still OK.
  • I tried to prevent 45° degrees as far as possible, but KiCad can be hard to persuade.

Is it just me, or does it look weird that the mounting holes are completely surrounded by copper?

I started reading a little bit about decoupling capacitors and the recommended capacitor in front of the LED strips. It is supposed to be as close to the strips as possible to smooth out sudden changes in demand from the LEDs, which is not very close in my case given that strips and PCB are connected through 15cm JST cables. But I guess (hope) it’s better than nothing. I’m still a little lost when it comes to additional capacitors near the connectors. For what it’s worth, there is one capacitor close to each LED on the strips.

Most of this stuff becomes intuitive as you work with it. If you click as you route then you place it. Just take the track to a point outside the pad and do your click and then go on to the pad.

Thanks for the pointers. I hope I have a slightly better understanding of what’s wrong with my usage of the capacitor. As far as my understanding goes, I should rather be using two capacitors and have each one of them as near to the LED connectors as possible. In addition to that, it defeats the purpose of the capacitor to connect power (and ground) of the LED connectors to the power plane through thermals. Instead, I should be using thermals to connect the capacitors to the power planes, and traces from the capacitors to the respective connectors. Otherwise, the supply voltage can “circumvent” the capacitor. Is that about right? If so, is such a setup sensible with a two-layer board (i.e., having thermals and a trace on a component on the same side of the board)?

It’s probably my mistake (or misunderstanding), but sometimes kicad happily discards my waypoints for a better (?) route. :slight_smile:

Hmmm… I haven’t used V5 much yet and it seems to be a little different than I remember. It seems I sometimes have to double click and the track changes focus and is placed and then I can continue. You can always drag after the fact.

A little playing around and it seems that a single click now anchors the last part of the track not moved. Not the way I remember it.

You are on the right track.

Capacitors in this kind of application are there to deliver those peak currents at times neccessary. No Track on a pcb will do so sufficintly.

It also sounds like a good idea to catch up big time on some basic electronical engeniering. It’s just the way it is.

It is not necessarily that the tracks can not have the current on them but that you do not want to have switching currents affect other components on the board. (Via galvanic coupling.)

Adding capacitors near the part that is expected to have fast switching currents helps keep this current local. For this reason one additionally must take care how the caps and main source of power are connected to the LED. (Make sure the main power lines connect to the capacitor and the capacitor to the LED. As opposed to connecting the LED to the main power line and the caps to the LED. With the later a larger part of the switching current might get to the rest of your board.)


Also when using two caps make sure one of them (the one with the larger value) has a higher ESR. Typically one will use a tantal cap here. (Otherwise you will find that there is the problem of an added resonance frequency between the resonance frequencies of the two caps instead of having a smooth transition where low frequencies are handled by one cap and high ones by the other.)

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.