Skip to the content
2 layers99.9 × 99.9 mmPicoLC, the printed circuit board in 3D

A DIY Modbus Challenge Board

Size
99.9 × 99.9 mm
Copper layers
2
Thickness
1.6 mm
Parts
30
Nets
40
Pads
130
Tracks, vias
134, 0
Pours
2
Routed
Yes
KiCad
KiCad 9.0 (file 20241229)
Created
9 Apr 2026
Updated
9 Apr 2026

Overview

PicoLC is an open-source printed circuit board by kevthehermit, from the kevthehermit/PiLC-ModPwn repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 99.9 × 99.9 mm with 30 parts on 40 nets, routed with 134 tracks and 0 vias.

Its parts include 16 switches, 6 resistors, 6 diodes and 1 IC. It belongs with the RP2040 boards of this library.

README

README.md

PiLC ModPwn

OT Security Challenge Board

A MicroPython-based Operational Technology (OT) security training platform running on Raspberry Pi Pico 2W. Designed for hands-on learning of industrial control system protocols, specifically Modbus TCP.

Author

@kevthehermit

Hardware Requirements

  • Raspberry Pi Pico 2W
  • 128x64 I2C OLED Display (SSD1306)
  • 6 LEDs (Digital Outputs)
  • 6 Push Buttons (Digital Inputs)
  • 4 Navigation Buttons (UP, DOWN, SELECT, BACK)

Pin Mapping

ComponentGPIO Pins
LEDs (Q0.0 - Q0.5)8, 9, 10, 11, 12, 13
Input Buttons (Ix0.0 - Ix0.5)16, 17, 18, 19, 20, 21
NAV_UP22
NAV_DOWN26
NAV_SELECT27
NAV_BACK28
OLED SDA14
OLED SCL15

Features

  • WiFi Connectivity: Supports both Access Point (AP) and Station modes
  • Modbus TCP Server: Runs on port 502 for challenge interactions
  • OLED Display: Real-time feedback and menu navigation
  • Persistent Configuration: Settings saved to config.json
  • Multiple Security Challenges: Progressive difficulty levels

Installation

  1. Download the UF2 firmware from the latest GitHub Release, or build it yourself
  2. Hold the BOOTSEL button on the Pico, connect USB, then release BOOTSEL
  3. Copy the appropriate .uf2 file to the RPI-RP2 drive that appears
  4. The board will reboot automatically with the firmware and application installed

Available Firmware Images

FileTarget Board
pilc-modpwn-RPI_PICO2_W.uf2Raspberry Pi Pico 2W
pilc-modpwn-RPI_PICO_W.uf2Raspberry Pi Pico W
pilc-modpwn-W5500_EVB_PICO.uf2W5500-EVB-Pico

Running the Challenge Server

bash
cd server
pip install -r requirements.txt
python app.py

Open http://localhost:5000 to access the challenge web interface.

File Structure

text
PiLC-ModPwn/
├── .github/workflows/       # CI/CD pipelines
│   ├── build.yml            # Build and push server Docker image
│   └── build-firmware.yml   # Build UF2 firmware images
├── Hardware/                # Hardware design files
│   └── PicoLC/              # PCB/schematic files
├── build/                   # Firmware build scripts
│   ├── Dockerfile           # Docker build environment
│   ├── build.sh             # Native build script
│   ├── docker-build.sh      # Docker build script
│   └── manifest.py          # MicroPython frozen module manifest
├── src/                     # MicroPython source (frozen into firmware)
│   ├── main.py              # Application entry point
│   ├── hardware.py          # Hardware abstraction layer
│   ├── display.py           # OLED display manager
│   ├── menu.py              # Navigation menu system
│   ├── wifi_manager.py      # WiFi AP/Station manager
│   ├── config_manager.py    # Persistent configuration
│   ├── challenge_base.py    # Challenge framework
│   ├── config.json          # User configuration
│   ├── challenges/
│   │   ├── __init__.py
│   │   ├── challenge_discovery.py
│   │   ├── challenge_register.py

Building Firmware

UF2 firmware images are built automatically by GitHub Actions and attached to GitHub Releases when you push a version tag (e.g. git tag v1.0.0 && git push --tags). To build locally, use Docker or the native build script.

Docker Build (Recommended)

Docker provides a consistent build environment with all dependencies pre-configured.

bash
# Build the Docker image (first time only)
docker build -t pilc-builder ./build

# Build firmware for all boards
docker run --rm -v "$(pwd):/project" pilc-builder

The resulting .uf2 files will be placed in the build/ directory.

Native Build

Requires the ARM GCC toolchain, CMake 3.13+, Python 3, and Git installed on your system.

bash
cd build

# First-time setup: clones MicroPython and builds mpy-cross
./build.sh --setup

# Build firmware
./build.sh

# Clean build (removes build directory first)
./build.sh --clean

The native build script builds for RPI_PICO2_W by default. Edit the BOARD variable in build.sh to target a different board.

Configuration

Edit src/config.json to configure the board:

json
{
    "wifi_mode": "station",
    "wifi_ssid": "YourNetworkName",
    "wifi_password": "YourPassword",
    "ap_ssid": "PiLC-ModPwn",
    "ap_password": "modpwn123",
    "modbus_port": 502,
    "board_id": "AUTO"
}

WiFi Modes

  • station: Connect to an existing WiFi network
  • ap: Create an Access Point for direct connection

Navigation

Use the 4 navigation buttons to control the menu:

ButtonFunction
UPNavigate up / Scroll up
DOWNNavigate down / Scroll down
SELECTConfirm selection / Start challenge
BACKGo back / Cancel / Exit challenge

Challenges

Challenge 1: Discovery

Difficulty: 1/5 | Category: Reconnaissance

Learn to discover and enumerate Modbus devices. Find hidden registers and identify the device configuration.

Challenge 2: Register Manipulation

Difficulty: 2/5 | Category: Exploitation

Manipulate Modbus registers to achieve specific output states. Understand the relationship between holding registers and coils.

Challenge 3: Sequence

Difficulty: 2/5 | Category: Logic

Execute a specific sequence of Modbus operations in the correct order to unlock the flag.

Challenge 4: Fuzzing

Difficulty: 3/5 | Category: Analysis

Use fuzzing techniques to discover valid register ranges and hidden functionality.

Challenge 5: Replay

Difficulty: 3/5 | Category: Protocol

Capture and replay Modbus commands to replicate a specific LED pattern.

Challenge 6: Ladder Logic

Difficulty: 3/5 | Category: Ladder Logic

Follow a ladder logic diagram by setting physical inputs in the correct sequence.

Sequence:

  1. Input 1 ON (hold)
  2. Input 2 ON (hold)
  3. Inputs 1, 2, 4 ON simultaneously (hold)
  4. Toggle Input 3 five times

Note: Any input not specified must be OFF

Modbus Register Map

Coils (Function Codes 01, 05, 15)

AddressDescription
0LED 0 (Q0.0)
1LED 1 (Q0.1)
2LED 2 (Q0.2)
3LED 3 (Q0.3)
4LED 4 (Q0.4)
5LED 5 (Q0.5)

Discrete Inputs (Function Code 02)

AddressDescription
0Button 0 (Ix0.0)
1Button 1 (Ix0.1)
2Button 2 (Ix0.2)
3Button 3 (Ix0.3)
4Button 4 (Ix0.4)
5Button 5 (Ix0.5)

Holding Registers (Function Codes 03, 06, 16)

AddressDescription
0-5General purpose registers
100+Challenge-specific registers

Input Registers (Function Code 04)

AddressDescription
0-5Button states (mirrors discrete inputs)

Connecting to the Board

Using Python (pymodbus)

python
from pymodbus.client import ModbusTcpClient

# Connect to the board
client = ModbusTcpClient('192.168.x.x', port=502)
client.connect()

# Read coils (LEDs)
result = client.read_coils(0, 6)
print(f"LEDs: {result.bits[:6]}")

# Write single coil (turn on LED 0)
client.write_coil(0, True)

# Write multiple coils
client.write_coils(0, [True, False, True, False, True, False])

# Read discrete inputs (buttons)
result = client.read_discrete_inputs(0, 6)
print(f"Buttons: {result.bits[:6]}")

# Read holding registers
result = client.read_holding_registers(0, 6)
print(f"Registers: {result.registers}")

Using modbus-cli

bash
# Read coils
modbus read 192.168.x.x:502 0 6 -t coil

# Write coil
modbus write 192.168.x.x:502 0 1 -t coil

# Read discrete inputs
modbus read 192.168.x.x:502 0 6 -t discrete

# Read holding registers
modbus read 192.168.x.x:502 0 6 -t holding

# Write holding register
modbus write 192.168.x.x:502 0 1234 -t holding

Troubleshooting

EADDRINUSE Error

If you get "Address already in use" when switching challenges:

  • Wait a few seconds before starting the next challenge
  • Press BACK to properly exit the current challenge
  • Restart the board if the issue persists

WiFi Connection Issues

  • Verify SSID and password in config.json
  • Ensure the network is 2.4GHz (Pico W doesn't support 5GHz)
  • Try AP mode for direct connection

Display Not Working

  • Check I2C connections (SDA to GPIO 14, SCL to GPIO 15)
  • Verify display address is 0x3C
  • Check for loose connections

Web Application

Challenge details, hints, objectives, and flag verification are available through the companion web application. The board displays essential connection information (IP address and port) while the web app provides:

  • Detailed challenge descriptions
  • Step-by-step objectives
  • Hints and guidance
  • Flag submission and verification
  • Progress tracking

Contributing

Contributions welcome! Please submit issues and pull requests to the project repository.

Parts

30
QtyValueFootprintReferences
6220Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_HorizontalR1, R2, R3, R4, R5, R6
1IX0.0Button_Switch_THT:SW_PUSH_6mmSW1
1IX0.0slide_switch:SW_SS12D00GSW2
1IX0.1Button_Switch_THT:SW_PUSH_6mmSW3
1IX0.1slide_switch:SW_SS12D00GSW4
1IX0.2Button_Switch_THT:SW_PUSH_6mmSW5
1IX0.2slide_switch:SW_SS12D00GSW6
1IX0.3Button_Switch_THT:SW_PUSH_6mmSW11
1IX0.3slide_switch:SW_SS12D00GSW12
1IX0.4slide_switch:SW_SS12D00GSW14
1IX0.4Button_Switch_THT:SW_PUSH_6mmSW13
1IX0.5Button_Switch_THT:SW_PUSH_6mmSW15
1IX0.5slide_switch:SW_SS12D00GSW16
1NAV_BACKButton_Switch_THT:SW_PUSH_6mmSW10
1NAV_DOWNButton_Switch_THT:SW_PUSH_6mmSW8
1NAV_SELECTButton_Switch_THT:SW_PUSH_6mmSW9
1NAV_UPButton_Switch_THT:SW_PUSH_6mmSW7
1OLED-096-I2COLED-096-I2C:OLED-096-I2CU1
1QX0.0LED_THT:LED_D5.0mmD1
1QX0.1LED_THT:LED_D5.0mmD2
1QX0.2LED_THT:LED_D5.0mmD3
1QX0.3LED_THT:LED_D5.0mmD4
1QX0.4LED_THT:LED_D5.0mmD5
1QX0.5LED_THT:LED_D5.0mmD6
1RaspberryPi_Pico_WModule:RaspberryPi_Pico_Common_THTA1

More from kevthehermit/PiLC-ModPwn

1

Similar boards

  • 2 layers52.2 × 52.2 mmBase promicro, the printed circuit board in 3D

    Base promicro

    google/mozc-devices

    Circuit diagrams and firmware source code for Gboard DIY keyboards

    30 parts3kApache-2.0
  • 2 layers40.6 × 15.2 mmVr mmm, the printed circuit board in 3D

    Vr mmm

    rusefi/rusefi

    rusefi - GPL internal combustion engine control unit

    30 parts1.2k
  • 2 layers270 × 11 mmDaylight, the printed circuit board in 3D

    Daylight

    VoronDesign/Voron-Hardware

    Cool Hardware designed by the Voron Design group

    30 parts1.1kGPL-3.0
  • 2 layers65 × 30 mmRgb to hdmi, the printed circuit board in 3D

    Rgb to hdmi

    hoglet67/RGBtoHDMI

    Bare-metal Raspberry Pi project that provides pixel-perfect sampling of Retro Computer RGB/YUV video and conversion to HDMI

    30 parts1kGPL-3.0
  • 2 layers40.5 × 58 mmInitial v, the printed circuit board in 3D

    Initial v

    tenderlove/initial-v

    It's a BMW shifter converted to a Bluetooth Keyboard that you use with Vim

    30 parts1kApache-2.0
  • 2 layers34.3 × 41.8 mmMotionCubeViewAllForces, the printed circuit board in 3D

    MotionCubeViewAllForces

    hackclub/OnBoard

    💡 Join 1,000 teenagers and make your first PCB with a $100 grant!

    30 parts915
  • 2 layers57.4 × 62 mmPicoWS2812, the printed circuit board in 3D

    PicoWS2812

    ErichStyger/mcuoneclipse

    McuOnEclipse projects and examples

    30 parts765
  • 2 layers52.1 × 46.8 mmFIRE TEST PANEL, the printed circuit board in 3D

    FIRE TEST PANEL

    jrsteensen/OpenHornet

    OpenHornet 1:1 F/A-18C Simulator Repository

    30 parts431

Questions

How big is the PicoLC PCB?

It measures 99.9 × 99.9 mm and has 2 copper layers, 1.6 mm thick.

What parts does the PicoLC use?

30 parts. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the PicoLC KiCad files?

From the kevthehermit/PiLC-ModPwn repository on GitHub, at the commit this page was made from: the board is Hardware/PicoLC/PicoLC.kicad_pcb and its schematic Hardware/PicoLC/PicoLC.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the PicoLC design in my own project?

Its repository publishes it under the GPL-3.0 licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).