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
U3
R35
Resistance
5.36kΩ
R2
Resistance
30kΩ
R5
Resistance
10kΩ
R3
Resistance
10kΩ
R34
Resistance
10kΩ
R21
Resistance
2.2kΩ
R31
Resistance
143kΩ
R30
Resistance
100kΩ
R25
Resistance
10kΩ
R33
Resistance
274kΩ
R24
Resistance
100kΩ
R4
Resistance
165Ω
R22
Resistance
100kΩ
R1
Resistance
1kΩ
R29
Resistance
100kΩ
R32
Resistance
10kΩ
R23
Resistance
100kΩ
R36
Resistance
20kΩ
U6 SIG_B_OUT/IN - U2 AIN1
R36 P1 - U1 IMON
R21 P1 - IC1 CATHODE
U1 ~{FLT} - J10 15
U2 ~{RDY} - J9 NJTRST
U4 ~OE - R23 P2
R21 P1 - IC1 CATHODE
R36 P1 - U1 IMON
U10 EN - C19 P1
U6 SIG_C_OUT/IN - R5 P1
R2 P2 - R3 P1
Y1 P1 - U2 XTAL1
U2 SCLK - J9 JTCK
U10 VOUT - C20 P1
U2 ~{RESET} - R24 P2
U3 OUTPUT_A - R25 P2
R33 P2 - R34 P1
U4 QC - U6 CONTROL_C
U10 VOUT - C20 P1
U4 ~SRCLR - R22 P2
J10 02 - U10 VIN
U4 QD - U6 CONTROL_D
R35 P1 - U1 ILIM
U4 ~SRCLR - R22 P2
U1 OUT - C22 P1
C26 P1 - U1 dVdT
U6 SIG_B_OUT/IN - U2 AIN1
U1 IN - C27 P1
U10 VOUT - C20 P1
U2 DIN - J9 JTDI
U10 VOUT - C20 P1
Y1 P2 - U2 XTAL2
U6 SIG_B_OUT/IN - U2 AIN1
U4 RCLK - J10 09
U1 OUT - C22 P1
R2 P2 - R3 P1
U10 VOUT - C20 P1
U10 VOUT - C20 P1
Y1 P2 - U2 XTAL2
U10 VOUT - C20 P1
U10 VOUT - C20 P1
U2 SCLK - J9 JTCK
U2 SCLK - J9 JTCK
U2 DIN - J9 JTDI
U2 ~{CS} - J9 JTMS
U1 IN - C27 P1
R33 P2 - R34 P1
R1 P2 - R2 P1
U2 DOUT - J9 JTDO
U4 QD - U6 CONTROL_D
U2 DOUT - J9 JTDO
U4 ~SRCLR - R22 P2
Y1 P1 - U2 XTAL1
R31 P2 - R32 P1
Y1 P2 - U2 XTAL2
U10 VOUT - C20 P1
U2 DIN - J9 JTDI
R33 P2 - R34 P1
R1 P2 - R2 P1
R1 P2 - R2 P1
R1 P2 - R2 P1
U10 EN - C19 P1
U10 VOUT - C20 P1
U2 ~{RESET} - R24 P2
R31 P2 - R32 P1
U2 DOUT - J9 JTDO
U11 OUTPUT_A - R27 P2
J1 1 - R1 P1
R29 P2 - R30 P1
U6 SIG_D_OUT/IN - U3 INPUTS_A_1
U1 IN - C27 P1
U2 ~{RDY} - J9 NJTRST
R31 P1 - U1 IN
R2 P2 - R3 P1
U2 ~{RESET} - R24 P2
C26 P1 - U1 dVdT
J10 02 - U10 VIN
U10 VOUT - C20 P1
J1 1 - R1 P1
U10 VOUT - C20 P1
R31 P2 - R32 P1
U4 QB - U6 CONTROL_B
U11 OUTPUT_B - J10 15
U10 VOUT - C20 P1
R31 P1 - U1 IN
U3 OUTPUT_A - R25 P2
R29 P2 - R30 P1
U10 VOUT - C20 P1
U10 VOUT - C20 P1
U2 SCLK - J9 JTCK
U4 ~OE - R23 P2
U1 IN - C27 P1
R21 P1 - IC1 CATHODE
U4 ~OE - R23 P2
U10 VOUT - C20 P1
U10 VOUT - C20 P1
J1 1 - R1 P1
U4 RCLK - J10 09
U10 VOUT - C20 P1
U2 ~{CS} - J9 JTMS
U10 VOUT - C20 P1
U10 VOUT - C20 P1
U6 SIG_C_OUT/IN - R5 P1
R29 P2 - R30 P1
R1 P2 - R2 P1
U3 OUTPUT_A - R25 P2
U4 QA - U6 CONTROL_A
R35 P1 - U1 ILIM
U2 ~{RDY} - J9 NJTRST
U4 QA - U6 CONTROL_A
U10 VOUT - C20 P1
U10 VOUT - C20 P1
U10 VOUT - C20 P1
U4 QB - U6 CONTROL_B
J10 02 - U10 VIN
R21 P1 - IC1 CATHODE
Y1 P1 - U2 XTAL1
U2 DIN - J9 JTDI
U4 QC - U6 CONTROL_C
U6 SIG_D_OUT/IN - U3 INPUTS_A_1
U2 ~{CS} - J9 JTMS
J1 2 - J2 2
J9
C1 P2 - C2 P2
GND
IC1
C22
Capacitance
47µF
C20
Capacitance
10uF
C18
Capacitance
100nF
C10 P2 - C11 P2
U1 MODE - IC1 ANODE
GND
C27
Capacitance
1µF
J1 2 - J2 2
C24
Capacitance
12pF
GND
R32 P2 - C27 P2
C10
Capacitance
100nF
U2 AIN5 - U2 AIN6
U2 AIN8 - U2 REFIN2(+)/AIN9
U2 AIN5 - U2 AIN6
C19
Capacitance
10uF
R34 P2 - R35 P2
C7
Capacitance
100nF
GND
GND
R34 P2 - R35 P2
C1 P2 - C2 P2
C1 P2 - C2 P2
R34 P2 - R35 P2
C3
Capacitance
100nF
U3 INPUTS_B_1 - U3 INPUTS_B_2
R32 P2 - C27 P2
J1 2 - J2 2
U1 MODE - IC1 ANODE
GND
C2
Capacitance
100nF
GND
U2 AIN5 - U2 AIN6
C6
Capacitance
100nF
C1 P2 - C2 P2
C1 P2 - C2 P2
C23 P2 - C24 P2
GND
GND
C1 P2 - C2 P2
U1 MODE - IC1 ANODE
GND
GND
GND
GND
C14 P2 - C15 P2
C8
Capacitance
100nF
C1 P2 - C2 P2
GND
U2 AIN8 - U2 REFIN2(+)/AIN9
U11 GND - C25 P2
C4
Capacitance
100nF
C9
Capacitance
100nF
GND
R34 P2 - R35 P2
C1 P2 - C2 P2
C23
Capacitance
12pF
J1 2 - J2 2
GND
GND
C23 P2 - C24 P2
U3 INPUTS_B_1 - U3 INPUTS_B_2
C1
Capacitance
100nF
C21
Capacitance
100nF
GND
C26
Capacitance
12nF
J1
J10
U4
Y1
U1
H2
H3
H4
H1
U2
U10
U6
D1

Refine this doc
Ask about this doc
Implementation Notes
Rails and grounding
  • FIELD_24V_IN enters through J10 pin 16 and U1 LM76202 input pins.
  • FIELD_24V_PROT is U1 output with C22 bulk capacitance.
  • 5V_IN is supplied on J10 pin 2 and powers U5 LM2902 plus U10 input.
  • U10 AP2204K-3.3TRG1 creates 3V3 for AD7708, HC595, CD4066 controls, comparators, and pull-ups.
  • GND is the common reference for field return, analog/digital ground, and output return in this first implementation.
ADC/reference/clock
  • U2 AD7708 uses 3V3 on AVDD and DVDD.
  • IC1 LM4040 2.5V shunt reference drives REFIN1+ through net 2V5_REF; REFIN1- returns to GND.
  • Y1 32.768 kHz crystal is connected between XTAL1 and XTAL2 with 12 pF load capacitors C23/C24.
  • SPI mapping: SCLK=J9 JTCK/J10-04, MOSI=J9 JTDI/J10-05, MISO=J9 JTDO/J10-06, ADC_CS_N=J9 JTMS/J10-07, ADC_RDY_N=J9 NJTRST/J10-08, ADC_RESET_N=J9 RESET.
HC595 bit mapping
  • QA = CTRL_VOLTAGE_MODE, closes CD4066 switch A on all UI channels to route 0-10V divider nodes to ADC.
  • QB = CTRL_CURRENT_MODE, closes switch B on all UI channels to route shunt/protected nodes to ADC.
  • QC = CTRL_RESISTANCE_MODE, closes switch C on all UI channels to enable 3V3 excitation through the 10k pull-up resistor.
  • QD = CTRL_DIGITAL_MODE, closes switch D on all UI channels to route protected input to LM2903 comparator inputs.
  • QE/QF/QG/QH drive UO1/UO2/UO3/UO4 LM2902 unity-gain buffered outputs respectively.
UI channel pattern
Each UI channel uses connector positive input -> 1k series resistor -> protected node. A TVS clamps the field side to GND. The protected node feeds a 30k/10k divider, 165 ohm current shunt path, 10k excitation pull-up path, and digital comparator path selected through the channel's CD4066.
UO channel pattern
Each UO is currently implemented as an HC595-controlled 0/3.3V command buffered through one LM2902 section to its output terminal. This satisfies software-configurable digital/low-voltage analog-style buffered output at schematic level; true calibrated 0-10V or 0-20mA output would require a DAC/PWM-filter and output scaling/current driver additions.
Follow-up risk items
  • U1 LM76202 datasheet metadata is still missing, so UVLO/OVP/ILIM/dVdT settings were left explicitly unimplemented and should be completed from the datasheet.
  • A buck/pre-regulator may be needed if 3V3/5V must be generated directly from 24V field power rather than externally provided 5V_IN.
  • The CD4066 is powered from 3V3, so analog signal levels through enabled switches must stay within its supply rails; high-voltage UI modes rely on divider/shunt conditioning before ADC selection.
  • Rails and grounding

  • ADC/reference/clock

  • HC595 bit mapping

  • UI channel pattern

  • UO channel pattern

  • Follow-up risk items

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