Skip to content

Week 9 — Input devices


Introduction

This week focused on understanding how devices communicate with each other and how data is transmitted between systems.

As a first step, I explored analog and digital signals, how input devices generate data, and how a microcontroller interprets that data.


Group Assignment — Input Devices

Overview

During the group assignment, we explored different input devices and analyzed how they generate electrical signals.

The goal was to understand how physical interaction is converted into measurable data.

Group Setup


Input Device — Potentiometer

We used a potentiometer as an analog input device.

The potentiometer works as a variable resistor and produces a continuous voltage depending on its position.

Potentiometer


Signal Measurement Using Oscilloscope

To analyze the signal more deeply, we used an oscilloscope.

This allowed us to observe how the voltage changes in real time when the potentiometer is rotated.

Oscilloscope


Video

The following video shows the real-time signal behavior:


Observations

  • The signal changes smoothly when rotating the potentiometer
  • Voltage increases and decreases continuously
  • Small fluctuations (noise) are present
  • The signal is stable and predictable

Conclusion

This experiment helped us understand how input devices generate analog signals and how those signals can be measured using professional tools.


Individual Assignment — Analog and Digital Signals

Overview

In this assignment, I explored the difference between analog and digital signals using a potentiometer connected to my custom PCB based on the Seeed XIAO RP2040.

Setup


What is an Analog Signal?

An analog signal is continuous and can take any value within a range.

In this experiment:

  • Minimum position → ~0
  • Middle position → ~500
  • Maximum position → ~1023

Potentiometer Potentiometer


What is a Digital Signal?

A digital signal has only two states:

  • HIGH → ON
  • LOW → OFF

The LED in this project works using digital control.

LED


Microcontroller — Seeed XIAO RP2040

This microcontroller supports both analog and digital input/output.

Analog Pins

  • A0 (GPIO 26)
  • A1 (GPIO 27)
  • A2 (GPIO 28)
  • A3 (GPIO 29)

In this project, I used A0.

PCB Connection


Analog to Digital Conversion

The potentiometer produces a voltage that is converted into digital values using an ADC (Analog to Digital Converter).

  • 0V → 0
  • ~1.65V → ~512
  • 3.3V → 1023

ADC Diagram


Code

```cpp int value = analogRead(29); Serial.println(value);