Friday 23 August 2019

KiCad Tutorial 1.4: Assign Capacitor Footprints in KiCad



KiCad Tutorial 1.4: Part A: Assign Capacitor Footprint and KiCad Capacitor

Footprint Format




You can watch this video on YouTube by clicking: here


Open Assign Footprints Window In KiCad



1.   In the KiCad project window open Eeschema by double-clicking on the 

      Schematic Layout Editor icon.

2.   Click on Tools and click on Assign Footprints … (icon with an op-amp and little IC 
      
      towards the right bottom).   

3.    CvPcb has now been invoked.

4.    A window opens with Assign Footprints heading.  

5.    The left window has heading Footprint Libraries.

6.    The middle window has heading Symbol: Footprint Assignments and the symbols
      
       are numbered and listed.

7.    The listed symbols end with a colon.  

8.    The right window has a heading Filtered Footprints.   

9.    The assign footprints window looks like as shown in figure 1.4A below:

Fig, 1.4A: Assign Footprints



10. The footprints have .pretty extensions.

11.  First, we should discuss the KiCad capacitor footprint format. 
       
12. Click OK.


KiCad Capacitor Format for a Footprint


1.   The footprint format for a through-hole technology (THT) capacitor in KiCad 

      can be found here at the KiCad Library Convention and is as follows:

2.    [C/CP]_[Style]_L[Case size]_D[Diameter]_W[Width]_P[Pitch]_[Modifiers]_[Options] 

3.    The letters in brackets mean the following:

         3.1.    [C/CP] - Capacitor polarisation.

         3.2.    [Style] – Capacitor case style.

         3.3.   [Case size] – Body length (Optional).

          3.4.   [Diameter] – Case diameter (Optional).

          3.5.   [Width] – Body width (Optional).

          3.6.    [Pitch] – Lead spacing.

          3.7.   [Modifiers] – Footprint modifiers if non-standard.

          3.8.    [Options] – Footprint options (Optional).


4.      As far as [Style] is concerned there are different capacitor styles available:

         4.1.    Axial: Cylindrical body with axial lead attachment.

         4.2.    Radial: Cylindrical body, both leads enter at the same end.

          4.3.    Disc: Disc-shaped body (sometimes enclosed), leads enter tangent to the inner
                    disc.

          4.4.    Rect: Box-shaped body (Bottom face in contact with the board)]

5.      Body size:

         5.1.    For Axial body styles: L[length]_D[diameter]

         5.2.    For Radial body style: D[diameter]{_H[height]}

          5.3.    For Disc body style: D[diameter]_W[width]{_H[overall height]}

          5.4.    For box-shaped body styles: [X]x[Y]{x[Z]}


KiCad Capacitor Example


1.      So, the following example of a KiCad footprint:

2.      Capacitor_THT: C_Disc_D8.0mm_W5.0mm_P10.00mm means the following:

          2.1.    It is the footprint of a through-hole unpolarized capacitor.

          2.2.    It has a disc-shaped body with the leads entering tangent to the inner disc.

           2.3.    The diameter of the disc is 8.0 mm.

           2.4.    The width of the disc is 5.00 mm.

           2.5.    The lead spacing is 10.0 mm.
  

Highest Voltage Measured During Simulation


1.   The highest voltage detected and measured during the simulation was the capacitor C4 
      
       of 0.1uF between the Boost and SW pins of LTC1624 in the LTspice XVII circuit. 

2.   The plot is shown in red in the figure 1.4B below: 




Fig. 1.4B: Highest Measured Voltage


3.   As can be seen, the voltage remains below 18 volts.


Choose Capacitor Footprint and Assign Capacitor Footprint




You can view this video on YouTube by clicking here.

Choose Footprint For Capacitor: 1 C1 -  100pF


The Vishay Data Sheet 


1.    The first symbol we are going to assign a footprint to is no. 1 C1 – 100pF which is a 
        
       capacitor through-hole technology non-polarized.

2.    Let’s say we want to use disc shaped capacitors. 

3.    According to the KiCad footprint format what the footprint should be so far is thus
       
       Capacitor_THT:C_Disc.  

4.     According to the VISHAY datasheet the VY2 Series, which can be downloaded here,

        the voltage tolerated by these series ceramic disc capacitors are as follows:

        4.1.    Class X1, 440 Vac

         4.2.    Class Y2, 300 Vac.

5.      This falls well within our max of 18 volts.

6.      The dimensions of the ceramic disc capacitors are indicated in figure 1.4C below as:




Fig. 1.4C: Dimensions of Ceramic Disc Capacitors


7.       It can be seen that the Body DIAMETER indicated on the drawing is given as 
          
          Dmax (mm) and the LEAD SPACING F (mm) is given as 5.0 mm, 7.5 mm,

          10 mm or 12.5 mm.

8.       The technical data in the sheet is given in figure 1.4D below as follows: 


Fig. 1.4D: Technical Data From Datasheet




9.   Under Y5S (2C3) in row 100 meaning 100pF we can see that:

       9.1.   Body Diameter Dmax. (mm) is given as 7.5 mm.

       9.2.    Body Thickness Tmax. (mm) is given as 5.0 mm.

       9.3.   The following  Lead Spacing F (mm) values are given as possibilities :

                9.3.1.    5.0 mm.

                9.3.2.    7.5 mm.

                9.3.3.   10.0 mm.

                9.3.4.   12.5 mm.


10.     What this means though is that according to the KiCad footprint naming convention
      
        the following disc capacitor footprints are possible depending on the lead spacing:

        10.1.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P5.00mm

        10.2.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P7.50mm

        10.3.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P10.00mm

        10.4.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P12.50mm

  
11.    It means any of the above footprints can be used.

12.    The only difference between the footprints is the lead spacing which can be 

         either 5.00mm, 7.50mm, 10.00mm or 12.50mm. 
   

Assign Footprint 

Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P10.00mm to 

1 C1 -  100pF



1.    In the Assign Footprints window on the left in the Footprint Libraries column click 

       on Capacitor_THT.

2.     On the top next to Footprint Filters: click on: 

         2.1.   Filter footprint list by schematic symbol keywords it is the icon with 
              
                  the horizontal IC with green legs and with a little page with horizontal lines in the 

                  lower right corner. 

          2.2.    Filter footprint list by pin count it is the icon with the horizontal IC with green
        
                    legs and with a little white square with hash or # in the lower right corner.

           2.3.   Filter footprint list by library, it is the icon with the horizontal IC with green

                    legs and with a little page or square with a capital l or L in the lower right corner.

3.        In the right column and under the heading Filtered footprints there should appear a

           listing of only Capacitor_THT:C.

4.       Now scroll until you come to: 

          Capacitor_THT:C_Disc_D7.5mm_W5.0mm_P



5.     You will notice the following are in fact available:

         5.1.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P5.00mm

         5.2.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P7.50mm

         5.3.    Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P10.00mm

6.     Choose and double click on Capacitor_THT: 

        C_Disc_D7.5mm_W5.0mm_P10.00mm


7.      Click on Apply, Save Schematic & Continue. 


8.       The Assign Footprints window in the middle column under Symbol: Footprint 

           Assignments should look like shown in figure 1.4E below:



Fig. 1.4E: Assign Footprints Window





Examine Footprint 

Capacitor_THT: C_Disc_D7.5mm_W5.0mm_P10.00mm


1.     Click on View selected footprint.

2.      It is the icon with the vertical IC with red legs and a magnifying glass in the lower right 

          corner.

3.      The footprint of the capacitor is shown in figure 1.4F below:



Fig. 1.4F: Footprint of Capacitor



4.      You can use the Measure distance between two points the icon that is a Vernier 

          clamp to check the distance on the footprint. 

5.       Click on 3D Display (Alt + 3) it is the icon with a grey component with two legs 
     
           mounted on a green PCB board.


6.        You should see the capacitor as shown in figure 1.4H below:



Fig. 1.4H: Capacitor



7.       Click Close.





Thursday 8 August 2019

Tutorial 1.3: Annotate and Edit Component Symbols Electrical Rules Checker


Part A: Annotate and Edit Component Symbols





You can watch this video on YouTube by clicking: here

Annotate Symbols


1.   Open the schematic of your circuit or Eeschema

2.   At the moment the symbols have labels like R?,  C?, U? and RV?. 

3.  The "?" indicates a number has not been allocated. 

4.   You can add these by hand if you want to give them specific numbers. 

5.  This, however, can be done automatically with KiCad.

6.   In Eeschema click Tools and then click Annotate Schematic … .

7.   The icon is a page with a pencil from the bottom left towards the upper right of the
      

       page.

8.   The Annotate Schematic window appears.

9.    Click Annotate


10.   Messages appear in the Annotation Messages: window

11. Click Close.



12.   You will notice that all the symbols are now numbered. 




Edit the Si4128DY Symbol




1.    Right-click Si4128DY.

2.    Click Properties and click Edit with Library Editor.

3.    The Symbol Editor window opens.

4.     Right-click on pin 1 and click on Edit … . 

5.     The Pin Properties window opens. 

6.     Set: 

        6.1.   Pin name: Source.

        6.2.   Electrical type: Output.

        6.3.   Click OK.


Pin 2 and 3


1.      Right Click on pin 2 and click on Edit … .

2.      The Pin Properties window opens.

3.      Set:

        3.1.       Pin name: Source.

        3.2.       Electrical type: Output.

        3.3.       Click OK

4.    Do the same for pin 3.

Pin 4


1.       Right Click on pin 4 and click on Edit … .

2.       The Pin Properties window opens.

3.        Set:

           3.1.      Pin name: Gate.

           3.2.      Electrical type: Input.

           3.3.      Click OK


Pins 5, 6, 7 and 8


1.        Right Click on pin 5 and click on Edit … .

2.        The Pin Properties window opens.

3.        Set:

          3.1.    Pin name: Drain.

          3.2.    Electrical type: Input.

          3.3.    Click OK

4.       Do the same for pins 6, 7 and 8.

5.       The symbol should eventually look as in figure 1.3A below:



Fig. 1.3A: Edited MOSFET Transistor with 3 Source Output Pins.


Part B: Electrical Rules Checker





You can watch this video on YouTube by clicking: here


1.   Click on Perform electrical rules check.

2.   It is the icon with a bug.

3.   The Electrical Rules Checker window opens as shown in figure 1.3B below.



Fig. 1.3B: Electrical Rules Checker


4.    Click Run.
5.   We have 5 warnings as shown in figure 1.3C below:




Fig. 1.3C: Results Electrical Rules Checker 2 Errors 2 Warnings


7.      From the first two in the errors list given by KiCad above, KiCad is 

         unhappy that pins 1, 2 and 3 which are all outputs of U2 or MOSFET 

         transistor si4128 are connected together.  

8.      The reason for this is when we click on the Options tab and we see the following

         in figure 1.3D below:


Fig, 1,3D: Error and Warning Tables Under Options Tab
  

9.       From the second row from the top, we see that if an output pin is 

          connected to an output pin an error message is generated.

10.      We have a bit of a unique situation here.

11.     The reason mainly why there are multiple pins used is to conduct

          the heat generated in the MOSFET transistor.
         .
12.      You can read more here.

13.      Personally, I think it is also to lower the electrical resistance.

14.       I could, however, find nothing to support my thinking.

15.      Further, I do not like to have outputs not connected to something.

16.      We have to fool KiCad to accept the connection of the source output pins

           connected together.

17.      As can be seen in the above figure in the case of a passive pin, no matter if it is 

           connected to input, output - , bidirectional - , tri-state-, or passive pin, it would 

          not generate an error.

18.     So if we change pins 2 and 3 to passive pins they would not generate any errors.



Edit Si412DY Symbol Again


1.     Right-click Si4128DY.

2.     Click Properties and click Edit with Library Editor.

3.     The Symbol Editor window opens.

4.      Right Click on pin 2 and click on Edit … .

5.     The Pin Properties window opens.

6.      Set:

         6.1.    Pin name: Leave as Source.

         6.2.    Electrical type: Chane to Passive.

         6.3. Click OK.

7.      Do the same for pin 3.

8.      The symbol for si4128dy should now look like as shown in figure 1.3E below:



Fig. 1.3E: Edited Si4128dy MOSFET with 2 Passive Source Pins.



9.      Now run the Electrical Rules Checker again.

10.    You should see the following as shown in figure 1.3F below:




Fig. 1.3F: All the Errors are Gone

11.     All the errors are gone.

12.     For now, we can ignore the warnings.

13.     Click Close.



         Previous: Tutorial 1.2 Import Symbol Continue With Drawing of Circuit


         Next:  Tutorial 1.4: Assign Footprints


Sunday 4 August 2019

Tutorial 1.2 Import Symbol Continue With Drawing of Circuit





You can watch this video on YouTube by clicking on YouTube Video On Import Terminal 

and Place Symbol

Terminal Block 2P Side Entry 5.08MM PCB


1.               For a terminal block, we want to use Terminal Block 2P Side Entry 5.08MM PCB
2.               On the Digi-Key website, you will find the particulars of the above terminal block by clicking on Digi-Key website and datasheet of terminal block.
3.               It looks like as shown in figure 1.2A below:


Fig. 1.2A: Terminal Block 2P Side Entry 5.08mm PCM


4.               The product overview of the terminal block is as shown in figure 1.2B:


Product Overview of the Terminal Block
Fig. 1.2B: Product Overview of the Terminal Block

5.               In the Digi-Key symbol library for KiCad you will find the symbol of this terminal with the Digi-Key part number ED2609-ND.

Download and Install the Digi-Key KiCad Library


1.               If you have not done so yet download and install the Digi-Key KiCad Library.
2.               To download you can find the library on Digi-Key KiCad Library.
3.               Download and store the Digi-Key KiCad Library on your computer.
4.               In Eeschema click on Preferences and click on Manage Symbol Libraries.
5.               The Symbol Libraries window opens and looks like as shown in figure 1.2C below:


Symbol Libraries Window
Fig. 1.2C: Symbol Libraries Window




6.               Click on the file icon at the bottom between the + and the upward pointing arrow.
7.               Navigate to where you stored the Digi-Key KiCad Library on your computer.
8.               In the files, you downloaded there are two places where you can find the symbols.
9.               In my case the first place was at:  C:/Users/Deon/Documents/KiCad/LIBRARY/digikey-kicad-library-master/digikey-symbols.
10.            The symbol files all have a .lib extension.
11.             Select all the files if you want to and click Open
12.             In my case the second place was at:  C:/Users/Deon/Documents/KiCad/LIBRARY/digikey-kicad-library-master/src/Source_Symbols.
13.            The symbol files all have a .lib extension.
14.            It looks like as shown in figure 1.2D below and this is where you will find the ed2609-nd.lib symbol file.



ed2609-nd.lib symbol file on your computer
Fig. 1.2D: The ed2609-nd.lib Symbol File on Your Computer



15.             Select at least the ed2609-nd.lib file and click Open.
16.        You can also select all the .lib files if you want to.

Place Terminal Block Digi-Key ED2609-ND Symbol


1.            Click on the Place symbol icon which is the icon with the op-amp on the right vertical
           bar of icons of the main window.   
2.               Be careful, there is another op-amp icon on the top horizontal icon bar.
3.               Do not use this one. It is for Create, delete and edit symbols.
4.               Click on the drawing sheet in the main window.
5.               Another window opens with heading Choose Symbol
6.               Type in  "ED2609" 
7.               You should see the ED2609-ND symbol as shown in figure 1.2E:

terminal block symbol with ed2609-nd digi-key part number
Fig. 1.2E: ED2609-ND Symbol

8.               Click OK.
9.               Place the ED2609-ND symbol to the left and next to the 100pF capacitor.
10.           This is where we will connect the input 12V to.
11.            Right-click on ED2609-ND and select Duplicate  C.
12.           Place the duplicate to the right of the 200uF polarized capacitor.
13.           Right-click the duplicate again select Orientation and select Mirror on Vertical (Y) Axis.
14.          This will be our 3.3V output terminal.



You can watch this video on YouTube by clicking on YouTube video download symbol 
and continue with drawing of circuit.

Transistor Si4412DY 

1. The Si4412DY transistor is not in the symbol library.
2. Go to SnapEDA.
3. Symbol library is not available. 
4. SI4412DY-T1-E3 Mosfet recommended alternative 781-SI4128DY-T1-GE3.
5. Go to Ultra Librarian
6. Also does not have Si4412DY-T.
7. Mouser Electronics recommends Si4128DY-T1-GE3. 


Download Symbol and Footprint of Si4128dy 

1. Go to Ultra Librarian and download Si4128dy Footprint at Ultra Librarian.
2. In Eeschema click on Preferences and click on Manage Symbol Libraries 
3. The Symbol Libraries window opens as shown in figure 1.2F below.

symbol libraries window
Fig. 1.2F: Symbol Libraries Window

4.               Click on the Folder icon next to the + icon.
5.               Navigate to where you stored your Si4128dy.lib file the symbol of the terminal block.
6.               Click Open. 
7.               In the last column under Description type in 
             “ N-Channel 30-V (D-S) MOSFET”
8.          Click Okay.  

Place Symbol Si4128dy
1.               Click on the Place symbol icon which is the op-amp icon on the right vertical bar of icons of the main window.  
2.               Click on the drawing sheet in the main window.  
3.               Another window opens with the heading Choose Symbol.  
4.               Under 2019-07-09_13-28-35 N-Channel 30-V (D-S) MOSFET choose SI4128DY-T1-GE3
5.               Click OK


Place Inductor 10uH 

1.          Click on the Place symbol icon which is the op-amp icon on the right vertical bar of icons of the main window.  
2.          Click on the drawing sheet in the main window. 
3.          Under Device choose L Inductor. 
4.          Click Okay  
5.          Click on the main sheet in Eeschema to place next to 35.7k resistor.  
6.          Right-click on the inductor choose Orientation and click on Rotate Counterclockwise to make the inductor horizontal.  
7.          Right-click on the inductor choose Properties click on Edit Value 
8.          Edit Value Field window opens.  
9.          In Text: type “10u” for 10 mico Henry for the inductor as shown in figure 1.2G below: 


edit value field window text field for inductor
Fig. 1.2G: Edit Value Field for Inductor


Place Zener MBRS340
1.         Click on the Place symbol icon which is the op-amp icon on the right
             vertical bar of icons of the main window.  
2.         Click on the drawing sheet in the main window. 
3.          In the search field type in "MBR340"
4.          Select MBR340.
5.          Click Okay.
6.          Click on the main sheet in Eeschema to place it under the source pins of   
              Si4128Dy  close to the 10uH inductor.   
7.           Right-click MBR340 select Orientation and rotate to a vertical position.
8.           Click Save





You can watch this video on YouTube by clicking on YouTube Video place gnd, wire circuit and ltspice simulation


Place GND Power Flag

1.       Click on the Place symbol icon which is the op-amp icon on the right 
          the vertical bar of icons of the main window.
2.       Click on the drawing sheet in the main window.
3.       Another window opens with the heading Choose Symbol.
4.       In filter space type in “GND”.
5.       Under power Choose GND Power symbol creates a global label with 
          name “GND”, ground Keywords: power-flag. 
6.       Click OK.
7.        Click on the drawing surface to place the GND symbol below the ED2609-ND
           connector.
8.         Right-click GND and click Duplicate and place below:
            8.1.       6.8 k resistor;
            8.2.      100pF capacitor;
            8.3.       LTC 1624 GND pin 4;
            8.4.       MBR340;
            8.5.       20k resistor;
            8.6.       200uF capacitor; and 
            8.7.        the second ED2609-ND connector.

Wire Circuit
1.         Click on the Place wire icon which is the forward-slash green icon on the
            right vertical bar of icons of the main window.  
2.          Click on the drawing sheet in the main window.
3.          If you left-click on a pin of a symbol the will starts a wire.
4.          If you left-click at the end of the wire on the destination pin of a symbol the
             wire will end. 
5.          By left-clicking, you can add a turning point to the wire. 
6.           Double-clicking ends a wire, even if it is not on a pin. 
7.           A node spot will appear where crossing wires are connected. 
8.          If there is not a node spot showing it means the two wires that are crossing
             are not connected. 
9.          Wires are a visual way of connecting two nodes. 
10.       This enables the schematic tool to create the netlist of what symbol or node
            is connected to what other symbol or node. 
11.        Connect symbols as in the circuit drawing. 
12.        You can also right-click on a symbol and use the Drag function to relocate
             a symbol that has been wired without disconnecting the wiring of the
             symbol.
13.        Click Save
14.         Finally, your circuit should look something like this in Eeschema as shown
              in figure 1.2H below: 
15.         However, keep in mind the symbols in figure 1.2I have already been
              numbered. 
16.         We will do this in the following tutorial.

final circuit in eeschema
Fig. 1.2H: Final Circuit in Eeschema



LT Spice Circuit

1.        Let's do an LTspice simulation of our circuit.
2.        I added a resistor R5 of 4 ohms just to give the circuit a load as shown in 
           figure 1.2I below.


ltspice circuit with 4 ohm load
Fig. 1.2I: LTspice Circuit With 4 Ohm Load

3.       See the simulation plots in figure 1.2J below:


input and output voltages and current simulation plots
Fig. 1.2J: Input Voltage and Output Voltage and Current Simulation Plots


4.      The blue trace is the input which settles at 12 volts.
5.      The green trace is the output settling at 3.3 volts after about 250 
         microseconds.
6.      The red trace is the current in the load resistor of 4 ohms settling at 834
         milliamps.


Previous: KiCad 5.1.2 Tutorial 1.1 Start To Draw Circuit
Next: Tutorial 1.3 Annotate Symbols Electrical Rules Checker