Skip to content

Digital Inputs

The XREG-010 has two different styles of digital input architectures, depending on the pin in question. They are all exposed in the Ethernet Connectors (see Data Cables & Pinout).

  1. Optocoupler Style: activated by a positive voltage input (rated 5–62 V applied to the input pin; every part stays inside its datasheet rating up to 78 V)
  2. Ground Style: activated by shorting the input pin to ground

The two styles serve different installation scenarios: opto-style inputs are right for signals coming from elsewhere in the boat's wiring (ignition, BMS contacts, mode-switch outputs), because the channel accepts anything from 5 to 62 V without a divider and the series resistor, LED drop, and reverse clamp keep that wire's transients away from the ESP32 pin. Ground-style inputs are right for local switches mounted near the regulator that close to Cable 4 pin 16, the switch return. They draw less current while active, have no LED to age, and are appropriate when the signal source is electrically local.

Optocoupler Channel Map (5 channels)

Function Opto IC Clamp Diode ESP32 GPIO
IGNITION (engine wake) U5 D19 GPIO1
HIGH/LOW (charging mode) U10 D25 GPIO39
BMSLogic (BMS enable) U16 D27 GPIO42
FORCEFLOAT (force float mode) U17 D28 GPIO40
EXTRA_OPTICAL_GPIO1 (spare) U26 D34 GPIO8

All five channels are identical optically and electrically; only the destination GPIO differs. The V9 schematic below shows one real channel (U26, the spare EXTRA_OPTICAL_GPIO1 input); substitute the relevant designators from the table above for any other channel.


Optocoupler Style Digital Inputs

Optocoupler channel schematic for U26, EXTRA_OPTICAL_GPIO1: R87 6.8k series resistor, D34 1N4148W reverse clamp, VO615A-9X017T, R60 10k pull-up to 3V3

The input side (left) takes the external 5–62 V signal through the 6.8 kΩ series resistor and back through the LED; the output side (right) is the phototransistor pulling the ESP32 GPIO low against the 10 kΩ pull-up to 3.3 V.

Design Requirements

  • Input voltage range: rated 5–62 V. Every part in the channel stays inside its datasheet rating past that: the 1 W series resistor is the first to reach its limit, at 78 V with the board at 82 °C (84 V at 70 °C), and at 62 V the LED carries 15 % of its 60 mA maximum. The rating covers the ignition, BMS, and switch wiring of 12, 24, 36, and 48 V systems, including a 48 V bank at about 58 V while charging. See the table below.
  • Temperature range: -40°F to 180°F (-40°C to 82°C), well inside the VO615A's -55 °C to +110 °C rating
  • LED aging: the VO615A datasheet publishes no aging or lifetime figures. What protects the channel from LED wear is collector-current margin, covered under LED Aging below.

How an Optocoupler Works

The VO615A carries the signal from the input circuit to the ESP32 GPIO as light rather than as a direct electrical path:

Input Side (LED)

  1. Input voltage applied across current limiting resistor and IR LED
  2. Forward current flows through LED, producing infrared light
  3. Light intensity proportional to forward current

Output (ESP32 GPIO) Side (Phototransistor)

  1. IR light strikes phototransistor base region
  2. Light creates electron-hole pairs, acting as base current
  3. Transistor turns on, allowing collector current to flow
  4. Collector current = LED current × CTR (Current Transfer Ratio)
  5. When sufficient collector current flows, voltage at collector drops low enough to register as logic LOW on ESP32
  6. Voltage otherwise pulled high (3.3V) by pull up resistor to 3.3V Supply

Protection and Range

  • Protection: a transient on the input wire drives LED current and returns through the LED loop. The only path onward to the GPIO node is optical, so the spike never reaches the pin
  • Range: rated 5–62 V with no divider; every part stays inside its datasheet rating up to 78 V

Component Selection

Optocoupler: VO615A-9X017T (LCSC C145478)

Decoding the part number against the datasheet's ordering-information table:

  • -9: CTR bin 9, 200–400 %, specified at IF = 5 mA, VCE = 5 V. (The unbinned base VO615A spans 50–600 % at the same test point.)
  • X017T: SMD-4, package option 7, from the VDE-approved block (the "1" = option 1, DIN EN 60747-5-5 / VDE 0884-5); T = tape and reel.
  • Agency approvals: UL 1577 / cUL, BSI, FIMKO, CQC, plus VDE with option 1.

Reason for the high-CTR bin: reliable switching at the 5 V low end, minimal extra cost.

CTR is specified at 5 mA, above the 5 V operating point

The 200–400 % bin is measured at IF = 5 mA. CTR falls off at lower LED current, so at the 5 V input level (IF ≈ 0.56 mA) the effective CTR is well below 200 %. The low-end analysis below therefore checks against the pull-up threshold current, not against the 200–400 % bin CTR.

Current Limiting Resistor: 6.8kΩ, 1W, 2512 SMD

  • Calculation basis (LED forward voltage ≈ 1.2 V at 0.5 to 10 mA, from the datasheet's forward-voltage curve; its 1.43 V table figure is at 50 mA):
  • At 5V: IF = (5V - 1.2V) / 6.8kΩ = 0.56 mA
  • At 28V: IF = (28V - 1.2V) / 6.8kΩ = 3.9 mA
  • At 62V: IF = (62V - 1.2V) / 6.8kΩ = 8.9 mA
  • Power rating: 1 W at 70 °C, derated linearly to zero at 155 °C (UNI-ROYAL 25121WJ0682T4E). It dissipates 0.11 W at 28 V and 0.54 W at 62 V, and reaches its rating at 84 V (70 °C) or 78 V (82 °C)

Pull-up Resistor: 10kΩ, 0603 SMD (R60 shown for the U26 channel)

  • Logic HIGH: When LED is OFF, phototransistor is OFF, collector pulled to 3.3V through 10kΩ
  • Logic LOW: When LED is ON, phototransistor conducts, pulling collector toward ground
  • Threshold current: the phototransistor must sink 3.3 V / 10 kΩ = 0.33 mA to pull the collector fully low
  • Switching threshold: the ESP32-S3 is guaranteed to read LOW below 0.25 × 3.3 V ≈ 0.83 V, which takes 0.25 mA of collector current through the 10 kΩ pull-up. A typical part switches near 1.65 V, about 0.17 mA

Performance Analysis

Input Voltage LED Current LED vs 60 mA max Resistor (vs 1 W) Power (Watts) Power (mA@12V)
5V 0.56 mA 0.9% 2 mW 2.8 mW 0.23 mA
12V 1.59 mA 2.6% 17 mW 19.1 mW 1.59 mA
28V 3.94 mA 6.6% 106 mW 110 mW 9.2 mA
44V (36 V system charging) 6.29 mA 10% 269 mW 277 mW 23.1 mA
58V (48 V system charging) 8.35 mA 14% 474 mW 485 mW 40.4 mA
62V 8.94 mA 15% 544 mW 554 mW 46.2 mA

Power consumption notes: - Power is consumed only when Input Signal is active (ie external switch is ON) - No power consumption when Input Signal = 0V (ie external switch OFF) - LED power = Forward current × 1.2V (LED forward voltage at these currents) - Resistor power = Forward current² × 6.8kΩ

Protection Diode: 1N4148W (SOD-123)

Function: Reverse Voltage Protection

The 1N4148W diode (SOD-123 package, LCSC C81598; the V9 BOM lists one per opto channel at D19, D25, D27, D28, and D34) provides critical protection for the optocoupler LED:

  • Normal operation: Diode is reverse biased across LED, no current flows
  • Reverse voltage protection: If Input Signal goes negative, diode conducts and clamps reverse voltage to ~0.7 to 0.9V
  • Prevents LED damage: VO615A LED can only handle 6V reverse voltage maximum

Why Critical

  • Load dump transients: Long wires / disconnection can create voltage spikes
  • Electrical noise: Marine electrical systems are electrically noisy environments

Specifications & Failure Limits

  • Forward voltage: 0.715V maximum at 1mA, 0.855V maximum at 10mA
  • Reverse voltage rating: 75V maximum
  • Forward current rating: 150mA average; non-repetitive surge 4A for 1µs, 1A for 1ms, 0.5A for 1s
  • Power dissipation: 400mW at 25°C

Failure Analysis

The diode will fail if: - Forward current > 150mA average: not reachable through the 6.8 kΩ series resistor, which holds a −62 V input to 9 mA - Reverse voltage > 75V: not reachable here. The diode is connected across the LED, so a positive Input Signal reverse-biases it by only the LED's ~1.2V forward drop - Power dissipation > 400mW: would take over 300mA, so the 150mA current limit is reached first

System Power Consumption

Condition LED Side ESP32 Side Total Power Total (mA@12V)
Input OFF 0 mW ~0 mW ~0 mW ~0 mA
Input ON (12V) 19.1 mW 1.09 mW 20.2 mW 1.7 mA
Input ON (58V) 485 mW 1.09 mW 486 mW 40.5 mA

The ESP32-side 1.09 mW is the 10 kΩ pull-up conducting to ground through the phototransistor (3.3 V² / 10 kΩ), and it flows only while the input is active. With the input off, the phototransistor is off and the collector node is high-impedance, so the pull-up sources nothing: an idle opto channel consumes zero power on both sides.

LED Aging

The VO615A datasheet publishes no LED aging or lifetime data, so there is no lifetime figure in years. LED light output falls slowly with operating hours, faster at higher current and temperature, and the channel keeps working as long as the phototransistor can still sink the 0.25 mA that guarantees a LOW at the ESP32. The table shows the collector current a minimum-bin part (200 % CTR at 5 mA) delivers, estimated with the datasheet's typical CTR-versus-current and CTR-versus-temperature curves, and that current divided by 0.25 mA:

Input LED current Collector current, 25 °C Collector current, 75 °C Margin at 75 °C
5 V 0.56 mA 0.46 mA 0.31 mA 1.2×
12 V 1.6 mA 2.0 mA 1.45 mA 5.9×
24 V 3.4 mA 5.4 mA 4.0 mA 16×

From 12 V up, the LED can lose most of its light output before the input stops reading. At 5 V, the level the panel switches on Cable 3 pin 2 run from, a minimum-bin part at 75 °C still sinks 1.2 times the current a guaranteed LOW needs, and a typical part sinks more. The LED carries 0.56 mA there. Vishay's general optocoupler life test ran the LED at 60 mA, about a hundred times that, and lost about 2 % of CTR over 100,000 hours at a 60 °C junction (Vishay document 80059, Fig. 4).

Design Validation

  • 5V switching: at 5 V the LED runs ≈ 0.56 mA. A minimum-bin part then sinks about 0.46 mA at 25 °C and 0.31 mA at 75 °C, both above the 0.25 mA a guaranteed LOW needs (see LED Aging)
  • High-voltage operation: at 62 V the LED runs 8.9 mA, 15 % of its 60 mA maximum, and the series resistor dissipates 0.54 W of its 1 W rating
  • Temperature performance: VO615A-9's high CTR covers -40°F to 180°F at every input from 5 to 62 V

Bill of Materials (Optocoupler Style, per channel)

Reference (per channel) Part Number Description Package LCSC
U5 / U10 / U16 / U17 / U26 VO615A-9X017T Optocoupler, CTR 200–400 % SMDIP-4 C145478
R67 / R74 / R75 / R76 / R87 (one per channel, same order as the channel map) 25121WJ0682T4E Current-limit resistor, 6.8 kΩ, 1 W 2512 C26073
R46 / R47 / R51 / R52 / R60 (one per channel, same order as the channel map) — Pull-up resistor, 10 kΩ, to 3V3 0603 C25804
D19 / D25 / D27 / D28 / D34 1N4148W Reverse-bias protection diode SOD-123 C81598

The 6.8 kΩ 2512 part is shared by the five opto LED-drive series resistors and the buzzer-circuit gate pull-up (R65). The output pull-ups (R60 shown for the U26 channel) come from the board-wide shared 10 kΩ pool.


Ground Style Digital Inputs

Schematic

3.3V ──[R57:10kΩ]──┬──[C51:1µF]──GND
                   │
                   ├──[D32: PESD5V0S1BA TVS]──GND
                   │
                   ├── Input Signal (RJ45 pin)
                   │
                   └──[R104:330Ω]── ESP32 GPIO41

The pull-up, debounce capacitor, and TVS all connect to the connector node; the 330 Ω series resistor is between that node and the ESP32 pin. Designators above are the FactoryReset channel; the four switch inputs are identical:

Function Cable 4 pin Pull-up Capacitor TVS Series resistor ESP32 GPIO
FactoryReset 9 R57 C51 D32 R104 GPIO41
WakeFromSleep 10 R82 C52 D38 R58 GPIO5
WifiReset 11 R83 C53 D39 R105 GPIO45
AP/ClientMode 12 R84 C59 D40 R56 GPIO46

The GPIO0 boot strap (Cable 3 pin 8: R43, C30, D4, R71) and the RESET line (Cable 4 pin 13: R33, C60, D35, R98 into the module's EN pin) use the same circuit.

Design Requirements

  • Input method: Short to ground activation
  • Temperature range: -40°F to 180°F (-40°C to 82°C)
  • Debouncing: Hardware RC filter for switch bounce elimination
  • Protection: series resistance and a PESD5V0S1BA TVS on each exposed input

How Ground Style Inputs Work

Normal Operation (Switch Open)

  1. Input Signal is not connected (floating or open)
  2. No current flows to Ground
  3. Pull-up resistor R57 (10kΩ) pulls GPIO pin to 3.3V
  4. ESP32 GPIO reads logic HIGH (3.3V)

Activated Operation (Switch Closed to Ground)

  1. Input Signal is shorted to ground by external switch/contact
  2. Current flows from 3.3V through R57 (10kΩ) to ground via the switch
  3. Junction voltage: V_out = 0V (direct connection to ground)
  4. ESP32 GPIO reads logic LOW (0V << 0.8V threshold)

Component Analysis

Pull-up Resistor: R57 (10kΩ)

  • Function: Pulls Output Signal HIGH when Input Signal is not grounded
  • Power when input open: ~0 mW. The switch is open and the GPIO input is high-impedance, so the pull-up has no current path
  • Power when input grounded: P = 3.3V²/10kΩ = 1.089 mW (continuous while held closed)

Debounce Capacitor: C51 (1µF)

  • Function: Filters switch bounce and electrical noise
  • Time constant: τ = R57 × C51 = 10kΩ × 1µF = 10ms
  • Settling time: ~3τ = 30ms for clean switching
  • Noise immunity: Filters high-frequency electrical noise

TVS: D32 (PESD5V0S1BA, SOD-323)

  • Function: bidirectional 5 V-standoff TVS from the connector node to ground; it clamps ESD and wiring transients before they reach the RC network and the ESP32
  • Rating: 5 V reverse standoff, 12 A peak pulse current (8/20 µs)

Series Resistor: R104 (330 Ω, 0402)

  • Function: is connected between the connector node and the ESP32 pin, limiting the current the pin's internal clamps have to carry during a transient; it is not in the switch path, so it does not affect the logic levels

Performance Analysis

Switching Characteristics

  • Rise time: Limited by RC time constant = 10ms
  • Fall time: Much faster, limited by the 330 Ω series resistor (R104) and ESP32 input capacitance
  • Debounce time: ~30ms eliminates typical switch bounce

Power Consumption

Condition Current Power Power (mA@12V)
Input Open ~0 mA ~0 mW ~0 mA
Input Grounded 0.33 mA 1.089 mW 0.09 mA

Power consumption notes: - Power flows only while the switch is held closed: an open input draws nothing (high-impedance GPIO leaves the pull-up with no current path) - Worst case (switch held closed continuously) is still only ~1.1 mW

Voltage Levels

  • Logic HIGH: 3.3V (input open/floating)
  • Logic LOW: 0 V (the switch shorts the connector node directly to ground; the 330 Ω series resistor is between that node and the GPIO, not in the switch path)
  • Switching threshold: the ESP32-S3 is guaranteed to read LOW below 0.25 × 3.3V ≈ 0.8V and HIGH above 0.75 × 3.3V ≈ 2.5V
  • Noise margin HIGH: 3.3V - 2.5V = 0.8V
  • Noise margin LOW: 0.8V - 0V = 0.8V

ESP32-S3 Internal ESD Protection and Real ESD Event Analysis

ESP32-S3 Internal Protection Specifications

From the ESP32-S3 datasheet: - Human Body Model (HBM) ESD tolerance: ±2000V - Charged Device Model (CDM) ESD tolerance: ±1000V
- Absolute maximum input voltage: 3.6V (VDD + 0.3V) - Internal protection: Snapback devices on all GPIO pins

What Happens During an ESD Event

Scenario: 8kV HBM discharge to Input Signal wire

  1. Initial ESD pulse: 8000V spike from a 100 pF source through ~1.5kΩ (HBM model)
  2. TVS (D32) and debounce capacitor (C51) absorb the discharge: the pulse arrives at the connector node, where D32 clamps the voltage and the 1 µF capacitor is 10,000 times the HBM source capacitance. 100 pF at 8 kV is 0.8 µC, which raises 1 µF by about 0.8 V
  3. Series resistor (R104): the 330 Ω between the connector node and the GPIO limits the current the pin has to carry
  4. ESP32 internal protection response:
  5. Internal snapback devices activate at ~7-10V
  6. Snapback devices clamp GPIO voltage to ~5-7V
  7. Current flows through internal protection to chip ground
  8. Current path: ESD energy → D32 clamps the connector node while C51 absorbs the charge → R104 → ESP32 internal snapback → chip ground
  9. Result: GPIO survives due to the TVS, the capacitor, the series resistor, and the internal clamps

Role of the ESP32's Internal Protection

The ESP32's internal ESD protection is designed to handle exactly this scenario. The internal snapback devices are specifically designed for ESD events where voltage exceeds normal operating range.

Espressif's official position (from ESP32 forum): "The ESP32 has internal snapback devices in order to handle ESD on all pins. The external ESD protector is simply a belts-and-braces approach to make sure someone doesn't accidentally zap through the internal protections."

Design Validation for ESD Protection

IEC 61000-4-2 Contact Discharge (typical requirement): - Test voltage: ±8kV - The figures above are analysis, not a compliance test result - Reasoning: the 1 µF capacitor takes the charge, the 330 Ω resistor limits the current, and the internal clamps handle the residual

Common ESD sources: - Human walking on carpet: 2-15kV - Handling in dry environment: 5-25kV

The 330 Ω value is small enough not to affect digital operation.

Design Validation

  • Noise immunity: 1µF capacitor filters electrical noise
  • ESD protection: a PESD5V0S1BA TVS and 1 µF at the connector node, plus a 330 Ω series resistor ahead of the ESP32's internal clamps
  • Current limiting: 330 Ω series resistor between the connector node and the GPIO
  • Low power: <1.1mW continuous power consumption
  • Switching margin: 0.8V of noise margin on both logic levels

Bill of Materials (Ground Style, per channel)

Reference (representative) Part Number Description Package Notes
R57 / R82 / R83 / R84 10 kΩ 0603 (LCSC C25804) Pull-up to 3V3 0603 Shared 10 kΩ pool across the board
C51 / C52 / C53 / C59 1 µF 0603 (LCSC C15849) RC debounce cap 0603 Shared 1 µF pool
R104 / R58 / R105 / R56 330 Ω 0402 (LCSC C25104) Series resistor between the connector node and the GPIO 0402 Shared 330 Ω pool
D32 / D38 / D39 / D40 PESD5V0S1BA (LCSC C19224) 5 V bidirectional TVS to GND SOD-323 One per input node

Comparison: Optocoupler vs Ground Style

Feature Optocoupler Style Ground Style
Input Range 5V to 62V rated (parts inside ratings to 78V) Ground short only
Power (Active) 0.2–46 mA @ 12V (5–62 V input) 0.09 mA @ 12V
Power (Inactive) ~0 mA ~0 mA
Component Count 4 components 4 components
Cost Higher (optocoupler) Lower (passive)
Complexity Medium Low
Noise Immunity Excellent Good
Applications 5–62 V signals from elsewhere on the boat Simple switches, low voltage