Week 9

Input devices - Group Assignment

This week focused on probe input devices (analog and digital) and demonstrate the use of a multimeter and an oscilloscope.

Fab Lab Peru icon

The objective was probe input devices and demonstrate it.

Group work only

Week summary

In this group assignment, we used laboratory measurement tools to probe input devices using a designed microcontroller board. We checked laboratory sensor and using the microcontrolled board, we reviewed the signal using a multimeter and an oscilloscope. We used Adrian Torres microcontrolled board, a Seeed Studio XIAO RP 2040, a ultrasonic distance sensor HC -SRO4 and a LM 393 light dependent resistor (LDR).

Group assignment requirement: use test equipment in the lab to probe input devices using a designed microcontrolled board and document the work on the group page.

Quick data

  • Topic: Input devices
  • Student: Carmen Elena Gutierrez Apolinario, David Avila Pimentel, Esteban M. Valladares, Jianfranco Bazan J., Mario Chong, Rocio Maravi, Grace Schwan, Cindy Marilyn Crispin, Jennifer Wong.
  • Equipment: Oscilloscope and a portable multimeter
  • Board: Custom PCB with Seeed Studio XIAO RP 2040
  • Input devices: A ultrasonic distance sensor HC -SRO4, a LM 393 light dependent resistor (LDR)

Assignment and deliverable

  • Use the test equipment in your lab to probe input devices with the designed microcontroller circuit board
  • Demonstrate the use of a multimeter and an oscilloscope
  • Document the work on the group work page

Goal

The goal of this group assignment was review input devices with the desgined microcontroller circuit board using laboratory measurement tools. We focused on the input signal (analog or digital)

Equipment used

Equipment table

Tool Model How we used it
Mini Portable Digital Oscilloscope DSO152 FNIRSI Visualize waveforms over time, verify voltage levels, and check frequency stability.
Digital multimeter PR-75 Check power rails (VCC/GND), confirm 3.3V logic level, and rule out shorts.
Microcontroller board Custom PCB with Seeed Studio XIAO RP 2040 Input a signal to measure with the oscilloscope or voltimeter
Power USB Power and program the board

Procedure 1. Digital input

1. Review Ultrasonic distance module HC-SRO4 descriptions

Distance detection.This module uses Trigger and Echo pin to send a signal and listen for it to be 'bounced back':

  • Range - Between 2cm and 500cm in front of itself with an angle of 15 degrees either side
  • Accuracy - Readings can be broken down into 0.3cm increments
  • Mounting - 4 holes on the circuit board
  • Distance calculation - distance = (traveltime/2) x speed of sound for a measurement in centimeters

This step is important to ensure the board is safe and to avoid measuring a circuit with an accidental short

2. Hardware and software setup

We connected the module HC-SRO4 as follows:

  • 5V Supply
  • Trigger pulse input
  • Echo Pulse Output
  • OV Ground

We programmed using Arduino IDE - Xiao RP 2040

3. Signal observation

After programming the Xiao RP 2040, we observed:

  • The distance

This confirmed:

  • The correct uses of the HC-SR04 module
  • Review the input signal

Ultrasonic sensor measurement

Code used - Arduino IDE - XIAO RP 2040

// Fab Academy - Week 9 (Group)
// Input devices 
// Board: Seeed Studio XIAO RP 2040

#define TRIG_PIN D1
#define ECHO_PIN D0

void setup() {
  Serial.begin(115200);
  pinMode(TRIG_PIN, OUTPUT);
  pinMode(ECHO_PIN, INPUT);
}

void loop() {
  long duration;
  float distance;

  digitalWrite(TRIG_PIN, LOW);
  delayMicroseconds(5);

  digitalWrite(TRIG_PIN, HIGH);
  delayMicroseconds(10);
  digitalWrite(TRIG_PIN, LOW);

  duration = pulseIn(ECHO_PIN, HIGH, 30000);

  if (duration == 0) {
    Serial.println(0);  // importante para gráfica
  } else {
    distance = (duration * 0.0343) / 2;
    Serial.println(distance);  // SOLO número
  }

  delay(100);
}

Ultrasonic sensor measurement setup

Results

We watched the distance in centimeters, confirming that HC-SR04 module send the signal. Additionally, changed the distance and observed the different between short and long distance. We confirmed the code using Ardiuno IDE

What we learned:

  • How to connect a module to a designed microcontrolled board
  • How to read the board technical specification and connect to the board
  • More about the Xiao RP 2040 and the HC-SR04 uses
  • How to review input signal using Arduino IDE

Evidence gallery

Procedure 2. Analog Input

1. Review LM 393 photosensitive light dependent resistor (LDR) sensor module descriptions

Distance detection.This module uses Trigger and Echo pin to send a signal and listen for it to be 'bounced back':

  • Driving ability - 15mA with adjustable potentiometer
  • Brightness - Adjustable
  • Detect - brightness and light intensity
  • Analog and digital output

This step is important to ensure the board is safe and to avoid measuring a circuit with an accidental short

2. Hardware and software setup

We connected the LM 393 photosensitive LDR as follows:

  • 5V Supply
  • DO: digital signal
  • A0: analogical signal
  • GND Ground

We programmed using Arduino IDE - Xiao RP 2040 and open serial monitor

3. Signal observation

After programming the Xiao RP 2040, we observed:

  • The light: little/ no light

This confirmed:

  • The correct uses of the LM 393 LDR module
  • Review the input signal

LM 393 LDR module

Code used - Arduino IDE - XIAO RP 2040

// Fab Academy - Week 9 (Group)
// Input devices 
// Board: Seeed Studio XIAO RP 2040

#define SENSOR_PIN D0

void setup() {
  Serial.begin(115200);
}

void loop() {
  int valor = analogRead(SENSOR_PIN);
  Serial.println(valor);  // SOLO número
  delay(100);
};

Results

We watched the distance in centimeters, confirming that LM 393 LDR module send the signal. Additionally, changed the light intensity and observed the different between low and high intensity We confirmed the code using Ardiuno IDE

What we learned:

  • How to connect a module to a designed microcontrolled board
  • How to read the board technical specification and connect to the board
  • More about the Xiao RP 2040 and the LM 393 LDR module uses
  • How to review input signal using Arduino IDE
  • We learned how to use the portable oscilloscope

Evidence gallery

Difficulties we faced:

We didn't know about both devices: the HC-SR04 and the LM 393 LDR module. We reviewed their specifications

After fixing connection and confirming the correct data; we finally observed the distances and light intensities.

Tips and recommendations

Multimeter

  • Check VCC and GND to confirm the board is powered correctly.
  • Use continuity mode to rule out shorts between VCC and GND.
  • Make sure the board GND is accessible and clearly identified.

Oscilloscope setup

  • Always connect GND first.
  • Start with safe scales: around 1 V/div and 1 ms/div.
  • Use Edge Trigger on CH1 so the waveform stays stable.
  • Check probe setting (x1 / x10).
  • Use AUTOSET as a starting point, then fine-tune manually.

Review devices specifications

  • VCC
  • GND
  • Output
  • Characteristics
  • Technical Sheet

Key lesson: Multimeter first for power and no shorts, then oscilloscope with proper GND, scales, and trigger to quickly get a clean square wave.

Conclusions

This group assignment helped us understand how to safely verify a board before measuring signals, how to correctly connect the oscilloscope, and how to interpret a real digital signal in hardware. We also learned that proper grounding, correct GPIO selection, and good trigger and scale settings are essential to obtain a stable waveform and validate the operation of the microcontroller board.

s