5.Electronics Design

This week for : Group assignment:

  • We had to use the test equipment in our lab and observe the operation of a microcontroller circuit board
  • Individual assignment: To use an EDA tool to design a development board that uses parts from the inventory to interact.


  • GROUP ASSIGNMENT
    You can view our group assignment here!

    INDIVIDUAL ASSIGNMENT

    Printed circuit Board

    TPCBs are thin boards that contains electrical circuits that connect multiple components to form a complete system used to power our devices. The components are connected to the board by soldering them to the board. The board is made up of materials with poor conductivity the board can be of one , two or multi layers.

    A PCB needs to be designed first before it cn be printed. This can be done on by PCB design CAD tools.

    Components of a PCB

    Switches:can either allow current or block depending if they are closed or open. There are several different types of switches available such as slider, push button, lever, toggle, key switches etc.

    Resistors:Resistors are one of the most commonly used components in PCBs. They are used to resist the flow of current by dispersing the current flowing into it as heat.

    Capacitors: Another common component seen in PCBs. They temporarily hold electric charge and then dispersed whenever more power is required in th ecircuit. It functions by collecting opposite charges on two conductive layers with a insulating material in between.

    Inductors: They store energy in the form of magnetic field which is formed when current flows through an coil of wire. They are used to block or filter out certain signals.

    Diode: This device only allows current to flow from the anode to cathode i.e. only in one direction. This helps to stop current to flow not the wrong path which may cause damage. LEDs are semiconductor light sources that emit light when current flows through it in the correct direction.

    Transistors: the are used to amplify the charge or as electronic switches. They can either be n-channel transistor or p-channel transistors. The NPN transistors .

    Designing a PCB

    We have to design and map out a PCB before it is built. To do so we have to seek out CAD tools such as Eagle,EasyEDA,kiCAD,OrCAD etc. The software is used for designing the PCB is kiCAD.KiCad is an open-source Electronic Design Automation (EDA) software that helps users to create schematic diagrams of electronic circuits and convert them into PCB layouts and 3d models.

    There PCB design can be separated into 2 categories; schematic diagram of the the PCB and PCB layout to help design how the components will be mapped out physically on the board.



    To access Fab Academy's library of symbols and footprints for KiCad, A .zip file is to be downloaded from https://gitlab.fabcloud.org/pub/libraries/electronics/kicad Now we go to our GitLab profile and go to code and then copy the ssh key . We now need to open GitBash in out Local kiCad folder and type in the clone command.

  • To add the downloaded files to the kiCad library : To add symbol library: 1.Open KiCAD. Go to preferences. 2.Click on 'Manage Symbol Libraries'. 3.Click on "Add file" and select the symbols library that we downloaded. Similarly to add footprints library: 1.Open KiCAD. Go to preferences. 2.Click on 'Manage Symbol Libraries'. 3.Click on "Add file" and select the symbols library that we downloaded.
  • This will import Fab Academy's symbols and footprints library into our KiCad project, so that we can access them for the schematic design and PCB layout. We start the bulid by working on the Schematic Diagram first. Since we were using kiCAD for the first time we did a project just to understand the workflow of buildinga a PCB.
    To insert the symbols file into KiCad, follow these steps:
  • First open the required components using the add symbol ( shortcut key 'A' ). Load the parts available.
  • Importing Components to library : If a component is not available we need to download the schematic diagrams , footprints and .step files of that component. For this assignment we had to import a ATTINY412-SSC chip which was not available. I searched it up on snapeda and downloaded the files. 1.Open KiCAD. Go to preferences. 2.Click on 'Manage Symbol Libraries'. 3.Click on "Add file" and select the symbols library that we downloaded.
  • Now create circuits by adding more parts and choosing them from the fab library.
  • Since i am using LEDs i need to check the resisance of the resistor required accoring to the diode used. For this i used a LED Series Resistor Calculator( DigiKey Electronics )
  • Fabstash is our local inventory database Use the draw line command ( shortcut key 'L') to draw wire connecting the parts.
  • I needed to add a voltage regulator circuit. So similarly as above i added a voltage regualtor,2 capacitors and then gave connections to the ground and power supply.
  • we can lable the parts using the text tool from the tool bar.

  • I also added LEDs to make the complete circuit. Once done the schematic diagram looked like this:
  • Once the circuit is done we need to scan the diagrams for any errors in the connection. For this we use the 'Run ERC' command. This function checks and provides information if any errors are encountered.
  • We now proceed to go into the layout mode to start creating circuit routes on the PCB. First thing to do is connect set the design rules which you can get into by clicking DRC inside tools menu. Set different clearances as asked.
  • Open the PCB editor and click on Update PCB to load the circut board.
  • Designing a custom PCB

    For this assignment we could create a custom PCB by ourselves. I wanted to use a 'Space Alien Invader' video game character as the shape of my board, because for some reason they remind me of PCB boards!

  • I began the project by drawing the schematic diagram first. I wanted to have a switch which will turn on 2 red LEDs whichh would be the eyes of the crab. I used the xiao rp2040 microcontroller. i referred to the pin out to understand the pins of the microcontroller. I added the components that i required to create the board.
    The components i used are
  • XIAO RP2040
  • 2 red LEDs
  • 2 resistors for the LEDs
  • Tactile switch
  • 1x05 Vertical header pins(2nos)
  • 1x02 Vertical header pin
  • Next I had to create a sketch of the outline of the character in fusion360, which I then exported as a dxf file to import into the PCB editor document.
  • I set the constraints based on the capabilities of our milling machine before creating the route traces. We can use the routing tool from the toolbar(shortcut key 'X'). This allows us to begin the process of laying out and connecting the traces on the PCB. Manual routing took a long time to figure out but was a fun process nonetheless and i also wanted to connect the circuit without the use of zero resistors which was real challenge.
  • i had to swap the labels of the pins because i accidentally placed them on the wrong ports. i did this by going back to the schematic view and using the swap function. To swap between two elements right click after keeping the elements selected.
  • I ran DRC for errors and only minimal correction was required. The switch had a warning attached to us asking for it to be routed , but since switches are already internally connected this was neglegible
  • The final routes look like this:
  • I opened the 3D editor to view the PCB . I had to import the correct 3D elements to clear the missing parts. Some links were broken so i had manually fix them so that they will import correctly.
  • This was the entire workflow in KiCAD from schematic to layout to the 3D model.
  • Finally i exported the kicad file to a .step file and opened it in fusion360 to view the 3D model
  • Creating a case for the PCB

    I modeled a case for the PCB on fusion360. I also added a keyring hole so that it can be attached to a chain or hook.

    Making a Gerber File

    The file we have currently needs to be converted into a gerber file so that it can be sent for manufacturers of the PCB. Gerber is a standard file format that contains the design data for a PCB. It includes the differnt layers PCB's , including copper traces, solder mask, and silkscreen, position of each component, such as pads, vias, and drill holes etc. To create a gerber file Go to Fabrication outputs> Gerber A plot dialogue box appears. On the output directory field enter "/gerber". This is done so that a gerber folder with all the files will be plotted in one place. Click on Generate Drill files Then click plot. Now go to PCBway and drop the files within the gerber folder we created there. The PCB will be generated using the information.

    Download files

  • PCB design files
  • References

  • resources.pcb.cadence.com