{
    "key": "hc-sr501",
    "kind": "sensor",
    "model": {
        "aliases": [
            "hc-sr501"
        ]
    },
    "driver": {
        "runtime": {
            "init": {
                "args": {
                    "chip": "{gpio_chip}",
                    "line": "{out_pin}"
                },
                "class": "drivers.hcsr501.HCSR501"
            },
            "apt_packages": [
                "python3-libgpiod"
            ],
            "pip_packages": [
                "gpiod"
            ],
            "python_module": "drivers.hcsr501"
        },
        "targets": [
            "raspberrypi"
        ],
        "verified": {
            "by": null,
            "os": null,
            "date": null,
            "board": null,
            "reviewed_by": null,
            "evidence_url": null
        },
        "interface": "gpio-digital",
        "connection": {
            "pins": [
                {
                    "role": "out",
                    "notes": "Push-pull 3.3V output. Safe on a Raspberry Pi GPIO input.",
                    "required": true
                }
            ],
            "supply_voltage": "5V",
            "level_shift_required": null
        },
        "constraints": {
            "warmup_seconds": 60,
            "read_timeout_seconds": 1,
            "min_read_interval_seconds": 0.1
        },
        "failure_modes": [
            "Requires roughly 60 seconds after power on to stabilise. Output is unreliable and often latched high during that window.",
            "On-board potentiometers set sensitivity and hold time in hardware. Two physically identical modules will behave differently unless both pots are matched.",
            "Hold time means the output stays high for a fixed period after the last detection. Edge counting during that window measures nothing.",
            "Triggers on moving heat, not on people. Sunlight through glass, heating pipes and pets all register."
        ]
    },
    "source": "platform-seed",
    "status": "draft",
    "platform": {
        "name": "HC-SR501 PIR Motion Sensor",
        "protocol": "gpio",
        "readings": [
            {
                "slug": "motion-detected",
                "unit": null,
                "label": "Motion Detected",
                "data_type": "boolean",
                "range_max": 1,
                "range_min": 0,
                "unit_symbol": null,
                "device_class": "motion",
                "decimal_places": 0,
                "threshold_crit_low": null,
                "threshold_warn_low": null,
                "threshold_crit_high": null,
                "threshold_warn_high": null
            }
        ],
        "description": "Passive infrared sensor for motion detection. Digital high/low output. Adjustable sensitivity and delay time.",
        "sensor_type": "motion",
        "manufacturer": null,
        "model_number": "HC-SR501",
        "datasheet_url": null,
        "read_interval_seconds": 1
    },
    "revision": 1
}