Skip to content

7. Electronics design#

Topics this week: components, circuits, and test equipment.


Group Assignment#

Use the test equipment in your lab to observe the operation of a microcontroller circuit board. Explain what oscillioscopes, mulitimeters, and regulated power supplies are and how to use them.

Insert instrument photos#

Oscilloscope: An Oscilloscope is an instrument that can be used to test verying signal voltages with a graphical display. They display the change of an electrical signal over time, with voltage as the Y-axis and time as the X-axis on a scale that can be easily adjusted by the user. The waveform can be used to understand properties of a signal including aplitude, frequency, rise time, time interval, distortion, etc. The oscilloscope can be adjusted so that repetitive signals can be observed as a continuous shape on the screen. A storage oscilloscope can capture a single event and display it continuously, so the user can observe events that would otherwise appear too briefly to see directly. You connect the signal you want to study to the y-circuit and use the x-circuit (time base) to study how the signal varies over time.

Multimeter: An electronic measuring instrument that combines several measurement functions in one unit. A typical multimeter can measure voltage, current, and resistance. I used this video tutorial to learn more. They are absolutely necessary in electronics. It combines three essential features: a voltmeter, ohmeter, and ammeter, and in some cases continuity. They let you understand what is going on in your cirucuits. You can troubleshoot why a switch won't turn on, how much current is flowing through an LED, if you have a short in your circuitry, how much power you have left on your batteries, etc.

Regulated power supply: This is a power supply that has a voltage and current adjustment. Using these settings, you can regulate the power that is sent to a device. It's useful for debugging issues because it provides a very reliable and steady voltage that is more regulated than a battery. You can use it to measure the power of your circuit.


Individual Assignment#

  • Redraw the echo hello-world board.
  • Add (at least) a button and LED (with current-limiting resistor)
  • Check the design rules, make it, and test it
  • Extra credit: simulate its operation

Drawing the Schematics in KiCad#

Henk wanted us to redraw his electronic schematics from last year.

Insert Henk's schematics image#

KiCad is a free software suite for electronic design automation. It facilitates the design of schematics for electronic circuits and their conversion to PCB designs. I had issues running KiCad on my laptop that is currently running OSX 10.14.1 (Mojave), so I installed it on my desktop Mac that is running OSX 10.13 (High Sierra). On Mojave, KiCad would crash on me spontaneously. After inspecting the error logs, it looks OSX imposes a limit on the amount of memory that an application can access, and the OS forces the software to crash if the software runs too many thread processes in parallel. After attempting to work with KiCad for a few hours on Mojave, I gave up. If my suspicions are correct about the reason it is crashing, this is not something a user can resolve- the maintainers of the software must re-architect the way KiCad manages memory on OSX.

Insert screenshot of error log#


Creating a Schematic and adding components#


Insert screenshot showing fablib, adding components and footprints libs#

Insert code snippet list of fablib named components I added and renamed#

First, we need to get the schematic libraries for the electrical components inventory we have at the fab lab so that we can import the libraries into our schematics and design around them.

  • Download the zip file from Gitlab, or download it from here
  • Unzip the file and move the kicad libraries to a designated filepath that you won't change in the future
  • Open Kicad
  • File > New project
  • Select the Schematic editor (first icon)
  • To add the fablab component library (we'll add the footprint library later), select Preferences dropdown (NOT KiCad> Preferences) > Manage Symbol Libraries > Browse Libraries > select the .lib file located inside the unzipped directory, inside the KiCad folder and click OK.
  • In schematic editor, click Place Symbol, (3rd icon down on the right) and click anywhere on the schematic drawing to get the Choose Symbol window to pop up
  • Search for the individual components you need for your schematic, with the prefix fab. Do this for all necessary components.
  • After placing components, organize them into a cohesive schematic. All components do not need to be connected by lines at this stage of the schematic, but all necessary connections do need to be labeled. Right click each symbol to edit the value in order to rename it. You do not need to annotate the components (e.g. R1, R2...), let the computer annotate them for you.
  • You need to officially close all unused pins. The software requires you to close all pins. To close a pin, click X in the sidebar, then select the pins.
  • Use the Electronic rules checker (ladybug symbol at the top) to find issues in the schematic that you may need to resolve.
  • Next, assign the footprints of the components to the schematic. (button to the right of the bug icon)

Insert screenshot showing the wrong footprints editor window#

I had issues with this tool on every version of KiCad I tried to use.  When I clicked the Assign footprints icon, the `Annotate schematic symbols` window appeared instead.  Anne discovered that if she just kept clicking buttons in this window, eventually the Assign Footprints window would appear.  
  • Now we can add the footprint library. With the Assign Footprints window in the foreground, Select Preferences > Manage Footprint Libraries > Browse Libraries > find and add the fab.mod and fab.pretty libraries and click OK.
  • Select each individual schematic component in middle column, then find the corresponding component in the right hand pane and double-click it. When finished, click OK.
  • File > Save
  • Then click Tools > Generate netlist file > Generate Netlist > then Close.
  • Then click the Run PCB New icon to the right of the netlist icon. This will open the pcb editor.
  • In the pcbnew editor, select Tools > Load Netlist > Read current netlist
  • This generates a "rat's nest" that you can work with to select, move, and orient componets. Organize them in a way that, ideally, the GNDs are on the perimeter and that lines don't overlap as much as possible. Note: - If you need to edit the schematic after this point, you can return to the schematic editor, make changes, save schematic, generate netlist, then select Tools > "Update pcb from schematics" and return to the PCB editor.
  • Set the design rules. For my verion of KiCad, this exists under the Setup menu at the top > Design rules. For Henk, it exists under File > Board setup.
  • Set the design rules before laying tracks, otherwise you might need to redo all your tracks (KiCad does have a feature that can update existing tracks to new design rules, but it does not apply to tracks that cannot expand if placed between components that are too close together, so it's best to do this first)

Insert screenshot showing design rules for our mill#

  • Once the rat's nest is organized to your liking and the design rules have been set, select the Route tracks icon in the sidebar to begin laying tracks. Don't worry too much about making it perfect- everything will look clearer once a few tracks are laid and it is easy to move and rotate components as well as remove tracks as needed.
  • Tip: Rather than deleting tracks that you don't want, simply redraw the new one in its place and the old one will disappear (only if it's right next to it between the same two points)

Insert screenshot showing track routing#

  • Once traces are laid, we need to draw the board outline. In the top bar, select the layer list dropdown, and select the Edge.Cuts layer.
  • Click Add graphics tracks icon on the right
  • Draw the outline for your board. Be generous and leave some space. The outline for my board was milled uncomfortably close to my tracks although the design for it looked like there was a lot of space for it.
  • To generate the image, go to File > Export > SVG
  • Select only F.Cu under copper layers and Edge.Cuts under Technical layers. Default pen size is 0.1mm, Print mode is Black and white, SVG page size is Board area only, select 'Print board edges' and deselect 'print mirrored'. One file per layer, define the output directory, and click plot. If it was successful, it will show the output filepaths in the log below. Click close.

Note that you must check all layers for items that should not be in the schematic if the board outline does not save properly. Add screenshot showing the issue I had and how I resolved it.#

Convert SVG to PNG using an image editor#


Mill the board#

  • Using mods, make sure it looks right, then proceed to milling
  • Neil: 'We invert the image because in mods, white is high, dark is low, and it offsets from white towards dark. if I try to mil this, its going to cut on the inside but I want it to mill on the outside, so I need it to be inverted.

Solder the board#

Install the software#

Test it#

Add screenshots of milling, soldering, software installation, testing, and error messages#


-->