Skip to content

Week 6: Electronics Design

Fab Academy lecture on Electronics Design

Group Assignment

This week’s group assignment objective was to use the test equipment in our lab to observe the operation of an embedded microcontroller.

What is an Oscilloscope?

We first got acquainted with an oscilloscope. To experiemnt with the output of the testing instrument we’ve taken an XIAO-RP2040 microcontroller board, and wired it on a breadboard.

At our node, for our disposal we have the GDS-1000A-U Series oscilloscope. My first interaction with the instrument seemed very complex, but in fact it’s a very simple tool just measuring voltage against time.

Some basic vocabulary:

Voltage: signal strength
Time: signal change duration
Frequency: cycles per second
Period: one full cycle time
Clock: regular timing square wave
Channel: input measurement line
Trigger: stabilizes repeating waveform
Amplitude: signal height from zero

To have a more interesting testing, my groupmate Mariam and I had devided the task into two programming languages and IDEs. By putting the measuring probe onto one of the pins on the MCU, and the grounding clip on to the GND pin, we obtained the toggle frequency of the MCU.

Mariam had analyzed the MCU’s performance with MicroPython and Thonny, whereas I converted the same code into C++, combiling through Arduino IDE.

With substantial results:
MicroPython at 694kHz
C++ at 1,55MHz

alt text

The Code

C++

#include <Wire.h>

#define SCOPE_PIN 26

int state = 1;

void setup() {
  pinMode(SCOPE_PIN, OUTPUT);
}

void loop() {
  state = 1 - state;
  digitalWriteFast(SCOPE_PIN,state); // toggle pin
}

The Library

As we’ve been using XIAO RP2040, which is not included in the default library of KiCad, so I proceeded to download the KiCad FabLib library from git.

alt text

For me, the easiest way to download was following Krisjanis Rijnieks’ steps, from KiCad’s Plugin Repository:

  1. Tools > Plugin and Content Manager
  2. Select the Libraries tab
  3. Look for “KiCad FabLib”
  4. Click “Install”
  5. Click “Apply Pending Changes”

alt text alt text

Individual Assignment

LTSpice

alt text

WARNING: LTSpice on Macs!
The app does not have a toolbar placed up top. To access to the tools: Right-Click > Draft > Component. If you need a ground pin, do not search, press g instead.

I found the basic tutorials on their website to be very useful. Although bare with patiece, I couldn’t find tools to speed up the process.

alt text

To give value to components: right-click on the bottom letter next to the component. In an example with the power source, by default there is V1 – the number of power source, and V – the measuring unit of the given component [in this case Volts].

To simulate on the schematic:
• on Windows press “.op” in the toolbar
• on Mac right-click > Draft > SPICE directive [or press S]

Note: here’s also where you can make comments, disregarded by the simulator.

Transient simulation is analysis of voltage spikes obsereving changes within a short segment of time, whereas transient itself means lasting a short period of time.

alt text

KiCad

KiCad is a number of interconnected apps, e.g. Schematic Editor, PCB Editor, etc. For now I will focus on these two.

  • Software documentation here.
  • Video Tutorials here.

Schematic Editor

Proceeding with Schematic Editor and the individual assignment, I started sketching out a PCB for a drone free-fall detector, and parachture deployment unit documented in week 2.

The components of the board are:

1x XIAO RP2040
1x GY-521 Accelerometer and Gyroscope
1x Buzzer
1x LED
1x Actuator [for the door latch]

alt text

PCB Editor

alt text alt text