{
  "metadata": {
    "id": "ws2812-neopixel-breakout",
    "name": "Single WS2812B NeoPixel Breakout",
    "type": "indicator",
    "description": "Small breakout PCB carrying a single WS2812B 'NeoPixel' — a 5050-format RGB LED with the WS2812B controller IC integrated into the same package. Four through-hole pads expose VCC, GND, DIN, and DOUT. The MCU drives DIN with the WS2812 single-wire NRZ protocol (~800 kHz, 24-bit GRB per pixel, T0H 0.4 µs / T1H 0.8 µs / total bit 1.25 µs / RES > 50 µs); each pixel latches the first 24 bits and re-shapes the rest out of DOUT, so units are daisy-chainable. 5 V is the canonical supply (3.5–5.3 V absolute range); 3.3 V drive is borderline — use a level shifter or drop VCC for reliable operation. On AquaSense the breakout is the front-panel status indicator (green idle, blue inferring, red leak alert, yellow setup, white self-test) driven by a single Heltec V3 GPIO; DOUT is left unconnected.",
    "manufacturer": "Adafruit",
    "part_number": "1612",
    "datasheet_url": "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf",
    "tags": [
      "led",
      "rgb",
      "neopixel",
      "ws2812",
      "ws2812b",
      "indicator",
      "breakout",
      "addressable",
      "5050",
      "adafruit",
      "worldsemi",
      "single-wire",
      "daisy-chain"
    ],
    "schema_version": "1.4.0",
    "version": "1.0",
    "taxonomy": [
      "expansion.breakout"
    ]
  },
  "domains": [
    {
      "domain": "electrical",
      "power_domains": [
        {
          "id": "vcc",
          "name": "VCC (LED supply)",
          "nominal_voltage_V": 5,
          "voltage_range_V": [
            3.5,
            5.3
          ],
          "voltage_tolerance_percent": 5,
          "max_current_mA": 60,
          "regulation_type": "unregulated",
          "isolation_type": "non_isolated",
          "ground_reference": "common",
          "description": "Main supply for the integrated WS2812B LED + driver IC. Datasheet absolute range 3.5–5.3 V; 5 V is the canonical operating point. Per-pixel draw can reach ~55 mA at full-brightness white (3 channels × 18.5 mA)."
        }
      ],
      "resources": [
        {
          "id": "vcc",
          "functions": [
            {
              "name": "power_input"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vcc",
          "description": "VCC pad — supply input for the WS2812B integrated LED + driver (3.5–5.3 V; 5 V typical)."
        },
        {
          "id": "gnd",
          "functions": [
            {
              "name": "ground"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vcc",
          "description": "Common ground reference for both power and the data line."
        },
        {
          "id": "din",
          "functions": [
            {
              "name": "DIN"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vcc",
          "description": "Serial data input — accepts the WS2812 single-wire NRZ stream from the upstream MCU GPIO or the upstream pixel's DOUT. The first 24 bits (G,R,B order) are latched by this pixel; remaining bits are re-shaped and forwarded to DOUT."
        },
        {
          "id": "dout",
          "functions": [
            {
              "name": "DOUT"
            }
          ],
          "connector_type": "pin",
          "power_domain_id": "vcc",
          "description": "Serial data output — re-shaped pass-through for daisy-chaining additional WS2812-family pixels. Leave unconnected when this pixel is the last (or only) one in the chain."
        }
      ],
      "interfaces": [
        {
          "id": "power_input",
          "protocol": {
            "type": "power",
            "role": "sink"
          },
          "requires": [
            {
              "function": "power_input",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "max_instances": 1,
          "description": "Primary power input — VCC (3.5–5.3 V, 5 V typical) and GND. Pixel draws up to ~55 mA at full-white brightness; budget at least 60 mA per pixel on the supply rail and decouple with a 0.1 µF cap close to VCC.",
          "name": "Power Input"
        },
        {
          "id": "ws2812_data_input",
          "protocol": {
            "type": "custom",
            "role": "input"
          },
          "requires": [
            {
              "function": "DIN",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "exclusive": true,
          "max_instances": 1,
          "constraints": {
            "requires_matching_voltage_domain": true
          },
          "description": "WS2812 single-wire NRZ data input (~800 kHz, 24-bit GRB per pixel; T0H 0.4 µs, T0L 0.85 µs, T1H 0.8 µs, T1L 0.45 µs; total bit 1.25 µs; RES/latch > 50 µs idle-low). Driven by an MCU GPIO at VCC logic level (5 V recommended; VIH ≥ 0.7·VDD = ~3.5 V, so a 3.3 V GPIO is borderline — use a 74AHCT125 level shifter, drop VCC to ~3.7 V, or place the first pixel in shadow on a 3.3 V system). Whitelist gap: protocol modeled as `custom` because no WS2812 entry exists yet in protopart-whitelist.json — see ralph/gaps.json.",
          "name": "WS2812 Data Input"
        },
        {
          "id": "ws2812_data_output",
          "protocol": {
            "type": "custom",
            "role": "output"
          },
          "requires": [
            {
              "function": "DOUT",
              "count": 1
            },
            {
              "function": "ground",
              "count": 1
            }
          ],
          "exclusive": true,
          "max_instances": 1,
          "constraints": {
            "requires_matching_voltage_domain": true
          },
          "description": "WS2812 single-wire NRZ data pass-through to the DIN of a downstream WS2812-family pixel. Re-shaped by the on-chip controller, so chain length is limited by the supply (current/decoupling) rather than signal integrity. Leave unconnected when this pixel is the last/only one in the chain. Whitelist gap: protocol modeled as `custom` (see ralph/gaps.json).",
          "name": "WS2812 Data Output (Daisy-Chain)"
        }
      ],
      "supply_voltage_V": [
        3.5,
        5.3
      ],
      "power_consumption_mW": 275,
      "pin_count": 4
    },
    {
      "domain": "mechanical",
      "resources": [],
      "interfaces": [],
      "package_type": "PCB Module (single 5050 NeoPixel breakout)",
      "dimensions_mm": {
        "length": 10.5,
        "width": 10.5,
        "height": 3
      },
      "weight_g": 0.5
    },
    {
      "domain": "thermal",
      "resources": [],
      "interfaces": [],
      "operating_temperature_C": [
        -20,
        80
      ],
      "metadata": {
        "thermal_design_power_W": 0.275,
        "requires_thermal_management": false,
        "thermal_monitoring_available": false,
        "cooling_method": "passive"
      }
    }
  ],
  "design_rules": [
    "VCC absolute range is 3.5–5.3 V. Do not exceed 5.3 V or the WS2812B IC may be damaged.",
    "DIN logic level is referenced to VCC: VIH ≥ 0.7·VDD. At VDD = 5 V that is ~3.5 V, so a 3.3 V MCU GPIO is borderline — use a 74AHCT125 (or similar) level shifter, drop VCC to ~3.7 V, or place a sacrificial first pixel as a level translator.",
    "Decouple VCC with a 0.1 µF ceramic close to the LED. For chains > 4 pixels add a 100–1000 µF bulk cap on the supply rail.",
    "Place a 300–500 Ω series resistor on the DIN line close to the breakout to limit ringing on long wires.",
    "Hold DIN low (or to the upstream DOUT) for at least 50 µs between frames to latch the loaded data — sending a new frame before RES expires causes torn updates.",
    "Send 24 bits per pixel in G-R-B order, MSB first. On AquaSense's single-pixel use, only the first 24 bits matter; DOUT is intentionally unconnected.",
    "If daisy-chaining, only one WS2812 data link enters DIN and only one leaves DOUT — bus-style multi-drop is not supported."
  ],
  "validation_requirements": [
    "Verify VCC supply is between 3.5 V and 5.3 V (5 V typical) and shares a ground with the MCU driving DIN.",
    "Confirm the MCU GPIO logic level is compatible with VIH ≥ 0.7·VDD on DIN, or that a level shifter / VCC reduction is in place.",
    "Confirm DIN is connected to exactly one upstream driver (MCU GPIO or another pixel's DOUT), and DOUT to at most one downstream pixel's DIN.",
    "Verify that the supply rail can deliver at least 60 mA per pixel (worst-case full-white) plus headroom for any other loads.",
    "Confirm the chosen pixel-driver library (Adafruit_NeoPixel, FastLED, esp_idf rmt_led_strip, etc.) targets WS2812B GRB-order, 800 kHz timing.",
    "Confirm the operating ambient is within −20 °C to +80 °C."
  ],
  "usage_notes": "On AquaSense the part is used as a single-pixel front-panel status indicator: green = idle, blue = model is inferring, red = leak alert, yellow = setup mode, white = self-test. Drive DIN from any Heltec V3 GPIO using a WS2812-aware library (Adafruit_NeoPixel, FastLED, or the ESP32 RMT/LED-strip peripheral). Because the chain is exactly one pixel long, DOUT is left unconnected and chain-length / decoupling concerns are minimal — a single 0.1 µF cap across VCC/GND is sufficient. If the Heltec V3 is configured to drive DIN at 3.3 V logic, validate timing margin with the actual VCC the breakout sees; if VCC = 5 V, plan for a level shifter or drop VCC to ~3.7 V to satisfy VIH.",
  "application_examples": [
    "Front-panel status indicator on AquaSense leak detector (green/blue/red/yellow/white state codes)",
    "Single-LED notification light on a battery-powered IoT node",
    "Build-status LED on a CI dashboard ('build green / build red')",
    "Wearables status indicator with very few wires (3 conductors carry power and the data link)",
    "Educational 'first NeoPixel' demo on Arduino / ESP32 / Raspberry Pi Pico"
  ],
  "compatibility_notes": "Compatible with any MCU that can drive a 24-bit, ~800 kHz NRZ stream within ±150 ns timing tolerance — Arduino AVR, ESP32 (incl. Heltec V3), Raspberry Pi Pico (PIO), Teensy, and most ARM Cortex-M boards. Software stacks: Adafruit_NeoPixel, FastLED, NeoPixelBus, and the ESP-IDF rmt_led_strip / led_strip components. Daisy-chains with any other WS2812 / WS2812B / WS2812C / SK6812 (RGB-only mode) pixel — pass DOUT into the next pixel's DIN.",
  "warnings": [
    "VCC > 5.3 V will damage the integrated controller IC — clamp or regulate any supply that could spike (e.g. unbuffered USB-PD).",
    "Driving DIN with 3.3 V logic into a 5 V VCC may work on the bench and fail in field deployment as temperature or supply-rail tolerance shifts the VIH threshold. Plan for a level shifter on production builds.",
    "Reverse polarity on VCC/GND will destroy the LED instantly; no on-board reverse-polarity protection.",
    "ESD-sensitive: handle on a grounded mat. The 5050 package has no extra ESD protection beyond the integrated controller.",
    "Long pixel chains can exceed the bulk-supply current capability; the breakout itself imposes no current limit beyond per-pixel 55 mA."
  ],
  "artifacts": [
    {
      "type": "datasheet",
      "url": "https://cdn-shop.adafruit.com/datasheets/WS2812B.pdf"
    },
    {
      "type": "documentation",
      "url": "https://www.adafruit.com/product/1612"
    },
    {
      "type": "documentation",
      "url": "https://learn.adafruit.com/adafruit-neopixel-uberguide/the-magic-of-neopixels"
    }
  ]
}