RP2040 Industrial I/O Board

Continuing my work at Harsch Systems, I designed two generations of an RP2040 industrial I/O board in KiCad, with 0–10 V and 4–20 mA input and output, along with optical isolation.

When
2021
Status
Completed
Role
Engineering Intern, Harsch Systems
  • KiCad
  • PCB design
  • Surface-mount design
  • Analog circuits
  • RP2040
KiCad 3D render of the surface-mount RP2040 board, with the RP2040 chip at the center surrounded by passives, op-amps and connectors
Version 2 of this design, the surface-mount board: the bare RP2040 (center) surrounded by the analog and digital I/O circuits.

Overview

In my first project at Harsch Systems, I had worked on device drivers to meet strict timing constraints for industrial applications. Next, my boss wanted to see if we could build our own architecture to cut costs and improve our system control.

In this project, I designed a board around the Raspberry Pi RP2040 microcontroller. The industrial systems we were looking at commonly worked with 0–10 V and 4–20 mA signals, none of which a 3.3 V microcontroller can handle directly. This board enables that control for the digital processor. I designed it twice: first as a through-hole carrier for a Raspberry Pi Pico module, then as a compact surface-mount board built around the bare RP2040 chip.

Circuit Design

First, I had to learn a little more about circuit design. My boss had an additional requirement that he wanted optically isolated inputs (using PC817 optocouplers), and built-in filters for analog control. Before doing any design, I prototyped the following subsystems:

  1. Analog outputs: the Pico’s PWM outputs were smoothed by active low-pass filters and scaled by LM324 op-amp stages into a 0–10 V output or a 4–20 mA current output.
  2. Analog inputs: a voltage divider, voltage follower and low-pass filter took 0–10 V signals down to the ADC’s 3.3 V range. A stage to convert the 4–20 mA input to a voltage was designed as well.
  3. Digital I/O: inputs and outputs were optically isolated with PC817 optocouplers, with BC337 transistor drivers on the outputs and status LEDs on every channel.
  4. Power: the board ran from a separate 24 V supply.

PCB Version 1

Once I had these working on a breadboard, I moved into the PCB design portion of the project. This involved taking the exact same subsystems from before and integrating them with the Pico into one larger PCB structure.

KiCad 3D render of the first, through-hole version of the board, with pads for a Raspberry Pi Pico
Version 1: a through-hole carrier board for a Raspberry Pi Pico module.
Full KiCad schematic of the version 1 board
The version 1 schematic: the Pico in the center, with the analog and digital I/O subsystems around it. Click to enlarge.

PCB Version 2

The second version dropped the whole Pico module and put the RP2040 chip directly on the board. This meant designing the support circuitry the Pico normally provides, such as QSPI flash, a crystal for the clock, a TPS56339 switching regulator for power, USB for programming, and I2C connectors for auxiliary sensors.

The final designed board is shown below. Moving to surface-mount parts made it far more compact.

KiCad PCB layout of the surface-mount board, showing dense routing fanning out from the RP2040 at the center, wide power traces on the right and connectors along the edges The final version layout in KiCad. Signal traces fan out from the RP2040 at the center, the wide traces on the right carry power from the 24 V input, and the analog and digital I/O circuits line the connectors along the edges. Click to enlarge.

I was unable to test the final board before I left, but I gave my boss good documentation and all the associated files to enable a prototype to be built in the future. This was the first time I designed a PCB, and I’m super grateful for the support I received and the work I could accomplish.