Assignment Requirements
Group assignment
- Probe an input device(s)'s analog levels and digital signals (As a minimum, you should demonstrate the use of a multimeter and an oscilloscope..
- Document your work on the group work page and reflect on your individual page what you learned.
Individual assignment
- Design and document a parametric construction kit (consider kerf).Measure something: add a sensor to a microcontroller board that you have designed and read it.
Progress Status
This is for reporting progress (not for visitors to click).
Group page link + notes added.
Missing final photos and conclusions.
Upload .zip with source files.
Assignment Requirements
Learning outcomes
- Demonstrate workflows used in sensing something with input device(s) and MCU board
Have you answered these questions?
- Linked to the group assignment page.✅
- Documented what you learned from interfacing an input device(s) to your microcontroller and optionally, how the physical property relates to the measured results.✅.
- Documented your design and fabrication process or linked to the board you made in a previous assignment.✅.
- Explaind how your code works.✅.
- Explained any problems you encountered and how you fixed them.✅.
- Included original design files and source code.✅.
- Included a ‘hero shot’ of your board.✅.
Weekly planning
During the week, we carried out various activities that presented significant challenges but were also very rewarding, especially due to the opportunity to share and learn as a team. We met virtually with our colleagues at the node and participated in lab meetings, which allowed us to organize ourselves and conduct open workshops in different spaces. In these sessions, we reviewed and worked with input devices, understanding their operation and their importance in capturing data from the environment for subsequent processing in electronic systems.
group work
This week, focused on Input Devices, we held an in-person meeting at the Fab Lab UNI node. Colleagues in other cities also participated virtually, allowing the entire group to connect. In this stage, we worked with input devices, which capture information from the environment (such as light, temperature, or pressure) and transform it into signals that can be interpreted by electronic systems. We used various sensors and measuring tools for this purpose. During the practical sessions, we used equipment such as the oscilloscope and the multimeter, which helped us analyze electrical signals, verify voltages, and ensure the correct functioning of the circuits. These tools were essential for understanding how the sensors interact with the motherboard and how the data obtained is processed.
Group Project: Input Devices Analysis
In this group project, we used laboratory measurement tools to analyze input devices using a specially designed microcontroller board.
We tested a laboratory sensor and, using the microcontroller board, analyzed the signal with a multimeter and an oscilloscope.
Tools and Components Used
- Adrian Torres microcontroller board
- Seeed Studio XIAO RP2040
- HC-SR04 ultrasonic distance sensor
- LM393 photoresistor (LDR)
This experience allowed us to better understand how input devices capture and transmit data, as well as how signals can be measured and interpreted using laboratory equipment.
Procedures: Input Devices Analysis
You can view the complete group work here: View Group Project
Procedure 1: Digital Input (HC-SR04 Ultrasonic Sensor)
1. Description
The HC-SR04 ultrasonic module detects distance using Trigger and Echo pins. It sends a signal and measures the time it takes to bounce back.
- Range: 2 cm to 500 cm (15° angle)
- Accuracy: 0.3 cm increments
- Mounting: 4 holes on the board
- Formula: distance = (travel time / 2) × speed of sound
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
- 5V Supply
- Trigger (input)
- Echo (output)
- GND
Programmed using Arduino IDE with Xiao RP2040.
3. Signal Observation
After programming, we observed distance measurements, confirming:
- Correct operation of the HC-SR04 module
- Proper digital input signal behavior
Procedure 2: Analog Input (LM393 LDR Sensor)
1. Description
The LM393 photosensitive LDR sensor detects light intensity and provides both analog and digital outputs.
- Driving ability: 15mA with adjustable potentiometer
- Brightness: Adjustable sensitivity
- Detection: Light intensity
- Outputs: Analog and digital
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
- 5V Supply
- DO: Digital output
- A0: Analog output
- GND
Programmed using Arduino IDE with Xiao RP2040 and monitored through the Serial Monitor.
3. Signal Observation
After programming, we observed variations in light levels (low / no light), confirming:
- Correct operation of the LM393 LDR module
- Proper analog input signal behavior
Group Difficulties and Conclusions
Difficulties
- We were not familiar with the HC-SR04 and LM393 LDR modules, so we had to review their specifications.
- Incorrect connections caused the procedures to fail and took time to fix.
- Wrong pin selection (used D1 instead of D0), resulting in no data readings.
- After correcting connections and pins, we successfully measured distance and light intensity.
Conclusions
This group assignment helped us understand how to safely verify a board before measuring signals, correctly connect the oscilloscope, and interpret real digital signals in hardware. We also learned the importance of proper grounding, correct GPIO selection, and appropriate trigger and scale settings to obtain stable waveforms and validate the microcontroller’s operation.
group assignment
Individual Task
Individually, I conducted tests with sensors and simulations using a breadboard, the Wokwi platform, and a physical circuit board. This allowed me to validate the functionality of the components before their final implementation.
For the development of the circuit board, I attended the ESAN Fab Lab, where I was guided by Professor Jorge. This process presented a significant challenge, as we acquired knowledge about the operation of CNC machines from different perspectives each week.
On this occasion, we worked with the Carvera desktop CNC machine, which requires the use of additional software compared to other CNCs we had previously used. This necessitated a greater level of learning and adaptation.
For the circuit board design, I used a Silva Espinoza board as a base, since it contained components related to the final project I want to develop. From this base, I was able to customize the design according to my needs; however, achieving its correct adaptation and functionality also presented a challenge.
fairs for entrepreneurs and artisans.Fab Lab ESAN
Carvera CNC Machine
The CARVERA Maker is an advanced and intelligent desktop CNC machine designed to meet the demands of digital manufacturing in confined spaces. Despite its compact size, it offers a high level of precision, automation, and versatility, making it an ideal tool for designers, engineers, and machining enthusiasts.
It integrates innovative features such as automatic leveling, automatic tool change, a dust collection system, and the option to add a 4-axis module. Thanks to these features, CARVERA sets a new standard in desktop CNC machining.
One of its main advantages is the automatic tool change system along with the automatic probe function. With machines lacking these functionalities, the user must manually perform tool changes and calibration, which is tedious and time-consuming, especially for complex tasks like PCB manufacturing.
In contrast, CARVERA allows for the automated execution of multiple processes—such as leveling, cutting, cleaning, drilling, and engraving—selecting the appropriate tool at each stage. This not only optimizes working time, but also improves the accuracy and quality of the final result, allowing the user to focus primarily on the design.
Motherboard
Work began using the KiCad program, after verifying that all necessary libraries were correctly installed. The motherboard file was also opened for review, ensuring the FabLab library was properly incorporated.
From this motherboard, the required components were selected and adapted. First, the XIAO microcontroller was chosen, specifically the Xiao ESP32-C3 model. The footprints for each component were also verified, guaranteeing their compatibility with the design. Subsequently, the electronic schematic was updated.
During the schematic design, the various components, such as the DHT sensor and the OLED display, were placed and properly connected to the ESP32-C3. The microcontroller's technical specifications were consulted to ensure correct pin assignment and proper circuit operation.
Using a motherboard optimized the design process; however, it also required additional adjustments and validations to correctly integrate the new components into the existing circuit.
Gerber to PNG Conversion
Gerber2PNG is the process (or tool) that allows you to convert Gerber files into PNG images. This is very useful when you need to use PCB designs on CNC milling machines, such as in a Fab Lab.
What is it used for?
- Converting the PCB design into an image that can be interpreted by machining software (such as mods)
- Generating toolpaths
- Quickly visualizing the design layers
Workflow
- Design the PCB in KiCad
- Export the Gerber files
- Use Gerber2PNG to convert to an image
- Import the PNG into mods or other software
- Machine the design on the CNC (e.g., Carvera)
Mods configuration
After designing the board in KiCad, the Gerber file was exported and processed in Gerber2PNG to obtain the SVG file. This file was imported into Mods, where the color inversion function was used to generate an inverted version of the design. This step facilitated the visualization of the board, allowing for clearer identification of the components and connection paths.
Next, the parameters in the Mill Raster 2D settings were adjusted, and the corresponding calculations were performed to obtain the updated machining paths. Modifying these values allowed for refining the milling parameters, resulting in a more precise and efficient process.
These adjustments were applied to both the internal machining (tracks) and the external cutting of the board. This optimized the milling strategy according to the specific needs of the project, significantly improving the quality and accuracy of the final result.
Carvera Controller
First, open a web browser and go to the official Makera website. Then, locate the "Support" or "Downloads" section in the main menu. Within this section, search for the software called Carvera Controller.
Next, select the program version according to your computer's operating system (Windows or macOS) and click download. Once the file has downloaded, open the installer and follow the instructions to complete the installation.
Finally, run the Carvera Controller program to begin configuring and using your Carvera CNC machine.
manufacturing of the plate on a Carvera CNC Machine
First, the board design is prepared in KiCad and the files are exported in Gerber format. These files are then converted to PNG or SVG using Gerber2PNG and processed in Mods to generate the machining toolpaths for both the internal traces and the external contour.
Next, the Carvera CNC machine is turned on and connected to the computer using the Carvera Controller software, ensuring it is properly calibrated.
The sacrificial bed is then positioned and checked, ensuring it is clean and level. The copper board (PCB) is placed on this surface and firmly secured with double-sided tape or clamps to prevent any movement during machining.
Then, the necessary milling tools are installed. The Carvera allows for automatic tool changes, so the tools are configured according to the type of work (internal traces and external cutting).
Next, the origin point is defined on the X, Y, and Z axes, either using the automatic probe or manually. This is essential to ensure the accuracy of the process.
Once everything is configured, the toolpath files are loaded into the software, and machining begins. First, the internal tracks are milled, followed by the external cutting of the plate.
Finally, the plate is carefully removed, the surface is cleaned, and the connections and cuts are verified to ensure a high-quality final result.
Programming
For programming, the Arduino IDE development environment was opened. To ensure accurate readings from the DHT sensor, the corresponding library (DHT.h) was installed correctly.
First, the “Sketch” menu was accessed, then the “Include Library” option, and finally “Manage Libraries”. The term “DHT” was entered in the search box, which located the sensor library developed by Adafruit.
Once located, the “Install” option was selected, and the installation process was allowed to complete successfully. This step was essential to guarantee proper communication between the DHT sensor and the microcontroller.
Arduino code
m/* ESP32C3 OLED DISPLAY 3V ------------- VCC GND ------------ GND SCL -------------- SCL (Bus I2C) SDA ------------- SDA (Bus I2C) ESP32C3 DHT11 3V ------------- 3V GND ------------ GND D6 ------------ Pin de Datos del DHT */ #includereflections
During the process, special attention had to be paid to the environment configuration and libraries, as errors arose in some cases that required reinstalling and re-verifying the system components. Despite these difficulties, the device was successfully programmed and its operation customized according to the project requirements, although this involved additional adjustment and testing time.
- Connection configuration: The physical connection of the components, including the ESP32-C3, the OLED screen, and the DHT11 sensor, is detailed in the code comments section. The pins assigned to each device are specified, ensuring proper system integration.
- Library inclusion: The necessary libraries for the program's operation are included, such as the DHT.h library for the DHT11 sensor and the corresponding libraries for controlling the OLED screen.
programming with wokwi
The programming was also done using the online platform Wokwi, which allows for the simulation of electronic circuits and the testing of code without the need for physical hardware. In this environment, the XIAO ESP32-C3 microcontroller was used, and various sensors were integrated to analyze its behavior in a virtual simulation.
Among the components used was the DHT11 sensor, responsible for measuring ambient temperature and humidity. Thanks to the simulation in Wokwi, it was possible to visualize the values generated by the sensor in real time, as well as verify the correct functioning of the code before implementing it on the physical board.
The use of Wokwi facilitated the detection of programming errors, allowing for quick adjustments to the code and optimization of the system logic. Furthermore, this tool offers advantages such as the simulation of multiple components, monitoring via the serial port, and the ability to work remotely, making it a very useful tool in the initial stages of electronic development.
Sensor Programming (DHT22 + LDR)
#include "DHT.h"
// Definimos los pines
#define DHTPIN 5 // El pin D3 del XIAO ESP32-C3 corresponde al GPIO 5
#define DHTTYPE DHT22 // Tipo de sensor
#define LDRPIN 2 // El pin A0 del XIAO ESP32-C3 corresponde al GPIO 2
// Inicializamos el sensor DHT
DHT dht(DHTPIN, DHTTYPE);
void setup() {
Serial.begin(115200);
Serial.println("Iniciando lectura de sensores...");
dht.begin();
// En el ESP32 no es estrictamente necesario declarar los pines analógicos como INPUT,
// pero es una buena práctica.
pinMode(LDRPIN, INPUT);
}
void loop() {
// Esperamos 2 segundos entre lecturas (el DHT22 es un sensor lento)
delay(2000);
// Leemos la humedad y la temperatura
float humedad = dht.readHumidity();
float temperatura = dht.readTemperature();
// Leemos el valor del LDR (0 a 4095 en el ESP32)
int valorLuz = analogRead(LDRPIN);
// Comprobamos si hubo un error al leer el DHT22
if (isnan(humedad) || isnan(temperatura)) {
Serial.println("¡Error al leer del sensor DHT!");
return;
}
// Mostramos los resultados en la consola Serial
Serial.print("Humedad: ");
Serial.print(humedad);
Serial.print(" %\t");
Serial.print("Temperatura: ");
Serial.print(temperatura);
Serial.print(" °C\t");
Serial.print("Nivel de luz (Analógico): ");
Serial.println(valorLuz);
}
test on a breadboard
A breadboard test was conducted to practice circuit assembly and, simultaneously, verify the correct operation of the sensors before their implementation on the final board.
For this test, the XIAO ESP32-C3 microcontroller was used along with various sensors, including a DHT11 for measuring temperature and humidity, and an LDR sensor for detecting light levels.
During the tests, the system's behavior was evaluated under different environmental conditions. Measurements were taken both indoors and outdoors, allowing for the observation of real-world variations in ambient temperature and humidity. Similarly, the LDR sensor responded correctly to changes in lighting, registering different values in the presence of bright light and in low-light conditions.
These breadboard tests were essential for validating the connections, verifying system stability, and detecting potential errors before board fabrication. Furthermore, they provided a better understanding of the sensors' behavior in real-world situations, facilitating the subsequent integration and optimization of the project.
Video (local)
Reflection
Developing the project using a breadboard, simulation in Wokwi, and the fabrication of the circuit board allowed for a comprehensive understanding of the electronic design process, from the initial idea to its physical implementation.
The use of the breadboard was fundamental for performing quick tests and validating connections in a real-world environment, allowing for the practical identification of errors before moving on to more advanced stages. It also allowed for the addition and testing of various sensors, which is directly related to my final project, facilitating experimentation with different configurations and components.
On the other hand, the simulation in Wokwi facilitated risk-free experimentation, helping to test the code, integrate components, and understand the system's behavior without the need for physical hardware. This allowed for multiple tests and adjustments to be performed quickly and efficiently.
Finally, the design and fabrication of the circuit board represented the most demanding stage, as it required greater precision, planning, and technical knowledge. This phase allowed for the consolidation of everything learned, integrating both electronic design and the manufacturing process.
Together, these tools and methodologies complement each other: simulation allows for anticipating errors, the breadboard validates functionality in practice, and the final board brings the project to life. This process not only strengthened technical skills but also problem-solving abilities and adaptability to difficulties, resulting in a functional and customized product aligned with the final project objectives.