

PicoLC
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.mdPiLC 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
| Component | GPIO 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_UP | 22 |
| NAV_DOWN | 26 |
| NAV_SELECT | 27 |
| NAV_BACK | 28 |
| OLED SDA | 14 |
| OLED SCL | 15 |
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
- Download the UF2 firmware from the latest GitHub Release, or build it yourself
- Hold the BOOTSEL button on the Pico, connect USB, then release BOOTSEL
- Copy the appropriate
.uf2file to the RPI-RP2 drive that appears - The board will reboot automatically with the firmware and application installed
Available Firmware Images
| File | Target Board |
|---|---|
pilc-modpwn-RPI_PICO2_W.uf2 | Raspberry Pi Pico 2W |
pilc-modpwn-RPI_PICO_W.uf2 | Raspberry Pi Pico W |
pilc-modpwn-W5500_EVB_PICO.uf2 | W5500-EVB-Pico |
Running the Challenge Server
cd server
pip install -r requirements.txt
python app.pyOpen http://localhost:5000 to access the challenge web interface.
File Structure
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.pyBuilding 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.
# 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-builderThe 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.
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 --cleanThe 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:
{
"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:
| Button | Function |
|---|---|
| UP | Navigate up / Scroll up |
| DOWN | Navigate down / Scroll down |
| SELECT | Confirm selection / Start challenge |
| BACK | Go 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:
- Input 1 ON (hold)
- Input 2 ON (hold)
- Inputs 1, 2, 4 ON simultaneously (hold)
- Toggle Input 3 five times
Note: Any input not specified must be OFF
Modbus Register Map
Coils (Function Codes 01, 05, 15)
| Address | Description |
|---|---|
| 0 | LED 0 (Q0.0) |
| 1 | LED 1 (Q0.1) |
| 2 | LED 2 (Q0.2) |
| 3 | LED 3 (Q0.3) |
| 4 | LED 4 (Q0.4) |
| 5 | LED 5 (Q0.5) |
Discrete Inputs (Function Code 02)
| Address | Description |
|---|---|
| 0 | Button 0 (Ix0.0) |
| 1 | Button 1 (Ix0.1) |
| 2 | Button 2 (Ix0.2) |
| 3 | Button 3 (Ix0.3) |
| 4 | Button 4 (Ix0.4) |
| 5 | Button 5 (Ix0.5) |
Holding Registers (Function Codes 03, 06, 16)
| Address | Description |
|---|---|
| 0-5 | General purpose registers |
| 100+ | Challenge-specific registers |
Input Registers (Function Code 04)
| Address | Description |
|---|---|
| 0-5 | Button states (mirrors discrete inputs) |
Connecting to the Board
Using Python (pymodbus)
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
# 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 holdingTroubleshooting
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| Qty | Value | Footprint | References |
|---|---|---|---|
| 6 | 220 | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1, R2, R3, R4, R5, R6 |
| 1 | IX0.0 | Button_Switch_THT:SW_PUSH_6mm | SW1 |
| 1 | IX0.0 | slide_switch:SW_SS12D00G | SW2 |
| 1 | IX0.1 | Button_Switch_THT:SW_PUSH_6mm | SW3 |
| 1 | IX0.1 | slide_switch:SW_SS12D00G | SW4 |
| 1 | IX0.2 | Button_Switch_THT:SW_PUSH_6mm | SW5 |
| 1 | IX0.2 | slide_switch:SW_SS12D00G | SW6 |
| 1 | IX0.3 | Button_Switch_THT:SW_PUSH_6mm | SW11 |
| 1 | IX0.3 | slide_switch:SW_SS12D00G | SW12 |
| 1 | IX0.4 | slide_switch:SW_SS12D00G | SW14 |
| 1 | IX0.4 | Button_Switch_THT:SW_PUSH_6mm | SW13 |
| 1 | IX0.5 | Button_Switch_THT:SW_PUSH_6mm | SW15 |
| 1 | IX0.5 | slide_switch:SW_SS12D00G | SW16 |
| 1 | NAV_BACK | Button_Switch_THT:SW_PUSH_6mm | SW10 |
| 1 | NAV_DOWN | Button_Switch_THT:SW_PUSH_6mm | SW8 |
| 1 | NAV_SELECT | Button_Switch_THT:SW_PUSH_6mm | SW9 |
| 1 | NAV_UP | Button_Switch_THT:SW_PUSH_6mm | SW7 |
| 1 | OLED-096-I2C | OLED-096-I2C:OLED-096-I2C | U1 |
| 1 | QX0.0 | LED_THT:LED_D5.0mm | D1 |
| 1 | QX0.1 | LED_THT:LED_D5.0mm | D2 |
| 1 | QX0.2 | LED_THT:LED_D5.0mm | D3 |
| 1 | QX0.3 | LED_THT:LED_D5.0mm | D4 |
| 1 | QX0.4 | LED_THT:LED_D5.0mm | D5 |
| 1 | QX0.5 | LED_THT:LED_D5.0mm | D6 |
| 1 | RaspberryPi_Pico_W | Module:RaspberryPi_Pico_Common_THT | A1 |
More from kevthehermit/PiLC-ModPwn
1- 2 layers138 × 65 mm

Similar boards
- 2 layers52.2 × 52.2 mm

Base promicro
google/mozc-devices
Circuit diagrams and firmware source code for Gboard DIY keyboards
30 parts3kApache-2.0 - 2 layers40.6 × 15.2 mm

- 2 layers270 × 11 mm

Daylight
VoronDesign/Voron-Hardware
Cool Hardware designed by the Voron Design group
30 parts1.1kGPL-3.0 - 2 layers65 × 30 mm

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 mm

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 mm

MotionCubeViewAllForces
hackclub/OnBoard
💡 Join 1,000 teenagers and make your first PCB with a $100 grant!
30 parts915 - 2 layers57.4 × 62 mm

- 2 layers52.1 × 46.8 mm

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).