{
    "key": "hc-sr04",
    "kind": "sensor",
    "model": {
        "aliases": [
            "hc-sr04"
        ]
    },
    "driver": {
        "runtime": {
            "init": {
                "args": {
                    "echo_pin": "board.D{echo_pin}",
                    "trigger_pin": "board.D{trig_pin}"
                },
                "class": "adafruit_hcsr04.HCSR04"
            },
            "apt_packages": [],
            "pip_packages": [
                "adafruit-circuitpython-hcsr04"
            ],
            "python_module": "drivers.hcsr04"
        },
        "targets": [
            "raspberrypi"
        ],
        "verified": {
            "by": null,
            "os": null,
            "date": null,
            "board": null,
            "reviewed_by": null,
            "evidence_url": null
        },
        "interface": "gpio-timing",
        "connection": {
            "pins": [
                {
                    "role": "trig",
                    "notes": null,
                    "required": true
                },
                {
                    "role": "echo",
                    "notes": "Outputs 5V. Must be divided or level shifted to 3.3V before reaching a GPIO input.",
                    "required": true
                }
            ],
            "supply_voltage": "5V",
            "level_shift_required": "Required on echo"
        },
        "constraints": {
            "warmup_seconds": null,
            "read_timeout_seconds": 1,
            "min_read_interval_seconds": 0.06
        },
        "failure_modes": [
            "The echo pin idles at 5V. Connecting it directly to a Raspberry Pi GPIO will damage the pin. A divider or level shifter is mandatory.",
            "Measurement is timing based and is corrupted by scheduler latency. Occasional wild readings are expected and must be filtered rather than published.",
            "Returns no echo for soft, angled or very close targets. A timeout is a valid outcome, not a fault.",
            "Speed of sound varies with air temperature. Uncompensated readings drift by roughly 0.2 percent per degree."
        ]
    },
    "source": "platform-seed",
    "status": "draft",
    "platform": {
        "name": "HC-SR04 Ultrasonic Distance Sensor",
        "protocol": "gpio",
        "readings": [
            {
                "slug": "distance",
                "unit": "centimetres",
                "label": "Distance",
                "data_type": "float",
                "range_max": 400,
                "range_min": 2,
                "unit_symbol": "cm",
                "device_class": "distance",
                "decimal_places": 1,
                "threshold_crit_low": null,
                "threshold_warn_low": null,
                "threshold_crit_high": null,
                "threshold_warn_high": null
            }
        ],
        "description": "Ultrasonic ranging module. Measures distance 2cm to 400cm using echo time. GPIO trigger and echo pins.",
        "sensor_type": "acoustic",
        "manufacturer": null,
        "model_number": "HC-SR04",
        "datasheet_url": null,
        "read_interval_seconds": 10
    },
    "revision": 1
}