Design overview
Key specifications and signal flow at a glance
Block diagram
Each channel uses a series resistor, a bridge rectifier for polarity tolerance and an optocoupler. The MCU reads the isolated logic side through a shift register or direct GPIO.
Bill of materials
Select the lines you need and send them to RFQ in one click
Tick the lines you need, then copy the list, download a CSV, or open the RFQ form. Part numbers are common catalogue items; equivalents are acceptable.
| # | Function | Suggested part | Key spec | Qty | |
|---|---|---|---|---|---|
| 1 | Input resistor | CRCW12064K70FKEA | 4.7 kOhm, 1%, 1206 | 8 | |
| 2 | Bridge rectifier | MB10S | 0.5 A, 400 V, MBS | 8 | |
| 3 | Optocoupler | PC817C | 5 kV, CTR 80-160%, DIP-4 | 8 | |
| 4 | MCU | STM32G031K8T6 | Cortex-M0+, 64 KB flash, 32-pin | 1 | |
| 5 | Shift register | 74HC165D | 8-bit parallel in, serial out, SOIC-16 | 1 | |
| 6 | 3.3 V LDO | AMS1117-3.3 | 800 mA, SOT-223 | 1 | |
| 7 | Channel LED | LTST-C170KGKT | Green, 0805 | 8 | |
| 8 | Decoupling cap | GRM155R71C104KA88D | 100 nF, X7R, 25 V, 0402 | 8 | |
| 9 | Bulk cap | GRM21BR61A106KE19L | 10 uF, X5R, 10 V, 0805 | 2 | |
| 10 | LED series resistor | CRCW04024K70FKED | 4.7 kOhm, 1%, 0402 | 8 |
Design notes
Engineering choices and common pitfalls
Input current and threshold
A 24 V input with a 4.7 kOhm series resistor draws about 5 mA. Industrial standards typically define a logic high above 15 V and a low below 5 V. Choose the resistor and optocoupler CTR together so the low threshold stays safely above noise.
Polarity tolerance
A small bridge rectifier on each input lets the module accept either polarity, which reduces wiring errors on site. The voltage drop across the bridge is small compared with 24 V but must be included in threshold calculations.
Debounce and filtering
Mechanical contacts bounce for milliseconds. Combine an RC filter at the optocoupler output with a 1 ms firmware debounce. Sampling faster than the filter time constant only adds noise.
Channel expansion
Eight inputs fit one MCU. For more channels, cascade 74HC165 shift registers and read them over a single SPI-like bus. Keep the isolated and logic grounds separate all the way to the regulator.
Frequently asked questions
What is a sinking digital input module?
A module where the field contact connects the input to 0 V and the module supplies the current from a 24 V source. It is the most common industrial PLC input type.
Why use optocouplers in PLC inputs?
They isolate the field wiring from the logic side, protecting the controller from voltage spikes and ground loops common in factory environments.
How do I set the input debounce time?
Use an RC filter of roughly 0.1-1 ms at the optocoupler output and a matching firmware filter. Mechanical contacts usually settle within 5 ms.