# Hand-curated from Firecrawl results (2026-09-18) and GPIO Zero docstrings (BSD-3). # A fact is recorded only when >= 2 independent sources agree, or it comes from a primary source # (manufacturer datasheet / library documentation). Third-party quotes were removed in this public copy (URLs kept; see the source); remaining quotes are from Raspberry Pi docs or GPIO Zero (BSD-3). Quotes are short, for verification only; they are # never copied into training text. `v1_labels` map real wiring situations onto spec-1.0 actions/reasons. modules: - id: hc_sr501_pir names: [HC-SR501, PIR sensor, PIR motion sensor, passive infrared sensor, motion detector] kind: digital_in supply_v: "4.5-20 (5 recommended)" signal: "OUT pushes 3.3 V HIGH on motion, 0 V idle" v1_actions: [gpio_read, "gpio_mode INPUT"] v1_labels: read_motion: gpio_read caveats: ["Some clone units may be open-drain or output at the supply voltage (Espruino)."] sources: - {url: "https://fgcoca.github.io/Guia-de-trabajo-para-microbit/datasheet/HC-SR501.pdf", type: datasheet} - {url: "https://components101.com/sensors/hc-sr501-pir-sensor"} - {url: "https://www.espruino.com/Pyroelectric"} - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "VCC should be connected to a 5V pin ... OUT to the GPIO", type: library_docs} - id: hc_sr04_ultrasonic names: [HC-SR04, ultrasonic distance sensor, ultrasonic range finder, sonar sensor] kind: trigger_echo supply_v: "5" signal: "TRIG input needs a 10 us pulse; ECHO outputs 5 V for the echo duration" v1_actions: ["gpio_write/gpio_read on TRIG/ECHO lines only"] v1_labels: echo_wired_direct_to_gpio: {action: report_error, reason: unsafe_voltage} ten_microsecond_trigger_pulse: {action: report_error, reason: invalid_parameter, requested: duration} measure_distance: {action: report_error, reason: unsupported_operation, needs_review: true, note: "timing measurement is outside v1; spec does not say which reason"} sources: - {url: "https://thepihut.com/blogs/raspberry-pi-tutorials/hc-sr04-ultrasonic-range-sensor-on-the-raspberry-pi"} - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "a voltage divider is required to ensure the 5V from the ECHO pin doesn't damage the Pi", type: library_docs} - {url: "https://www.youtube.com/watch?v=C02oB1n7rcg"} - id: relay_module_active_low names: [relay module, 5V relay module, optocoupler relay board, 2-channel relay module, 4-channel relay board, low-level trigger relay] kind: digital_out supply_v: "5 (coil)" signal: "IN is active-LOW: relay energises when IN is pulled LOW" coil_current_ma: 70 v1_actions: [gpio_write] v1_labels: turn_on_active_low_relay: {action: gpio_write, value: LOW} turn_off_active_low_relay: {action: gpio_write, value: HIGH} caveats: ["3.3 V logic works when JD-VCC jumper is removed and coils have a separate 5 V supply.", "~70 mA coil current is below the 200 mA threshold used for unsafe_current labels (D-02): no label."] sources: - {url: "http://www.handsontec.com/dataspecs/2Ch-relay.pdf", type: datasheet} - {url: "https://envistiamall.com/blogs/learn/2-channel-5v-spdt-relay-module-with-optocoupler-user-guide"} - id: dht22 names: [DHT22, AM2302, DHT11, temperature and humidity sensor] kind: single_bus_protocol supply_v: "3.3-6" signal: "single-bus serial protocol with microsecond timing; 40-bit frames; needs ~5.1k pull-up" v1_actions: [] v1_labels: read_temperature_or_humidity: {action: report_error, reason: unsupported_operation} sources: - {url: "https://cdn.sparkfun.com/assets/f/7/d/9/c/DHT22.pdf", type: datasheet} - {url: "https://www.waveshare.com/wiki/DHT22_Temperature-Humidity_Sensor"} - id: ds18b20 names: [DS18B20, 1-Wire temperature sensor, waterproof temperature probe] kind: one_wire_bus supply_v: "3.0-5.5" signal: "1-Wire bus, 4.7k pull-up to VCC" v1_actions: [] v1_labels: read_temperature: {action: report_error, reason: unsupported_operation} sources: - {url: "https://randomnerdtutorials.com/raspberry-pi-ds18b20-python/"} - {url: "https://www.rs-online.com/designspark/building-a-raspberry-pi-1-wire-thermostat"} - id: sg90_servo names: [SG90, micro servo, 9g servo, hobby servo] kind: pwm_out supply_v: "4.8-6" signal: "50 Hz (20 ms period); 500-2400 us pulses => 2.5-12% duty" stall_current_ma: 360 v1_actions: [gpio_pwm] v1_labels: set_servo_signal: {action: gpio_pwm, frequency_hz: 50, duty_cycle_range: [2.5, 12]} power_servo_from_gpio: {action: report_error, reason: unsafe_current, requested: load_current} sources: - {url: "https://www.friendlywire.com/projects/ne555-servo-safe/SG90-datasheet.pdf", type: datasheet} - {url: "https://smarthon-docs-en.readthedocs.io/en/latest/Sensors_and_actuators/Servo.html"} - {url: "https://industrialmonitordirect.com/blogs/knowledgebase/calculating-servo-current-requirements-sg90-specs-measurement"} - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/output_devices.py", quote: "Connect a power source (e.g. a battery pack or the 5V pin) to the power cable", type: library_docs} - id: active_buzzer names: [active buzzer, KY-012, piezo beeper with oscillator] kind: digital_out supply_v: "3.3-5.5" signal: "DC HIGH produces a fixed ~2.5 kHz tone; <=30 mA" v1_actions: [gpio_write, gpio_pulse] sources: - {url: "https://arduinomodules.info/ky-012-active-buzzer-module/"} - {url: "https://www.thegeekpub.com/wiki/sensor-wiki-ky-012-active-piezo-buzzer-module/"} - id: passive_buzzer names: [passive buzzer, KY-006, piezo speaker, tone buzzer] kind: pwm_out signal: "no oscillator; needs a square wave at the wanted pitch" v1_actions: [gpio_pwm] v1_labels: play_tone: {action: gpio_pwm, duty_cycle: 50, frequency_hz: "the tone frequency"} sources: - {url: "https://arduinomodules.info/ky-012-active-buzzer-module/"} - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/output_devices.py", quote: "TonalBuzzer", type: library_docs} - id: l298n names: [L298N, L298N motor driver, dual H-bridge, motor driver board] kind: motor_driver signal: "IN1-IN4 accept 3.3 V logic as HIGH; ENA/ENB accept PWM for speed" v1_actions: [gpio_write, gpio_pwm, gpio_sequence] v1_labels: drive_motor_via_driver: {action: gpio_sequence, ops: "IN1/IN2 levels then PWM on EN"} sources: - {url: "https://raspberrypi.stackexchange.com/questions/132956/l298n-driver-with-3-3v-voltage"} - {url: "https://forums.raspberrypi.com/viewtopic.php?t=68764"} - id: ir_obstacle names: [IR obstacle sensor, FC-51, infrared proximity sensor, obstacle avoidance module] kind: digital_in supply_v: "3.3-5" signal: "DO is HIGH with no obstacle, LOW when an obstacle is detected" v1_actions: [gpio_read] sources: - {url: "https://docs.sunfounder.com/projects/umsk/en/latest/01_components_basic/08-component_ir_obstacle.html"} - {url: "https://forum.arduino.cc/t/fc-51-ir-proximity-sensor-am-i-doing-it-wrong/480612"} - id: mq2_gas names: [MQ-2, MQ-2 gas sensor, smoke sensor module, gas detector module] kind: digital_in_threshold_or_analog supply_v: "5 (heater; ~4.9 V minimum)" signal: "DO is a comparator HIGH/LOW vs a trimmer threshold; AO is analog" v1_actions: [gpio_read] v1_labels: read_gas_concentration_value: {action: report_error, reason: unsupported_function, requested: analog_input} caveats: ["DO level may follow the 5 V module supply on some boards: treat 'wired straight to GPIO at 5 V' as unsafe_voltage only when the text says 5 V."] sources: - {url: "https://raspberrypi.stackexchange.com/questions/66731/raspberry-pi-with-mq-2-gas-sensor"} - {url: "https://forums.raspberrypi.com/viewtopic.php?t=274073"} - id: soil_moisture names: [soil moisture sensor, capacitive soil moisture sensor, hygrometer module] kind: analog_or_digital_threshold signal: "AO analog; some modules add a comparator DO" v1_labels: read_moisture_percentage: {action: report_error, reason: unsupported_function, requested: analog_input} sources: - {url: "https://forums.raspberrypi.com/viewtopic.php?t=272218"} - {url: "https://maker.pro/raspberry-pi/tutorial/interfacing-soil-moisture-sensor-with-raspberry-pi"} - id: ws2812 names: [WS2812B, NeoPixel, addressable LED strip, RGB LED strip] kind: timed_serial_protocol signal: "800 kHz single-wire protocol (1.25 us per bit), 5 V data preferred" v1_labels: set_pixel_colours: {action: report_error, reason: unsupported_operation} sources: - {url: "https://forums.adafruit.com/viewtopic.php?t=201560"} - {url: "https://www.reddit.com/r/raspberry_pi/comments/a6ggkn/possible_to_level_shift_gpio18_pwm_from_33v_to_5v/"} # --- GPIO Zero documented devices (library docstrings, BSD-3) --------------------------------------------- - id: push_button names: [push button, tactile switch, momentary button, button] kind: digital_in signal: "default pull-up: button to GND reads LOW when pressed; with pull_up=False wire to 3V3 (pressed = HIGH)" v1_actions: [gpio_read, "gpio_mode INPUT pull UP/DOWN"] sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "Connect one side of the button to a ground pin, and the other to any GPIO", type: library_docs} - id: led names: [LED, indicator LED, status LED] kind: digital_out signal: "anode via limiting resistor to GPIO, cathode to GND (active-high); active_high=False wires cathode to GPIO" v1_labels: led_without_resistor: {action: report_error, reason: unsafe_current, requested: led_resistor} sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/output_devices.py", quote: "connect the anode (longer leg) to a limiting resistor", type: library_docs} - {url: "https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio", quote: "LEDs should have resistors to limit the current", type: official_docs} - id: ldr_rc names: [light sensor, LDR, photoresistor] kind: rc_timing_in signal: "LDR + 1 uF capacitor on one GPIO; charge-time measurement, not a level read" v1_labels: read_light_level: {action: report_error, reason: unsupported_function, requested: analog_input, needs_review: true, note: "RC charge timing, not a true analog read"} sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "This class repeatedly discharges the capacitor, then times the duration", type: library_docs} - id: line_sensor names: [line sensor, TCRT5000 line follower] kind: digital_in signal: "VCC to 3V3, OUT to GPIO" v1_actions: [gpio_read] sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "VCC should be connected to a 3V3 pin", type: library_docs} - id: rotary_encoder names: [rotary encoder, KY-040] kind: digital_in_x2 signal: "A and B to two GPIOs, C to GND" v1_actions: [gpio_read] sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py", quote: "Connect A and B directly to two GPIO pins", type: library_docs} - id: dc_motor names: [DC motor, hobby motor, gear motor] kind: motor v1_labels: drive_directly_from_gpio: {action: report_error, reason: unsafe_direct_drive} sources: - {url: "https://github.com/gpiozero/gpiozero/blob/master/gpiozero/output_devices.py", quote: "connected to a bi-directional motor driver circuit (i.e. an H-bridge)", type: library_docs} - {url: "https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#gpio", quote: "Do not connect motors directly to the GPIO pins", type: official_docs}