Skip to content

6. Electronics design

Group Assignment

  • use the test equipment in your lab to observe the operation of an embedded microcontroller

Overview

We analyzed the QPAD-based Fabdino game we assembled in Week 4 using a digital oscilloscope. We observed the I2C signals (SCL and SDA) and discovered that the pull-up resistance and I2C frequency were not well matched. By adjusting the software settings, we obtained cleaner waveforms.

The QPAD hardware reference: QPAD-XIAO repository

QPAD board Photo 1: The QPAD board we used for measurement

1. Setup — Connecting the Oscilloscope Probes

We connected the oscilloscope probes to the SCL and SDA pins of the QPAD board. Clipping the probes onto the small pins was quite tricky.

Probe connection Photo 2: Connecting the oscilloscope probes to the QPAD pins

Full setup Photo 4: Full measurement setup — oscilloscope with probes connected to the QPAD

2. Observing SCL and SDA Simultaneously

The oscilloscope can display two channels at the same time — yellow and cyan. We observed the waveforms of the QPAD’s SCL and SDA signals.

Video: SCL (yellow) and SDA (cyan) observed simultaneously on the oscilloscope

  • SCL is simply a clock signal. It is pulled up by default (stays HIGH), and rapidly toggles ON and OFF when the clock is running. The period was approximately 5 ms.
  • SDA is also pulled up, and changes state while SCL is active. However, unlike SCL, the SDA waveform is not uniform — this is expected since SDA carries actual data.

3. Using the Trigger

We set the trigger to Rising edge to freeze the waveform and make it easier to observe.

SCL and SDA waveforms Photo 5: Oscilloscope screen with trigger set — observing the frozen waveform

The SCL signal looked somewhat different from what we had expected. Even though SCL is a regular clock, it did not look as uniform as we thought — the transitions were somewhat scattered.

4. Triangular Waveform — Pull-up Resistor Too Large?

When the waveform looked triangular (rounded edges instead of sharp square waves), we suspected that the 10 kΩ pull-up resistor was too large. A large pull-up resistance causes the signal to rise slowly, rounding the edges of what should be a sharp square wave.

Triangular waveform Photo 6: Triangular/rounded waveform indicating the pull-up resistor may be too large

To improve the waveform without changing hardware, we reduced the I2C frequency to 1/4 of the original:

i2c = I2C(1, scl=Pin(7), sda=Pin(6), freq=100000)

After this change, the waveform improved, becoming a little bit closer to a proper square wave shape (not perfectly there yet, though).

Improved waveform Photo 7: Cleaner square wave after reducing the I2C frequency

5. What We Learned from the Oscilloscope

Using the oscilloscope, we could verify:

  • Whether the pull-up resistance is well matched to the I2C bus — if the edges are too rounded (triangular), the resistance is too high for that frequency.
  • Whether the program’s I2C frequency is compatible with the hardware specifications — a mismatch results in distorted waveforms.

We also set the probe attenuation to 10× for more accurate measurements.

6. Pull-up Resistors Inside the OLED Module

We discovered that the OLED module already has internal pull-up resistors. This means there is no need to add external pull-up resistors to the I2C lines.

However, when external pull-up resistors are also present, the internal and external resistors are connected in parallel, which lowers the effective resistance:

  • External pull-up: 4.7 kΩ
  • Internal pull-up (OLED): assumed similar value
  • Parallel combination: effectively ~3.3 kΩ

This means the total pull-up resistance is slightly lower than intended, which is actually better for higher I2C frequencies — but it is worth being aware of.

AI Usage

We used Claude (Claude Code) to help organize and write this documentation. Specifically, we asked it to explain concepts such as what a rising edge trigger is on an oscilloscope.

Reference

OLED Carry Board Schematic