Universal I/O Controller Design

Create a complete new schematic and PCB-ready design for a single-channel Universal I/O controller based on an ATmega328 microcontroller.
Core requirement: Design a new circuit from scratch. Do not reuse or include LM76202QPWPRQ1, AD7708, HC595, CD4066, LM2902, or other external switching/ADC/control ICs unless absolutely required and explicitly approved. The ATmega328 should directly measure and control the universal I/O as much as practical.
Universal Input requirements: The same field input connector must support software-configurable modes:
  1. Digital input
  2. Analog voltage input
  3. 0–10 V input
  4. 0–20 mA input
  5. Resistance measurement
  6. RTD measurement: PT1000 and NI1000
  7. Thermistor measurement: 10k Type II and 10k Type III
Universal Output requirements: Provide a software-configurable universal output from the ATmega328. Include at minimum:
  1. Digital output
  2. PWM-based analog voltage output using filtering/buffering if needed
  3. Clearly document whether true 0–10 V output or 0–20 mA output is supported directly, requires extra circuitry, or is out of scope for the first revision.
Architecture constraints:
  • Use ATmega328 ADC pins directly for measurements.
  • Avoid HC595 shift registers.
  • Avoid CD4066 analog switches.
  • Avoid LM76202 protection IC.
  • Avoid AD7708 external ADC.
  • Prefer simple discrete protection, resistor dividers, shunt resistors, RC filters, jumpers or low-cost analog selection methods if needed.
  • Use clear ALL_CAPS net names.
  • Design for a 24 V industrial field environment where possible, but keep MCU pins protected within safe voltage/current limits.
Expected schematic blocks:
  1. Power input and regulation for ATmega328 logic rail.
  2. ATmega328 core: power pins, reset, clock option, ISP/programming header, decoupling.
  3. Universal input field connector with protection.
  4. 0–10 V divider path into ADC.
  5. 0–20 mA shunt path into ADC.
  6. Resistance/RTD/thermistor divider or excitation path into ADC.
  7. Digital input threshold/protection path into an ATmega328 GPIO.
  8. Universal output connector with digital/PWM output conditioning.
  9. Optional test points and calibration notes.
Implementation expectations:
  • Select suitable components from the Flux library.
  • Add all required resistors, capacitors, connectors, protection parts, regulator, and ATmega328 support parts.
  • Wire the complete schematic.
  • Add Role and Role Details properties to important parts.
  • Run ERC and fix schematic errors.
  • Create a project document explaining the circuit architecture, mode configuration table, ATmega328 pin mapping, ADC scaling equations, firmware configuration notes, and limitations.
  • After schematic validation, set up a reasonable PCB board size and stackup, place components by functional block, and prepare for routing.
Important design notes:
  • Because the ATmega328 has limited ADC resolution and input range, include scaling and protection so all field signals are reduced to the MCU ADC range.
  • Firmware must select the measurement mode and apply calibration/scaling formulas.
  • If fully software-selectable mode switching cannot be achieved without extra analog-switch ICs, propose a simple alternative such as jumpers, resistor option links, MOSFET/discrete switching, or separate input terminals, and document the tradeoff before implementation.
I couldn’t start a new execution plan because a previous execution is currently stopping; once it finishes, I can generate and start the plan for this ATmega328-based Universal I/O redesign.
Use jumper modes
Schematic first
Separate terminals
ATmega328P 5V
Document architecture

Refine this doc
Ask about this doc
Universal I/O Architecture
1. Purpose and Scope
This project implements a scalable Universal I/O Controller with four software-configurable universal input channels (UI1–UI4) and four software-controlled universal output channels (UO1–UO4).
The design is intended to support field inputs that may be configured in software as:
  • Digital input
  • Analog low-voltage input
  • 0–10 V input
  • 0–20 mA input
  • Resistance measurement
  • RTD measurement, including PT1000 and NI1000-class sensors
  • Thermistor measurement, including 10k Type II and 10k Type III sensors
The output side provides four buffered software-controlled outputs using the LM2902 stage. The present schematic implements a first-pass scalable architecture; final production behavior depends on firmware, calibration, routing completion, and validation.
2. Implemented Channel Count

Table


FunctionImplemented ChannelsExternal ConnectorsMain Nets
Universal Inputs4J1–J4UI1_FIELD–UI4_FIELD, UI1_ADC–UI4_ADC, UI1_DIG_OUT–UI4_DIG_OUT
Universal Outputs4J5–J8UO1_OUT–UO4_OUT
Control / Host Interface1 expanded headerJ10, plus J9 legacy/programming headerSPI_SCLK, SPI_MOSI, SPI_MISO, ADC_CS_N, ADC_RDY_N, HC595_LATCH
Field Power Input1J10 pin 16 / FIELD_24V_INFIELD_24V_IN, FIELD_24V_PROT
3. Main Functional Blocks
3.1 Field Power Protection and Supervision
Primary component: U1 LM76202QPWPRQ1
U1 protects and supervises the incoming field supply. The intended field supply rail is named FIELD_24V_IN, and the protected downstream field rail is FIELD_24V_PROT.
Implemented support/settings:

Table


FunctionComponents / NetsNotes
Input field railFIELD_24V_INFeeds U1 IN pins and configuration dividers
Protected field railFIELD_24V_PROTU1 OUT rail with C22 bulk capacitance
UVLO settingR31, R32, LM76202_UVLO_SETApproximate configured undervoltage threshold network
OVP settingR33, R34, LM76202_OVP_SETApproximate configured overvoltage threshold network
Current limitR35, LM76202_ILIM_SETSets U1 current-limit behavior
Current monitorR36, LM76202_IMONProvides monitor load/path
dV/dT controlC26, LM76202_DVDTControls output slew behavior
Fault outputFIELD_FLT_N / UI4_DIG_OUT header conflict noteU1 fault indication was initially brought to J10 pin 15; this pin is now also used for UI4_DIG_OUT and should be reviewed before production
3.2 Logic and Analog Power Rails

Table


RailSource / UseNotes
5V_INJ10 / external logic supplyFeeds U10 input and U5 LM2902 supply
3V3U10 AP2204K-3.3TRG1Feeds AD7708 logic/analog supply, HC595, CD4066 switches, comparators, references, and pullups
2V5_REFIC1 LM4040AIZ-2.5/NOPBReference input for AD7708 REFIN1(+)
GNDCommon returnCurrent schematic uses common GND for analog, digital, and field return; future revision may split AGND/DGND/field return if needed
Decoupling capacitors are assigned across IC power pins and rail entry points. Bulk capacitance is present on 5V_IN, 3V3, and FIELD_24V_PROT.
3.3 ADC and Measurement Core
Primary component: U2 AD7708BRUZ
U2 digitizes the selected universal input measurement nodes.

Table


ADC FunctionImplemented Nets / Components
Analog channelsUI1_ADC, UI2_ADC, UI3_ADC, UI4_ADC into AIN1–AIN4
Reference2V5_REF into REFIN1(+), GND into REFIN1(-)
ClockY1 32.768 kHz crystal with C23/C24 load capacitors on ADC_XTAL1 / ADC_XTAL2
SPI interfaceSPI_SCLK, SPI_MOSI, SPI_MISO, ADC_CS_N
Data readyADC_RDY_N
ResetADC_RESET_N
Each UI ADC net includes a local filter capacitor path to GND.
3.4 Universal Input Front Ends
Each input channel has the same scalable structure:

Text


Field terminal → TVS/protection → 1k series resistor → protected node
                                      ├─ 0–10 V divider path
                                      ├─ 0–20 mA shunt path
                                      ├─ resistance / RTD / thermistor excitation path
                                      └─ digital comparator sense path
Per-channel component mapping:

Table


ChannelConnectorTVSSeries R0–10 V Divider0–20 mA ShuntExcitation RSwitch ICADC NetDigital SenseDigital Output
UI1J1D1R1 1kR2 30k / R3 10kR4 165ΩR5 10kU6UI1_ADCUI1_DIG_SENSEUI1_DIG_OUT
UI2J2D2R6 1kR7 30k / R8 10kR9 165ΩR10 10kU7UI2_ADCUI2_DIG_SENSEUI2_DIG_OUT
UI3J3D3R11 1kR12 30k / R13 10kR14 165ΩR15 10kU8UI3_ADCUI3_DIG_SENSEUI3_DIG_OUT
UI4J4D4R16 1kR17 30k / R18 10kR19 165ΩR20 10kU9UI4_ADCUI4_DIG_SENSEUI4_DIG_OUT
Supported Input Modes

Table


ModeHardware PathFirmware Action
0–10 VSelect divider path with CTRL_VOLTAGE_MODEConvert ADC result using divider ratio and calibration coefficients
0–20 mASelect shunt path with CTRL_CURRENT_MODEConvert ADC voltage across 165Ω shunt to current
Resistance / RTD / ThermistorSelect excitation path with CTRL_RESISTANCE_MODEMeasure divider/sense voltage and apply resistance/temperature conversion table
Digital InputSelect digital sense path with CTRL_DIGITAL_MODERead comparator output UIx_DIG_OUT
Analog InputUse ADC path appropriate to source rangeFirmware must choose direct/scaled path according to allowed voltage range
4. Comparator-Based Digital Inputs
Primary components: U3 and U11 LM2903DR2G
The four digital input paths are thresholded through two dual comparators:

Table


ChannelComparatorInput NetOutput NetPullup
UI1U3AUI1_DIG_SENSEUI1_DIG_OUTR25 to 3V3
UI2U3BUI2_DIG_SENSEUI2_DIG_OUTR26 to 3V3
UI3U11AUI3_DIG_SENSEUI3_DIG_OUTR27 to 3V3
UI4U11BUI4_DIG_SENSEUI4_DIG_OUTR28 to 3V3
The shared threshold reference is DIG_THRESHOLD, generated by R29/R30. This sets a fixed switching threshold for all digital input channels. If multiple digital standards must be supported, this should be made configurable in a future revision.
5. Software Configuration and HC595 Mapping
Primary component: U4 74HC595PW,118
U4 expands host control signals into mode-control outputs for the CD4066 analog switch matrix and output command lines.

Table


HC595 OutputNetFunction
QACTRL_VOLTAGE_MODEEnables 0–10 V divider path on all UI channels
QBCTRL_CURRENT_MODEEnables 0–20 mA shunt path on all UI channels
QCCTRL_RESISTANCE_MODEEnables excitation path for resistance/RTD/thermistor modes
QDCTRL_DIGITAL_MODEEnables digital comparator sense path
QEUO1_CMDSoftware command/control for UO1 buffer
QFUO2_CMDSoftware command/control for UO2 buffer
QGUO3_CMDSoftware command/control for UO3 buffer
QHUO4_CMDSoftware command/control for UO4 buffer
Important limitation: the current mode-control nets are global, so all four UI channels share the same mode at the same time. If independent per-channel input-mode selection is required, the design needs additional shift-register bits, multiplexing, or per-channel switch-control expansion.
6. Universal Output Architecture
Primary component: U5 LM2902KDR
U5 implements four unity-gain buffered output channels:

Table


OutputCommand NetOp-Amp StageExternal ConnectorOutput Net
UO1UO1_CMDU5 channel 1J5UO1_OUT
UO2UO2_CMDU5 channel 2J6UO2_OUT
UO3UO3_CMDU5 channel 3J7UO3_OUT
UO4UO4_CMDU5 channel 4J8UO4_OUT
The outputs are presently controlled from HC595 logic-level outputs and buffered by the LM2902. This supports simple software-controlled voltage/digital-style outputs, but it does not yet implement a precision DAC, calibrated analog voltage output, or 0–20 mA current-loop output. If true analog-output accuracy is required, add a DAC or PWM low-pass stage with calibration and output protection.
7. Host / Control Interface
The design includes J10 as the expanded host/control header and J9 as a legacy/programming-style 1×6 header.
Key nets available to the host:

Table


NetPurpose
5V_INExternal 5 V input for local 3V3 regulator and LM2902 supply
3V3Local regulated logic rail output/reference
SPI_SCLKAD7708 SCLK and HC595 shift clock
SPI_MOSIAD7708 DIN and HC595 SER
SPI_MISOAD7708 DOUT
ADC_CS_NAD7708 chip select
ADC_RDY_NAD7708 data-ready output
HC595_LATCHHC595 storage-register latch
HC595_SRCLR_NHC595 shift-register clear
HC595_OE_NHC595 output enable
UI1_DIG_OUT–UI4_DIG_OUTComparator-backed digital input outputs
FIELD_24V_INField power input
8. PCB and Validation Status
Current layout status:
  • Board size: 100 mm × 160 mm rectangular board
  • Stackup: 4-layer board
  • Mounting holes: H1–H4 added
  • U1 overlapping-copper issue: previously addressed by reducing exposed-pad copper geometry
  • Current blocking layout issue: DRC still reports many airwires, meaning PCB routing is not complete
Current review status from latest checks:

Table


Check AreaStatus
Schematic components/netsImplemented at architecture level
ERC basicsPreviously reported clean in earlier validation passes
DRC overlapping copperU1 issue was specifically targeted and reported clean after correction
DRC airwiresStill failing; routing remains incomplete
Manufacturing exportsShould remain blocked until routing and final DRC are clean
9. Key Design Limitations / Follow-Up Items
  1. Independent per-channel mode selection is not yet implemented. The current HC595 mapping drives global mode-control nets shared by UI1–UI4.
  2. Universal outputs are first-pass buffered outputs, not precision analog/current outputs. Add a DAC/PWM filter/current-loop driver if calibrated output modes are required.
  3. Sensor excitation is simplified. PT1000, NI1000, and 10k thermistor support will require firmware calibration tables and may benefit from precision excitation/current-source circuitry.
  4. AGND/DGND separation is not implemented. The current design uses a common GND. For improved measurement accuracy, review grounding and ADC layout during routing.
  5. J10 pin 15 usage should be reviewed. FIELD_FLT_N and UI4_DIG_OUT have both been associated with this header position during implementation history; confirm the final intended signal assignment before release.
  6. Routing is incomplete. Manufacturing exports should not be generated until airwires and final DRC issues are resolved.
  1. Resolve all remaining airwires by completing PCB routing.
  2. Re-run DRC for airwires, overlapping copper, floating copper, clearance, and invalid-layer checks.
  3. Confirm J10 pinout and remove any conflicting signal assignments.
  4. Decide whether universal outputs need true analog voltage/current-loop operation; if yes, add DAC/PWM-filter/current-driver circuitry.
  5. Decide whether UI mode selection must be independent per channel; if yes, expand switch-control logic.
  6. After clean DRC/ERC, generate Gerber, BOM, pick-and-place, and netlist exports.

    1. Purpose and Scope

    2. Implemented Channel Count

    3. Main Functional Blocks

    3.1 Field Power Protection and Supervision

    3.2 Logic and Analog Power Rails

    3.3 ADC and Measurement Core

    3.4 Universal Input Front Ends

    4. Comparator-Based Digital Inputs

    5. Software Configuration and HC595 Mapping

    6. Universal Output Architecture

    7. Host / Control Interface

    8. PCB and Validation Status

    9. Key Design Limitations / Follow-Up Items

    10. Recommended Next Steps

Documents

    Universal I/O Architecture

    Implementation Notes

    Validation Status — Universal I/O Controller

    Remediation Execution Log

    Single Universal Input Architecture

    Single Universal Input Layout/Routing Status

    Circuit Explanation — Single Universal Input

Assets

No assets added.

Universal I/O Controller

Universal I/O Controller thumbnail
Single-channel Universal Input schematic with LM76202 field protection, AD7708 ADC measurement core, CD4066 mode switching, HC595 control mapping, and comparator-backed digital input support for DI, analog, 0-10 V, 0-20 mA, resistance, RTD, and thermistor modes.

Properties

Properties describe core aspects of the project.

Pricing & Availability

Distributor

Qty 1

Arrow

$4.72–$6.84

Digi-Key

$3.25–$5.02

HQonline

$1.58

LCSC

$3.62–$3.69

Mouser

$24.35

TME

$4.69

Verical

$6.18–$8.19

Controls