Skip to content

7. Electronics design

Group assignment

Use the test equipment in your lab to observe the operation of an embedded microcontroller.

  • Observe signal fluctuation with Oscilloscope

    We used following oscilloscope in FABLAB Kamakura to observe signal fluctuation.
    oscilloscope

Firstly, check the output calibration signal (5V @1KHz)
output calibration signal

Check the wave form if the calibration wave top and bottom shows flat.
In this case, the wave top and bottom shape is not flat, so that we needed to adjust the input pin condition.
check the wave form

There is a screw hole at the pin cable.
screw hole for adjusting wave form

Adjust the wave screw with a electric driver by adjusting the input signal form

Following wave shape are both not good.
not flat01not flat02

Wave length measurement
wave length
Wave length value dt=1.000ms 1/dt=1.00KHz
wave length value

Wave amplitude measurement
wave amplitude
Wave amplitude value dV=5.00V
wave amplitude value

Next, we tested with actual circuit which Neil introduced in the class.
On-Off Switch with XIAO-ESP32C3
test circuit

Arduino Code for XIAO-ESP32C3
Arduino coding

Set trigger with “Slope Falling”.
setting trigger

Trigger worked by switch signal.
switch signal

Another switch push by human shows different time length.
human switch push timing differs


  • Observe electric condition with Multimeter

Firstly, we confirmed the frequency of the Oscillator’s Calibration output signal with Multimeter with AC Mode, and could confirm 1.00kHz.
Ac measurement

Next, measured the AC Table Outlet electricity with Multimeter AC Mode, and got 49.94Hz and 103.7V.
frequency of AC Outlet
Voltage of AC Outlet

Then we used following Power Supply to produce Voltage for Multimeter measurement.
Power Supply

Multimeter indicated 5.034V at 5.0V supplying by Power Supply.
5V measurement

Multimeter indicates 20.50V at 20.6V Supplying by Power Supply.
20V measurement

Green Diode resistance measurement with Diode Mode showing 2.307V, while it’s specification paper shows 2.8-3.6V.
green LED

green LED measurement
spec paper

Diode resistance measurement with Diode Mode showing 0.575V
Diode
Diode measurement
OL(V) is indicated by swapping the pins.
swapping pins

Capacitor measurement
capacitor
102pF is indicated with Capacitor measurement mode.
alt text


  • Logic Analyzer

    This time, we used following Logic Analyzer: Hailege 24MHz 8CH USB type
    Logic Analyzer

Even it could only handle digital signal “0” and “1”, it is very useful with multi channels (more than two) to understand how the input-output devices are communicating.
digital signal observed by logic board
digital signal meaning

We used following circuit to analyze by Logic Analyzer.
circuit to try logic board analysis

We used following Arduino code for this trial.

//
// hello.button-blink.C3.ino
//
// Seeed XIAO ESP32C3 button, blink,  and echo hello-world
//
// Neil Gershenfeld 10/8/23
//
// This work may be reproduced, modified, distributed,
// performed, and displayed for any purpose, but must
// acknowledge this project. Copyright is retained and
// must be preserved. The work is provided as is; no
// warranty is provided, and users accept all liability.
//
// add XIAO_ESP32C3 board
//    https://espressif.github.io/arduino-esp32/package_esp32_index.json
//

#define led_pin 20
#define button_pin 21

void setup() {
   pinMode(led_pin,OUTPUT);
   pinMode(button_pin,INPUT_PULLUP);
   Serial.begin();
   Serial.setTimeout(10);
   }

bool button_up = true;

void loop() {
   if (Serial.available()) {
      digitalWrite(led_pin,HIGH);
      String s = Serial.readString();
      Serial.print("you typed: ");
      Serial.println(s);
      delay(100);
      digitalWrite(led_pin,LOW);
      }
   if ((digitalRead(button_pin) == LOW) && button_up) {
      digitalWrite(led_pin,HIGH);
      Serial.println("button down");
      button_up = false;
      }
   else if ((digitalRead(button_pin) == HIGH) && !button_up) {
      digitalWrite(led_pin,LOW);
      Serial.println("button up");
      button_up = true;
      }
   }

Installed a software into Labo’s PC.

This page could be a good reference for setting up Logic Analyzer.

Connected the Logic Analyzer to PC and the device.
connected to device

Communication between input and output device was observed by logic Analyzer.
communication observed by logic board