Home/Week 09

Week 09

Materials Used

Input Devices

  • Group Assignment:
    • Poll the analog levels and digital signals of an input device(s) (at a minimum, you must demonstrate the use of a multimeter and oscilloscope)
    • Document your work on the group work page and reflect on your individual page what you learned
  • Individual Assignment:
    • Measure something: Add a sensor to a microcontroller board you've designed and read it.

Link to Group Assignment https://fabacademy.org/2026/labs/lima/Weeks/Week9/Week9.html

Objective

Design, integrate and validate a data acquisition system using a sensor connected to a board based on the XIAO ESP32-C3 microcontroller, allowing the measurement of a physical variable in the environment, converting it into an interpretable digital signal and executing a programmed response, verifying its operation through electronic instrumentation and real tests.

Learning Achieved

Through the group assignment, I learned how to characterize the PCB production process and understand the importance of machine configuration, milling parameters, and design rules. I also learned the workflow for both in-house PCB fabrication and industrial board manufacturing, improving my understanding of electronic production and quality control.

Individual Assignment

📂 Materials Used

  • Push Buttons
  • Soil moisture sensor
  • Touch sensor
  • Ultrasonic sensor
  • Resistances
  • Breadboard
  • Jumper cables
  • Test LEDs
  • USB Type-C cable
  • PCB Board
  • Tin for soldering

💻 Equipment Used Input Devices

  • XIAO ESP32-C3 Microcontroller
  • Computer / Laptop
  • Breadboard
  • Digital Multimeter
  • Power Supply
  • Soldering Station
  • Oscilloscope (optional)

🛠️ Tools Used Input Devices

  • Soldering iron
  • Precision Tweezers
  • Wire Strippers
  • Cable cutter
  • Screwdrivers
  • Electronic grippers
  • Cutting Base

⚙️ Software Used

  • Arduino IDE
  • Tinkercad
  • Sensor and microcontroller datasheet
Materials and Equipment Collage

My Process

1. Input Device Used

For this practice, theHL-69 soil moisture sensor was used, a resistive device that allows measuring the level of soil moisture from the variation of electrical conductivity between its metal electrodes.

🔹Working Principle:
The sensor bases its operation on the conductivity of the soil, which depends directly on the water content present:

  • Moist soil → higher conductivity → lower resistance → high signal
  • Dry soil → lower conductivity → higher resistance → low signal

This variation is converted into an electrical signal that can be interpreted by the microcontroller.

🔹Signal Type:

  • Digital Output (DO): Delivers a HIGH/LOW logic status according to a defined threshold
  • Analog Output (AO): Provides a value proportional to the humidity level

🔹Technical Features:

  • Operating voltage: 3.3V – 5V
  • Simple connection interface
  • Low cost and high availability
  • Compatible with microcontrollers such as the XIAO ESP32-C3

🔹Pins Description:

  • VCC → Power
  • GND → Common Earth
  • DO → Digital Output (Threshold Sensing)
  • AO → Analog Output (Continuous Read)

🔹Role in the system:
The sensor acts as an input device, allowing a physical variable (soil moisture) to be transformed into an electrical signal that can be processed by the microcontroller, thus fulfilling the function of data acquisition within the embedded system.

HL-69 sensor used in practice

2. Board Integration (XIAO ESP32-C3)

At this stage the HL-69 sensor was integrated directly into the board designed withXIAO ESP32-C3, avoiding the use of breadboard and fulfilling the PCB integration requirement.

🔹Interface used (digital output – DO):
The module's digital output was chosen to obtain threshold detection (dry/wet), simplifying the control logic.

🔹Connection Implemented:

  • DO → XIAO Digital Pin (GPIO set as input)
  • XIAO VCC → 3.3V
  • GND → common GND

🔹Electrical Compatibility:
The XIAO ESP32-C3 works at3.3V logic, so:

  • The sensor was powered at 3.3V to avoid incompatible levels
  • The HIGH signal is kept within safe range for the GPIO

🔹Technical considerations applied:

  • Series resistance (220Ω–470Ω) on the signal line to limit transient peaks
  • Common ground reference to avoid floating readings
  • Short wiring to reduce noise
  • Use of digital output for greater stability against interference

🔹Design criteria:
Robustness and reading stability were prioritized over resolution, so digital output was chosen over analog, suitable for binary detection applications (dry/wet).

3. Reading the sign (code)

The system was programmed to read the digital signal coming from the humidity sensor and activate an output (LED) based on the detected status.

c / cpp
const int sensorPin=2;   Digital input from the sensor
const int ledPin = 3;      Output to the LED
int SensorStatus=0;
void setup() {
  pinMode(ledPin, OUTPUT);
  pinMode(sensorPin, INPUT);
void loop() {
  SensorStatus=digitalRead(sensorPin);
  if (SensorStatus==HIGH) {
    digitalWrite(ledPin, HIGH); Wet soil
  } else {
    digitalWrite(ledPin, LOW);  Dry Soil

🔹How the code works:

  • pinMode(sensorPin, INPUT) sets the pin as a digital input to receive the sensor signal
  • digitalRead(sensorPin) reads the logical state (HIGH/LOW) generated by the sensor
  • digitalWrite(ledPin, HIGH/LOW) controls the switching on or off of the LED

🔹Signal interpretation:

  • HIGH (≈ 3.3V) → presence of moisture → LED on
  • LOW (≈ 0V) → dry floor → LED off

🔹System Behavior:

The microcontroller acts as a simple decision system:

  1. Receives a digital signal from the sensor
  2. Assess their logical state
  3. Execute an immediate action (turn the LED on or off)

🔹Technical criteria applied:

Digital reading was used instead of analogue to:

  • Simplify programming logic
  • Reduce data processing
  • Get a fast and stable response

This approach is suitable for applications where onlybinary (dry/wet) detection is required.

Code loaded into the programming environment

Signal validation

During the group assignment, the validation of the sensor signal was carried out using electronic instrumentation, with the aim of verifying its compatibility and behavior before being processed by the microcontroller.

🔹Instruments used:

  • Multimeter → voltage level measurement
  • Oscilloscope → Signal Form Analysis in Time

Multimeter measurement:
The digital output (DO) of the sensor was measured, obtaining:

  • LOW → close to 0V
  • HIGH → approximately 3.9V

This confirms that the sensor delivers defined logic levels.

Oscilloscope analysis:

The signal was observed in real time, identifying:

  • Square waveform
  • Fast transitions between LOW and HIGH
  • No significant noise
  • Stable signal during operation

🔹Technical interpretation:

  • The HIGH level (≈3.9V) is higher than the logical threshold of the XIAO ESP32-C3 (~2.0V), so it is correctly recognized as "logical 1"
  • The LOW signal (~0V) is correctly interpreted as "logical 0"
  • Signal stability ensures reliable readings

🔹Validation conclusion:

The signal delivered by the sensor iselectrically compatible, stable and suitable to be processed by the microcontroller, ensuring proper operation of the system without the need for additional conditioning circuits.

Digital signal observed on the oscilloscope

Final result

The developed system functionally integrates the humidity sensor with theXIAO ESP32-C3-based board, evidencing the complete acquisition and response flow of the embedded system.

🔹The system allows:
✔ Detect the soil moisture level using the HL-69 sensor
✔ Convert the physical signal into an interpretable digital signal
✔ Process the information in the microcontroller
✔ Activate an output (LED) based on the detected state
✔ Execute control logic in real time

🔹Functional Validation:
It was found that the system responds correctly to changes in soil moisture:

  • Wet floor → HIGH sign → LED on
  • Dry floor → LOW → LED signal off

This confirms the correct integration betweenhardware (sensor + board) andsoftware (code).

Problems and solutions

🔴Problem: Unstable Read
Solution: Common GND and Connection Verification

🔴Problem: Signal Noise
Solution: Use of resistance and improvement in wiring

Reflection

This project made it possible to understand that the input devices not only capture information, but also define the quality of the data that the system processes. They are the bridge between the physical world and the digital system, so any mistake at this stage directly affects the final result.

Working with a proprietary board based onthe XIAO ESP32-C3 involved going beyond programming: it required correctly integrating hardware, validating signal levels, and ensuring real electrical compatibility. This showed that a reliable reading depends on both the electronic design and the stability of the signal.

In addition, it was understood that choosing between analog or digital signal is not trivial, but a design decision depending on the application (accuracy vs. robustness).

🔹Critical conclusion:
A functional embedded system is not just about "working", but about measuring correctly, processing stably and responding reliably to real conditions.

Learning achieved

During this week, key competencies in the integration of embedded systems were consolidated, highlighting:

  • Integration of input devices into a designed board, eliminating the use of breadboard
  • Practical understanding of the difference between analogue and digital signals, and their applications depending on the context
  • Interpretation of physical variables in the environment (humidity) using sensors and their conversion to electrical signals
  • Validation of signals using electronic instrumentation (multimeter and oscilloscope)
  • Implementation of control logic in the microcontroller from data Purchased

🔹Technical approach acquired:
It was understood that data acquisition does not depend only on the sensor, but on the correct interaction between hardware, electrical signal and digital processing.

🔹Learning conclusion:
Electronic design does not end with the manufacture of the board, but with the ability to correctly interpret signals from the environment and transform them into functional decisions within the embedded system.

📋 Check-off List

1. Linked to the group assignment page?

Yes. The link to the group page where tests were carried out with a multimeter and oscilloscope to analyze analog and digital signals from the sensor was included.

2. Did you document what you learned from interconnecting an input device to your microcontroller and how physical property relates to the measured results?

Yes. It was explained how the HL-69 moisture sensor converts soil moisture into digital electrical signals and how the XIAO ESP32-C3 interprets those changes to activate an LED.

3. Did you document your design and manufacturing process or link it to the previously made dashboard?

Yes. The direct integration of the sensor into the pre-designed PCB with the XIAO ESP32-C3 was documented, including electrical connections and design criteria.

4. Does it explain how your code works?

Yes. The operation of the code was explained by digital reading (digitalRead) and LED control (digitalWrite) according to the status of the sensor.

5. Did you explain any problems encountered and how did you fix them?

Yes. Issues such as unstable readings and signal noise were documented, addressed through improvements in connections, common GND, and stabilization resistance.

6. Does it include original design files and source code?

Yes. The system source code and files related to the PCB designed for the XIAO ESP32-C3 were included.

7. Does it include a 'hero shot' from your board?

Yes. Added the hero shot showing the functional PCB with the integrated moisture sensor and the system in operation.

❓ Frequently Asked Questions

1. Can I use a breadboard to connect my input devices?

Answer:
No. In this work I did not use a breadboard. I directly integrated the HL-69 humidity sensor into my board designed with the XIAO ESP32-C3 microcontroller. This allowed me to meet the requirement for direct connection on PCB and ensure true integration of the embedded system without temporary mounts.

Week Files

Download all resources and files of this week in a compressed .ZIP archive

Download ZIP