Group Assignment Individual Assignment Use an EDA Design a Development Board Different Design Workflow Simulate your Design Design a case
Week 6

Electronics Design

This week, I explored PCB design and fabrication, focusing on schematic creation, component selection, routing, and debugging. I used KiCad for schematic and PCB design, experimenting with different routing strategies and design rules.

Learning Objectives

  • Select and use software for circuit board design
  • Demonstrate workflows used in circuit board design

  • Assignments

    Group Assignments

  • use the test equipment in your lab to observe the operation of a microcontroller circuit board

  • Individual Assignments

  • use an EDA tool to design a development board that uses parts from the inventory to interact and communicate with an embedded microcontroller
  • extra credit: try another design workflow
  • extra credit: simulate your design
  • extra credit: design a case around your design

  • Group Assignment

    In this group assignment, we used various test equipment to analyze the operation of a microcontroller circuit board. We began by verifying the power supply using a multimeter to ensure the board received a stable voltage. An oscilloscope was then used to check clock signals, confirming the correct operation of the system's timing components. Additionally, GPIO pins were observed to monitor their state changes, helping us understand the behavior of digital outputs.

    Group Assignment

    My primary focus was on using the logic analyzer to examine communication protocols. I connected the analyzer to the microcontroller's I2C and UART lines, capturing real-time signals as data was transmitted between the microcontroller and peripherals. Using protocol decoding, I was able to interpret the transmitted data, checking for errors and validating the correct operation of communication interfaces. This step was crucial in debugging and ensuring that the microcontroller properly interacted with external devices.

    Through this hands-on experience, I gained valuable insights into debugging embedded systems. The logic analyzer provided a deeper understanding of how data is structured and transmitted, reinforcing the importance of signal integrity and timing analysis in microcontroller-based circuits. This assignment helped us develop practical troubleshooting skills and a systematic approach to diagnosing electronic circuits.

    Electronic Components

    Electronic components are the elements of the circuit which help in its functioning the electrical circuit. Electronic components are the basic building blocks of an electronic circuit any electronic system or any electronic device. They can control the flow of electrons in an electronic system or electronic circuit.

    Types of Electronic Components

    An electrical circuit is an interconnection of Electronic Components. Based on their capability to generate energy these elements are classified into active or passive electronic Components.

    Electronic Components

    Electronic Components are classified into two groups:

    • Passive Components:

      Passive components are electronic devices that don't need an external power source to operate actively. They mainly resist, store, or control the flow of electric current or voltage in a circuit without actively amplifying or generating signals. For eg. Resistors, Capacitors, Transformers, Diodes, Thermistors, etc.

    • Active components

      Active components are electronic devices that need an external power source to work. They actively control and manipulate the flow of electric current in a circuit. These components can amplify, switch, or generate electrical signals. For eg. Diode, Transistor, Integrated circuit, etc.

    Connectors

    Electronic connectors are devices that join electronic circuits. They are used in assembling, installing, and supplying power to electrical devices. Connectors are an important component of electronics used in industrial machinery, consumer products, communications, and home appliances.

    Gender of Connectors

    For electronic connectors, gender is used to differentiate the mating connectors that match together in size, shape, and number of pins. The plug or male connector has pins for connecting to the female connector, which has a receptacle, jack, or socket for the male pins. The female connector has socket holes that contain terminals to wires, cables, or devices. The pins of the male plug are inserted into the female jack or socket to make electrical connections.

    We explored different types of electronic connectors. The types of electronic connectors are:

    • Header Connectors
      Header Pins

      Cables made to connect to these pin headers are usually one of two types: individual wires with crimp connectors on them or ribbon cables with insulation displacement connectors.

      Image 1 Image 2
    • JST Connectors
      Gender of Connectors

      Japanese Solderless Terminal, also referred to as JST, is manufactured by a Japanese company of the same name. The JST system is primarily designed to bridge electrical connections or carry an electrical signal.

    • Dupont
      Barrel Connectors
    • Molex Connectors
      Screw Terminal
    • Barrel Connectors
      Barrel Connectors
    • Terminal Connectors
      Screw Terminal
    • USB Connectors
      Types of USB Connectors

    Circuits

    Pull Up Resistor

    Pull-up resistors are resistors which are used to ensure that a wire is pulled to a high logical level in the absence of an input signal.

    Digital logic circuits have three logic states: high, low and floating (or high impedance). The high-impedance state occurs when the pin is not pulled to a high or low logic level, but is left “floating" instead.

    Pull Up Resistor Circuit

    Without the pull-up resistor, the MCU’s input would be floating when the switch is open and pulled down to a logical low only when the switch is closed.

    Pull Down Circuit

    Pull-down resistors are resistors which are used to ensure that a wire is pulled to a low logical level in the absence of an input signal.

    Pull Up Resistor Circuit

    When the pushbutton is not pressed (open) the state of the pin will be logic LOW and when the pushbutton is pressed (closed) the state will be logical HIGH.

    The pull-down resistor must have a larger resistance than the impedance of the logic circuit, or else it might be able to pull the voltage down by too much and the input voltage at the pin would remain at a constant logical low value - regardless of the switch position.

    Voltage Divider Circuit

    A voltage divider involves applying a voltage source across a series of two resistors. The primary purpose of this circuit is to scale down the input voltage to a lower value based on the ratio of the two resistors.

    Voltage Regulator 7805

    The poterntiometer is the most common application of a voltage divider circuit. A potentiometer usually has three external pins: two are the ends of the resistor and one is connected to the wiper arm.

    Potentiometer

    A Level Shifter is another application of a voltage divider circuit,when a voltage needs to be leveled down. The most common scenario is when interfacing signals between a sensor and a microcontroller with two different voltage levels.

    Level Shifting

    Voltage Regulator

    Voltage Regulator 7805
    A voltage regulator is an essential electronic component that maintains a stable output voltage regardless of variations in the input voltage or load conditions. It ensures that sensitive components receive a consistent and reliable power supply, preventing fluctuations that could interfere with circuit operation. One commonly used linear voltage regulator is the LM7805, which outputs a steady 5V DC when supplied with a higher input voltage (typically 7V-12V).

    Voltage Regulator Circuit

    To integrate a voltage regulator into a circuit properly, capacitors are added to filter out noise and stabilize the voltage. The first capacitor, a 0.33µF ceramic capacitor, is placed between the voltage source (e.g., a 9V battery) and the input pin of the regulator. This capacitor helps filter out unwanted noise or AC ripple from the power supply, ensuring that a clean DC voltage enters the regulator. By acting as a bypass capacitor, it diverts any high-frequency noise to ground, improving the efficiency of the regulator.

    The second capacitor, a 0.1µF ceramic capacitor, is connected to the output pin of the regulator. This capacitor smooths out any remaining fluctuations or high-frequency noise in the regulated 5V output. While this may not be critical for simple applications like powering an LED, it becomes essential when supplying power to logic circuits or microcontrollers that require precise and stable voltages to function correctly. By following this setup, you ensure that the regulator operates efficiently and provides a clean, reliable power supply for your circuit.

    EDA

    Electronic Design Automation, or EDA, is a market segment consisting of software, hardware, and services with the collective goal of assisting in the definition, planning, design, implementation, verification, and subsequent manufacturing of semiconductor devices, or chips. Regarding the manufacturing of these devices, the primary providers of this service are semiconductor foundries, or fabs. These highly complex and costly facilities are either owned and operated by large, vertically integrated semiconductor companies or operated as independent, “pure-play” manufacturing service providers.

    Electronic Design Automation is primarily a software business. Very sophisticated and complex software programs function primarily in one of three ways to assist with the design and manufacture of chips:
    • Simulation tools take a description of a proposed circuit and predict its behavior before is it implemented.
    • Design tools take a description of a proposed circuit function and assemble the collection of circuit elements that implement that function. This is both a logical process (assemble and connect the circuit elements) and a physical process (create the interconnected geometric shapes that will implement the circuit during manufacturing). These tools are delivered as a combination of fully automated and interactively guided capabilities.
    • Verification tools examine either the logical or physical representation of the chip to determine if the resultant design is connected correctly and will deliver the required performance.

    Some examples of EDA softwares are KiCad, Autodesk Eagle, Cadence, Altium,etc.

    KiCad

    KiCad Interface

    KiCad is an open source software suite for Electronic Design Automation (EDA). The programs handle Schematic Capture, and PCB Layout with Gerber and IPC-2581 output. The suite runs on Windows, Linux and macOS and is licensed under GNU GPL v3.

    KiCad Download Page

    I tried to explore KiCad for this week as my EDA tool because it is Open Source, packed with features and lots of shortcuts

    KiCad Workflow
    KiCad Workflow
    Schematic Editor

    KiCad's Schematic Editor supports everything from the most basic schematic to a complex hierarchical design with hundreds of sheets. Create your own custom symbols or use some of the thousands found in the official KiCad library.

    PCB Editor

    KiCad's PCB Editor is approachable enough to make your first PCB design easy, and powerful enough for complex modern designs.

    3D Viewer

    KiCad's 3D Viewer allows easy inspection of your PCB to check mechanical fit and to preview your finished product.

    Essential Concepts for PCB Design

    Designing a Printed Circuit Board (PCB) involves translating a circuit schematic into a physical layout while ensuring manufacturability, signal integrity, and reliability. Below are key elements to understand before starting a PCB design.

    Schematic Design

    • Schematic Symbol: A graphical representation of a component used in circuit diagrams (e.g., a resistor is a zigzag line, a capacitor is two parallel lines).
      3D Viewer
    • Footprint: The actual physical layout of a component on the PCB, showing pad locations for soldering.
    • Component Libraries: EDA tools provide predefined symbols and footprints (KiCad, Eagle, Altium, etc.), or they can be custom-made.

    Traces & Routing

    Traces are copper pathways on a PCB that electrically connect components. Proper routing ensures circuit reliability.

    Tracks
    • Trace Width: Determines how much current a trace can carry. Wider traces are used for high-current paths.
    • Trace Clearance: The minimum gap between two traces to prevent short circuits.
    • Routing: Manual or autorouting strategies to optimize signal paths.

    Design Rules and Checks

    Ensuring a PCB follows proper electrical and manufacturing guidelines is crucial.

    • DRC (Design Rule Check): Checks for trace width, clearance, via sizes, and other manufacturing constraints.
    • ERC (Electrical Rule Check): Detects issues like unconnected nets, incorrect pin connections, and missing power connections.

    Individual Assignments

    Design a Development Board Using a EDA tool

    For this week's assignment, we worked with Electronic Design Automation (EDA) tools to create a custom circuit. The goal was to design a development board using available components while ensuring proper routing and design rule compliance

    Designing a basic circuit in KiCad

    We started with a basic circuit in KiCad with components like a Attiny 412, a pair of LEDs, push button and voltage regulator to understand the workflow of the KiCad EDA.

    Schematic Design of Circuit
    PCB Design of Circuit

    Before we start designing, we need to clone the fab library of devices for KiCad into our Personal Computer system. You can find the library on the below link

    Fab KiCad Library
    KiCad Fab Repository

    Follow these instructions provided in the readme file of the repository

    • Clone or download this repository. You may rename the directory to fab.
    • Store it in a safe place such as ~/kicad/libraries or C:/kicad/libraries.
    • Run KiCad or open a KiCad .pro file.
    • Go to "Preferences / Manage Symbol Libraries" and add fab.kicad_sym as symbol library.
    • Go to "Preferences / Manage Footprint Libraries" and add fab.pretty as footprint library.
    • Go to "Preferences / Configure Paths" and add new environment variable "FAB" that points to location of the fab library on your drive, e.g. ~/kicad/libraries/fab. This is needed for the 3D models to load correctly.
    Cloning repository

    After cloning the repository, as said in the instructions there are three important steps: Configuring PATH, Adding Symbol Library and Adding Footprint Library

    Modifying preferences

    Add the symbol and footprint library as mentioned in the instructions above. You'll be able to access the fab component symbols and footprints only after adding the libraries properly.

    Adding path to Environment Variables

    Make sure to add the path to the environment variable, as skipping this step would result in failing to fetch the 3d Models of the devices. We didn't initially do this step, therfore we had to manually add the path to each component to fetch the individual 3D models

    Adding 3D Models to footprints manually

    The CAD files can be manually added for footprints in the PCB Editor window by selecting the properties of the footprint.

    Select Footprint Properties
    Footprint Properties

    The footprint properties window has a 3D Models tab wherein you can add path to CAD File and adjust the CAD Properties such as it's location,orientation and offset.

    Adding path of CAD File

    Now we are all set to begin designing our circuit, we followed the above steps to include the devices library from the fablab inventory directly into our KiCad Workflow. Now I'll show you the different steps we need to take to build this circuit.

    Designing Workflow

    Adding Components

    Image 1 Image 2
    Adding Attiny 412 from the library
    Attiny 412 added to the editor
    Adding path to Environment Variables

    Connecting components with wires

    Adding path to Environment Variables
    Image 1 Image 2
    Adding path to Environment Variables

    Adding Global Labels

    Global Label
    Global Label Properties
    Global Labels
    Global Labels

    Running the ERC

    Running the ERC

    I found a error on the ERC, Input Power not driven by any Output Power pins. This is a common error found. The error shows up when the Power and Ground Lines are not detected by the ERC as Power lines. To resolve this issue, we have to add a PWR Flag to anyone of the many PWR lines. For eg. If I have added a PWR_5V at different places, it's only necessary to add one power flag at at ony one of the PWR_5V lines.

    Adding PWR Flag

    Converting Schematic to PCB Design

    Switch to PCB Editor
    PCB Editor Home
    Update PCB from Schematic
    Update PCB from Schematic Window
    PCB Layers
    Adding bounding
    Arranged for tracing

    Setting Design Rules

    Design Rules are required to constraint the traces and different parameters according to the capabilities of the PCB router and required features. It helps to standardize the parameters of the PCB like minimum track width, track clearance, etc.

    Design Rules

    The design constraints can be set from the Board Setup option found on the toolbar in the PCB Design Window. The Constraints can be set under the Design Rules section of the Board Setup. You can also import the Settings from Another Board

    The above given constraints were provided by our instructors according to the PCB Milling Router available in our Lab.

    Adding Traces

    After arranging the components for easier tracing we have to connect them using the Trace option. You can either select the Route Single Tracks option or the X key as shortcut

    Adding trace
    There are some handy shortcuts for tracing:
    • X - Select Single Wire Trace
    • D - Adjust the Traces after they are Done
    • M - Move components (Traces don't follow the movement)
    • G - Move components (Traces adjust according to movememnt of components)

      The G Shortcut has some limitations, if the traces overlap another component the movement cann

    All components are traced

    Running DRC

    The DRC button can be found on the tool bar in the PCB Editor Window. The DRC and ERC buttons look similar. The ERC is only available in the SChematic Editor , while DRC is available in PCB Editor

    Adding path to Environment Variables

    The DRC showed some errors and warnings. The warnings given under the Unconnected items are for the Push button switch. The pushbutton terminals are internally connected, therefore it is not required to connect them in the board. This is a common error for push buttons.

    The other common errors that i faced was unconnected pins, which I overlooked while connecting traces.

    Adding path to Environment Variables

    Converting in 3D Viewer

    KiCad allows you to view your PCB in 3D, you can add 3D CAD files of each component individually as mentioned above or add a library of CAD Files which can be accessed by KiCad.

    Adding path to Environment Variables

    The 3D Viewer window has options for rendering, and change orientation and viewing angles for better viewing and visualization.

    Adding path to Environment Variables

    Adding more circuits and finalizing the PCB

    Adding Rectangles

    The crcuits required in the board are: Attiny 412, Voltage Regulator Circuit, Switch PULL UP Circuit, POWER LED Circuit, Debug LED Circuit, FTDI Converter(Programming Interfacing)

    The pins that are not used must be connected as No Connect Flags

    Adding No Connect Flags

    The final schematic of the demo board is below.

    Final Schematic

    The final PCB of the demo board is below

    Final Schematic

    Designing Development Board using XIAO ESP32 C6

    For the development board, I chose XIAO ESP32C6 as the brain of the circuit. The XIAO ESP32C6 has builtin WIFI, Bluetooth and Zigbee. it has Dual RISC-V Processors: Incorporates two 32-bit RISC-V processors, with the high-performance processor capable of running up to 160 MHz and the low-power processor up to 20 MHz.

    XIAO ESP32C6 Pinout
    XIAO ESP32C6 Datasheet

    The XIAO ESP32C6 symbols and footprints must be added to the KiCad Project. The Fab inventory library doesn't have the specific symbol, footprint and CAD for XIAO ESP32C6. Therefore, the OPL KiCad Library can be used for this.

    GitHub Repo of Seeed Studio OPL KiCad
    Seeed KiCad OPL Library
    Cloning OPL Library
    Adding Symbol Path in Library
    Adding Symbol Folder
    Adding Footprint Folder
    Footprint not automatically Detected
    Assign Footprint Button
    Assigning footprint
    Applying and Saving footprint

    The footprint and symbol is added successfully to the project. The XIAO ESP32CS symbol and footprint is added successfully

    Designing the Circuit in Schematic Editor

    The final schematic is made by adding the required circuits and putting the interfacing options for I2C, SPI and UART Communication.

    I wanted to add a 01x06 Pin Header, but there was no symbol or footprint .So I had to make a new symbol and a new footprint. The symbol and footprint is saved as new and the footprint is assigned to the new symbol.

    Editing a symbol

    Image 1 Image 2

    Image 1 Image 2

    Image 1 Image 2

    01x06 Pin Header Symbol

    The symbol is successfully added to the schematic, now it can be used in the circuit.

    Creating a Footprint

    The created symbol needs a footprint, so we can edit a footprint similarly as we did for the symbol.

    Footprint editor symbol
    Footprint Editor Window
    Added 6 Solder Pad
    Save As : Footprint
    Assign Footprint

    Final Board Schematic Design

    Final Schematic

    Final Board PCB Design

    Final PCB

    3D Viewer

    3D Viewer
    Hero Shot

    Learnings

    I familarised with the Electronic Components, Circuits and EDA which will be useful for my further assignments and projects. The design of the two PCB boards helped me to familarise with the KiCad Software and the symbols, footprints and 3D Cad files.

    I would love to explore more about better placement of components,

    Design Files

    You can download my design files from below

    • Demo Board using Attiny 412

    • Development Board using XIAO ESP32C6

      • Schematic
      • PCB
      • KiCad Project
    • Trace File

    x