Project Overview
This week I worked with input devices, focusing on the MQ-3 gas sensor as an input device for my
final project: a "digital nose" capable of sensing and differentiating incense aromas. The board integrates an analog gas sensor with a SAMD21 microcontroller to read and process sensor data, building on the Genji-Mon incense holder design from previous weeks. This assignment demonstrates how input devices can be integrated into custom PCBs to create interactive sensing systems.
The Input Device: MQ-3 Gas Sensor
The MQ-3 is a tin dioxide semiconductor gas sensor that functions as an analog input device. It detects volatile organic compounds (VOCs) including alcohol vapor and aromatic compounds found in incense smoke. The sensor operates by changing its resistance when exposed to target gases, producing an analog voltage signal that can be read by the SAMD21 microcontroller's 12-bit ADC (Analog-to-Digital Converter). This single-sensor input device serves as a prototype for a future multi-sensor array capable of identifying different incense types by their unique chemical signatures.
Input Device Integration
The MQ-3 sensor was integrated into a custom PCB with a SAMD21 microcontroller. The sensor's analog output connects to one of the SAMD21's ADC pins, allowing real-time reading of gas concentrations. The microcontroller's 12-bit resolution provides 4096 discrete levels for precise measurement of the analog input signal. Data from the sensor can be transmitted via USB for logging, analysis, and visualization, enabling the creation of a complete input-to-output system for smell detection and classification.
Fabrication Process
I started by exporting the PCB design as Gerber files and processing them through mods to generate CNC toolpaths. The process used a 0.4mm end mill for trace milling and 0.8mm end mill for the board outline. The most critical step was setting the Z-height precisely on the copper surface - even small errors significantly affect trace quality. After milling, I inspected the board under magnification and tested for continuity and shorts. The final board came out clean with well-isolated traces, ready for component population and input device testing.
Mistake: Breaking the Carvera Machine
During my first milling attempt, I broke the Carvera CNC machine by snapping off the tip of the end mill. The issue came from my workflow: I exported the design through EasyEDA and generated PNG files instead of using Quentin's recommended workflow. This caused a scaling problem - the measurements were off, and when the machine tried to cut at the wrong depth, the end mill broke off completely.
This taught me an important lesson about the importance of following established workflows in digital fabrication. Different tools export at different resolutions and scales, and assuming "a PNG is a PNG" can have expensive consequences. After switching to the proper workflow and double-checking my measurements, the second attempt was successful.
Input Device Testing and Validation
Before fabricating my board, I tested the MQ-3 input device with a reference board using the same SAMD21 + MQ-3 configuration. I collected sensor data by exposing it to different aromatic sources - incense, alcohol, and clean air - and logged the analog readings via USB. The sensor responses showed distinct patterns for each source, demonstrating that the input device could successfully differentiate between different types of volatile compounds.
I then ran unsupervised clustering on this data to see if different aromas would naturally group separately based on the input device readings. The results were promising: the sensor responses formed clear clusters based on source type, not random noise. This proof-of-concept validates that even a single input device can distinguish different volatile compounds, and that a multi-sensor array should provide even better classification for identifying specific incense varieties.
Images
Reference Bread Board - Starting Point
Reference board with SAMD21 microcontroller and MQ-3 input sensor used as design foundation
Close-up view of reference board showing component layout and input device circuit design details
PCB Design and Fabrication Process
PCB editor showing the complete board layout with SAMD21 microcontroller, MQ-3 input sensor connections, and component placement
Gerber file PNG translation showing the MQ-3 input sensor PCB trace pattern for milling
Traces
Exterior
Milling preview
Mistake: Broken End Mill
Incorrect scaling from EasyEDA PNG export
Broken trace
Broken holes
Broken end mill from first milling attempt
Final Fabricated PCB
Completed MQ-3 input sensor PCB with SAMD21 microcontroller - ready for component population and input device testing
Input Device Data Collection and Analysis
Real-time input device data collection from reference board showing analog readings and response patterns from the MQ-3 sensor
Machine learning model configuration for processing input device data and pattern recognition
AI clustering analysis results showing distinct patterns in input device responses - demonstrating potential for incense classification
Reflection
This week focused on working with input devices, specifically the MQ-3 gas sensor as an analog input for my digital nose project. The assignment demonstrated how input devices can be integrated into custom PCBs and how their analog signals can be read and processed by microcontrollers. The PCB milling process taught me the importance of precision - particularly Z-height calibration, which makes or breaks trace quality. I also learned this the hard way by breaking the Carvera's end mill on my first attempt. Using the wrong export workflow from EasyEDA created scaling issues that led to incorrect cutting depths. It's a reminder that in digital fabrication, the entire toolchain matters - not just the final step.
But more importantly, testing the reference board and seeing clear clustering in the input device data proved that the "digital nose" concept actually works. Different aromas produce distinguishable patterns in the sensor's analog output, even with just a single input device. The fabricated board is now ready to become the foundation for a multi-sensor array. Combined with the Genji-Mon incense holder from earlier weeks, this creates a system that bridges traditional Japanese aesthetics with modern sensing technology - a device that can actually "smell" and distinguish different incense varieties through input device integration.
This week's work emphasized the importance of understanding input devices - how they work, how to integrate them into custom circuits, and how to process their signals. The MQ-3 sensor demonstrates how analog input devices can provide rich data about the physical world, and how that data can be processed and analyzed to create meaningful interactions. The ability to read analog sensor inputs and convert them to digital data for processing is a fundamental skill in creating interactive systems.
Note: This assignment documentation website was created with assistance from Cursor AI.
Attachments
Links