Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KC868-A6 - how to connect an optocoupler
#10
I've asked Claude Code and received an answer. I don't understand the ESP32 and ESPHome much enough to confirm that it can work or it just AI halucination Undecided
Can someone take a look on this?
### ESPHome Configuration


Configuration - the `inverted: true` setting handles the active-low logic:


```yaml
binary_sensor:
  - platform: gpio
    name: "External Optocoupler 1"
    pin:
      pcf8574: pcf8574_hub_in
      number: 0  # IN1
      mode: INPUT
      inverted: true  # Required for active-low!
    filters:
      - delayed_on: 10ms
      - delayed_off: 10ms
```### ESPHome Configuration


### Wiring External Optocoupler


#### Complete Wiring Diagram


```
External Device          Optocoupler          KC868-A6
───────────────        ────────────          ─────────


High Voltage  ──────► LED+ (Anode)
Signal                  LED- (Cathode) ─────► External GND
                       
                        [═══ Isolation Gap ═══]
                       
                        Collector ──────────► 3.3V VCC
                        Emitter ────────────► IN1 (Digital Input)
                       
                                              GND (common reference)
```


#### Physical Connections


```
KC868-A6 Terminal Block:
┌──────┬──────┬──────┬──────┐
│ 3.3V │ GND  │ IN1  │ IN2  │
└──────┴──────┴──────┴──────┘
  │      │      │
  │      │      └──────────────► Connect to Optocoupler Emitter
  │      └─────────────────────► Common reference
  └────────────────────────────► Connect to Optocoupler Collector
```### Wiring External Optocoupler


#### Complete Wiring Diagram


```
External Device          Optocoupler          KC868-A6
───────────────        ────────────          ─────────


High Voltage  ──────► LED+ (Anode)
Signal                  LED- (Cathode) ─────► External GND
                       
                        [═══ Isolation Gap ═══]
                       
                        Collector ──────────► 3.3V VCC
                        Emitter ────────────► IN1 (Digital Input)
                       
                                              GND (common reference)
```


#### Physical Connections


```
KC868-A6 Terminal Block:
┌──────┬──────┬──────┬──────┐
│ 3.3V │ GND  │ IN1  │ IN2  │
└──────┴──────┴──────┴──────┘
  │      │      │
  │      │      └──────────────► Connect to Optocoupler Emitter
  │      └─────────────────────► Common reference
  └────────────────────────────► Connect to Optocoupler Collector
```
Reply


Messages In This Thread
RE: KC868-A6 - how to connect an optocoupler - by itpraktyk - 01-12-2026, 06:40 PM

Forum Jump:


Users browsing this thread:
1 Guest(s)