An Intro to KiCad – Part 7: Board Layout | DigiKey

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
(upbeat dance music) - With our parts placed and board outline completed we get to draw traces. By doing this we're telling the board house where we want to leave pieces of copper when they perform the etching process. This will allow us to make electrical connections between components. We'll still be working in PcbNew in this episode just like last time. In KiCad, make sure you have your project open and select Tools, Run PcbNew. On the last episode we imported our parts and carefully moved them around into these positions. The idea now, is to draw traces to make all of these air wires disappear. While you're working on your layout it can be a good idea to periodically run the Design Rules Check or DRC. Go to Tools, DRC, click Start DRC. If you have any issues with your layout such as traces being too close together they will be listed in the Problems Markers tab. Click on the Unconnected tab. Here, you can see all the connections that we need to make with our copper traces. When we're done we should be able to run the DRC tool and see no problems or unconnected pads listed. Click OK. Let's make an easy first connection so you can see how to draw traces. The first thing I like to do is change my grid to something a little smaller and make it easier to work with. Click on the Grid dropdown and change it to 10 mils. You can go smaller than this if you need to but 10 mils snapping is a good starting point. Click Place, Track to select the Trace Drawing tool. Select the front copper layer on the right and make sure the little blue arrow is pointing to it. Remember, we can only draw tracks on the top or bottom copper layers on this board. Find and zoom in on C2. Notice the air wires that go between C2 and pad two of R5. This is an easy trace to draw. Click on pad one on C2 and you'll see your trace snapped to the middle of the pad. Come out from the pad a little ways and click to place a bend. You'll see a series of three yellow lines coming out of the end of the trace that's on your cursor. These tell you all the pads that your current trace needs to be connected to which includes pad two on R5. Move up and hover over pad two on R5. You'll see that the trace will snap to the pad creating another 45 degree bend as it does so. Make sure there's a small amount of vertical trace before it enters pad two. If you're not happy with the trace, press escape to try again. If you are happy, double click over pad two to draw the trace and that's it. You've drawn your first trace. There's no real order you have to follow when drawing traces. However, I like to start with my power lines first. And then look for easy to connect pads that are close together. From there I work my way out from the most complicated parts which are usually integrated circuits. Note that I usually don't draw traces for the ground node, as I'll use a copper pour to make those connections. When dealing with power traces you usually have to make them larger than your signal traces as they need to carry much more current. If you don't they can heat up and potentially melt, creating an open circuit or worse a fire. Theoretically, we see that the trace supplying power from our battery needs to support spikes up to about 20 milliamps. Search for trace width calculator and click on the advanced circuits one. Set the current to .02 amps or 20 milliamps. Make sure the trace thickness is one ounce. As that's the default for most board manufacturers. Notice the internal layers results. These are for copper layers in the middle of your board which we don't have. The external layers show the trace width needed for our top and bottom copper layers. Looks like we'll need something less than a mil thick. So, our ten mil traces should be fine. But I'll show you how to make a larger trace should you need it. In all honesty, it's only when you start approaching a few hundred milliamps that you need to really worry. Back in KiCad, select Design Rules, Design Rules. In the Net Class Editor tab you can do some slick things like assign specific trace widths and clearances to different nets and nodes. However, there is a quicker way to create a different trace width if you're working on a simple board like this. Click on the Global Design Rules tab. Find the Custom Track Widths section. For the track one field enter .03 to create a trace width of 30 mils. Click OK. In the top left, you should see the Track Selection drop down menu. Click it and you should see the 30 mil trace width we just made. Select it. Note that the 10 mil width will still be the default we can draw with. But this allows us to make larger traces for things like power nets. Click on the positive pin on the battery holder. Double click on the top pin of the switch to draw the trace. Click on the middle switch pin. And then connect the trace to the required pin on R7. We can then create branches off this main power trunk. Click on the VCC pin on R1 and draw a trace straight down to the large trace we just made. Double click to connect them. Do the same for R6. The seven five five five timer does not require nearly the same amount of current as the current LEDs. Select a 10 mil trace width from the dropdown menu. And draw a trace from the middle switch pin to pin eight on the seven five five five. Draw another trace connecting pin eight to pin four as shown by the air wire. Now that we've drawn our power traces let's connect everything else. But leave ground alone for now. Start by looking for easy traces, pads that are close together. For example, pin seven of the five five five to R1 and R2. Go to connect pin six to C1 but notice that KiCad won't let you draw a trace over another trace or across a pad. That's because if we tried to fabricate this those nets would be shorted together, not good. So, make sure you come out of the pin a little ways to avoid having your trace touch other pieces of copper. Connect the middle pin of Q1 to R5. Finish making the connections that we first started with. Connect R5 to R3 and R4. Notice that the pins who's net you're currently working with will highlight yellow. This can help you if you have a large number of pins to connect together. For example, if we start drawing a trace from a ground pin you can see all the other ground pins turn bright yellow. Press escape to stop drawing a trace. That's about all the traces we can draw on this side with this collection of components. Most of the other air wires cross over traces we already drew. Which means we need to draw new traces on the bottom side. On the right side, click on the bottom copper layer. Click on pin two of the five five five and connect it to pin six. Remember, plated through holes are connected on the top and bottom layers. So, you can draw traces on either layer for PTH parts. The new trace is green, showing that it's on the bottom layer. Even though it crosses one of our other traces, it's on another layer so they won't actually touch. If things start to look confusing you can click on the check box for the front copper layer to turn it off in our view. This can make things look clear as you draw traces on the bottom layer. Connect pin six to R2. Connect pin three to R3. There's slightly more space above Q1, so I'll route my trace there. At this point you might be wondering why is everything on a 90 degree or 45 degree angle. For parts it's usually easier for machines like pick and place machines to line up parts on the 90 degree. And for traces, many older board houses could only manufacture straight lines on that 90 degree or 45 degree angle. This was reflected in many older layout programs, as well that only let you draw lines on the 45 and 90. Also note that when you get up to higher frequencies such as above one gigahertz many reflections would be introduced if you had hard 90 degree bends. So, you would often see traces with 45 degree bends. But we don't need to worry about any of these things in our board. So, you can draw them at whatever angle you want. The only other thing you should try to avoid is acute angles where copper connects. Some older board manufacturing processes used harsh chemicals to etch away copper. So, places with bends of less than 90 degrees would capture some of those chemicals in what's known as an acid trap. Those chemicals would remain after the board was finished and slowly eat away at the copper over time potentially causing breaks in the circuit. Once again, you generally don't need to worry about that anymore. But you'll still see me and many others avoid acute angles in layout. This board could actually be made without using any vias but I'm gonna show you how to use one anyway. Turn on the front copper layer and select it so we start our trace on this layer. Start a trace from pin three of the transistor. Come out a ways and click to start going up between R6 and R7. Do you see the faint red circle around my cursor? That shows you how much space is needed around the via when we place it. Position it so that the circle is in between R6, R7 and the green trace. Make sure it's not touching any other traces or pads. Right click and select Place Through Via. Notice that you're now drawing on the bottom layer. Your trace is green. Keep going up. Click to place a bend. And connect the trace to pad one on D2. Draw another trace to connect this and pad one on D1. We want to keep the traces going to the LEDs on the bottom side. If we put them on the top, you'll be able to see them through the silkscreen. It won't make for a pretty drawing area. Connect R6 and R7 to their respective LEDs. And do this on the bottom layer. Notice that even though the air wires show that they need to cross over your other trace you can simply swing your new traces around the LEDS without needing to jump to another layer. We're done with the basic layout. We have some air wires left but we're about to fix that by creating a copper pour. A copper pour is simply an area in the PCB that's filled with copper. If you ever have to mill a board to make a prototype then leaving much of it filled with copper can make the milling process much easier. Also, we usually connect the pour to something like ground or a DC voltage. This can have the effect of reducing radio emissions from traces that are surrounded by this pour especially in circuits with higher frequencies. Finally, it can make layout easier as we don't have to worry about making all those connections manually in something like our ground net. Select place, zone. Click just outside of our board one grid dot down and to the left of the bottom left corner. You'll be asked to pick a layer and a net. Select the front copper layer and select ground. Notice that it pulls the clearance and minimum width from our default class design rules. 10 mils and 10 mils should be plenty here. Click OK. Create a rectangle just to the outside of our board outline, clicking to place each of the corners. Double click to end the zone. Right click on the zones edge and select fill or refill all zones. You should see your entire board be filled with copper. Turn off the bottom copper layer to see it better. You can see that there is a 10 mil gap between the board edge and where the pour starts. Also, the pour keeps a 10 mil distance from all the other traces. But it does automatically connect to each of the ground pads. Let's do the same thing for the bottom layer. Turn on the bottom layer and turn off the top layer. Select the Zone Tool button on the right. Click to start a zone and make sure bottom copper and ground are selected. Click OK. Draw another rectangle around your board outline. Fill in the zones again which can be accomplished by pressing the B key. Turn the front copper layer back on and you'll see that your board is now a yellowish color as your looking at both layers. We're done with the layout. You could fabricate this board and it would work just fine. Just to be sure, go to Tools, DRC. Click Start DRC. You should see nothing listed in the Problems Markers tab as well as nothing in the Unconnected tab. This means we have everything connected with appropriately spaced and sized traces. Click OK. To help us assemble the board we'll want to move all the values to easier to read locations. Values are shown by the yellow text and they won't show up on the final board. Hover your mouse over BS7 and press M. If asked, select the Value text. If you look closely, you'll see a gray or blue line showing you which part this piece of text belongs to. Move BS7 to near the other yellow BAT1 text. It can be helpful to turn off the bottom layer to make the values easier to read. Keep moving these pieces of text to inside the components or next to them. The light blue RefDes text for each component is on the silkscreen which means it will show up on the final board. Let's move these so we can read them and know which part they're referring to. Press M over the light blue BAT1 and press R to rotate it. And move it just to the left of the positive pin. Move S1 and the RefDes text for the top row of resistors to just above their respective parts. Once again, you can look for a faint blue line to see which part the RefDes text refers to. You'll want to avoid having any of this silkscreen text overlapping pins or vias. Remember, there likely won't be any solder mask over through holes. Which means you can't draw silkscreen there. Move R5 down a notch. And move Q1 to above the transistor. Keep U1 above the seven five five five. And move C1 And C2 to just below the parts. We can leave D1 and D2 alone since we're about to cover them up with a big chunk of silkscreen. The idea is that we want a large silkscreen square to take up most of the front of the badge. This will provide a canvas for you to draw on with a Sharpie. Click on the Zone Tool button and select the front silkscreen layer. Click near your LEDs and make sure F silk S is selected. Click OK. Draw something like a square around your LEDs. Zoom in on the bottom left corner. Right click it and select zones, move corner. Move it to 5.06, 3.9. Move the top left corner to 5.06, 1.9. Move the top right corner to 7.06, 1.9. And move the bottom right corner to 7.06, 3.9. You should now have a large swath of silkscreen surrounding your LEDs. If you'd like you can add a piece of silkscreen text to help you remember part orientation or other notes. Click the Text button and select the front silkscreen layer. Click to the right of the battery's positive terminal and enter a plus symbol for the text. Click OK. And drop the symbol near the positive terminal. Click again and write ON in capital letters. Press OK. Place the ON text to the left of pin three on S1. This will tell us which position the switch needs to be in to give power to the circuit. Turn off the top copper and top silkscreen layers. Turn on the bottom copper and bottom silkscreen layers. Click again and enter five five five badge as the text. This is a good way to show the name of your board on silkscreen. Change the width and height to .1 and change the thickness to .02. For the Layer, select the bottom silkscreen layer. When we are looking at our board layout in a Cad program like this we're pretending we can see straight through the layers starting with the top layers. This means that if you were to flip over the board all the bottom layers would appear to be reversed. This means we actually need to mirror our text if it's going on the bottom layer so that it will appear the right way when we look at it. Under Display, select Mirrored. And click OK. Place it centered somewhere between the LEDs and the badge clip slot. I'll put mine at about 6.06, 2.35 the last thing I like to do is put a version number on the board. And this version number should match the one on the schematic. You can do this in silk but I like to do it on the copper layer to make it a little less obvious. Select the Text tool in the bottom copper layer. Click to bring up the text window and write V zero one. Click OK and place it in the bottom right corner making sure the text doesn't extend past the ground pour edges. Also, ensure that the text is mirrored just like our board name. Press B to redraw the pour and you should see your text appear. Don't forget to change this if you update your schematic or board. Zoom out and turn your layers back on. Take a look at your final board. I think we're ready to make it. Don't forget to save your work. And we're done with layup. Feel free to high five yourself. Or throw a tiny party. We still need to generate Gerber files to send to OSH Park. As well as create a bill of materials. But we are almost done. See you next time. And don't forget to subscribe to keep up with these videos. (upbeat dance music)
Info
Channel: Digi-Key
Views: 85,600
Rating: undefined out of 5
Keywords: Digikey, KiCad, PCB, pcbnew
Id: jaQPr7PgImk
Channel Id: undefined
Length: 18min 15sec (1095 seconds)
Published: Fri May 18 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.