Before wiring any sensor to a microcontroller (`Arduino`, `ESP32`, `STM32`, `Raspberry Pi`), identify how it outputs measurement data:
| Output Type | Signal Characteristics | Microcontroller Pin Required | Design Considerations |
|---|
| Analog Voltage | Continuous DC voltage proportional to the measured physical quantity (e.g., `0 V – 3.3 V`) | ADC Pin (Analog-to-Digital Converter) | Susceptible to wire noise and ground bounce; keep wires short and filter with a small RC low-pass network |
| Ratiometric Analog | Output voltage scales proportionally with the sensor's supply voltage ($V_{CC}$) | ADC Pin (referenced to the same $V_{CC}$) | Power the sensor from the exact same `VREF` / `3.3 V` rail as the MCU's ADC so supply fluctuations cancel out |
| Digital Logic / Threshold | Binary `HIGH` (`1`) or `LOW` (`0`) state triggered when a preset threshold is crossed | Standard Digital GPIO (or External Interrupt) | Often uses an onboard comparator (`LM393`) and potentiometer; check whether output is active-HIGH or open-drain |
| PWM / Pulse-Width | Square wave where duty cycle or pulse duration encodes the measurement (e.g., `HC-SR04` Echo) | Digital GPIO with hardware timer / `pulseIn()` | Ensure pulse voltage matches MCU logic level (`5.0 V` echo pins require a resistor divider on `3.3 V` MCUs) |
| Serial Digital Bus | Calibrated digital registers transmitted over I2C, SPI, or UART | Hardware `SDA/SCL`, `MOSI/MISO/SCLK`, or `TX/RX` | Highest noise immunity and precision; verify whether breakout board includes onboard level shifters and pull-ups |
Commercial hobbyist and industrial breakout boards (e.g., Adafruit, SparkFun, Waveshare, generic GY-series) often include onboard support circuitry that affects circuit integration:
Electronics Reference: 1. Diodes & Transistors | 2. Integrated Circuits (ICs) | 3. Communication Buses (UART, SPI & I2C) | 4. Voltage Regulators & Power Supply Design | 5. Operational Amplifiers (Op-Amps) | 6. Sensors & Breakout Modules