

PCB Controller
FlipDisc Project was made for education of Project. Chadsadakorn Piriyasiriphan Jadesalit Suriyanimitsuk Sutthiphong Hongkham
- Size
- 249.4 × 122 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 159
- Nets
- 312
- Pads
- 992
- Tracks, vias
- 3,337, 211
- Pours
- 6
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 18 Dec 2024
- Updated
- 28 Sep 2026
Overview
PCB Controller is an open-source printed circuit board by Sutthiphong-H, from the Sutthiphong-H/project-flip-disc repository on GitHub. It is a 2-layer board of 249.4 × 122 mm with 159 parts on 312 nets, routed with 3,337 tracks and 211 vias.
It is built around the 74HCT245, TSR 1-2450 and UDN2981A-T, with the 74HC595, 74HC00D and 74HC123D among its other parts. Its parts include 65 resistors, 41 capacitors, 29 ICs, 11 connectors and 9 transistors. It belongs with the ESP32 boards of this library.
Main components
974HCT245
DIP-20-40℃~+85℃ 28ns@4.5V 4.5V~5.5V 6mA 6mA 74HCT 8 8uA Bidirectional TTL-compatible CMOS Tri-State DIP-20 Buffers, Drivers, Receivers, Transceivers ROHSWuxi I-core Elec74 SeriesTSR 1-2450
SIP,11.6x7.5mm-40℃~+85℃ 10.2mm 11.6mm 1A 2200uF 300uA 50mVp-p 5V 7.5mm 7V~36V 850kHz 94% Short Circuit Protection、Automatic fault recovery ±1% SIP,11.6x7.5mm DC-DC Power Modules ROHSYLPTECDC-DC Power ModulesUDN2981A-T
DIP18-3008-Channel Source DriversALLEGRO MICROSYSTEMUncategorised74HC595
SOP-16-40℃~+85℃ 1 100ns@5V,50pF 10MHz 2V~6V 74HC 8 Serial-to-Serial or Parallel Tri-State SOP-16 Shift Registers ROHSGRShift Registers74HC00D
SOP-14-40℃~+125℃ 1.5V、3.15V、4.2V 1.9V、3.7V、5.9V 100mV、400mV、400mV 2 2V~6V 4 40uA 5.2mA 5.2mA 500mV~1.8V 74HC Series 7ns@6V,50pF NAND Gate SOIC-14 Logic Gates ROHSNexperiaLogic Gates74HC123D
SOIC-16-40℃~+125℃ 160uA 2 2V~6V 5.2mA 5.2mA 65ns 74HC Monostable Schmitt trigger SOIC-16 Monostable Multivibrators ROHSNexperiaMonostable Multivibrators1N4744A
DO-41GZener DiodesLGEIRF4905
TO-220-35℃~+175℃ 1 P-Channel 12nF 150nC@10V 1nF 2.5V 200W 450pF 60V 75A 9mΩ P-Channel TO-220 MOSFETs ROHSCmosMOSFETsSMBJ28CA
DO-214AA(SMB)ESD And Surge Protection (TVS/ESD)hongjiacheng
README
README.mdFlipDisc Project
FlipDisc Project was made for education of Project. Chadsadakorn Piriyasiriphan Jadesalit Suriyanimitsuk Sutthiphong Hongkham
A webcam feed is segmented with RVM (Robust Video Matting; U2NET optional), each silhouette's distance is estimated from
its height, and everyone beyond FLIPDISC_MAX_DISTANCE is dropped. What's left is
reduced to an 80x45 black-and-white matrix and streamed to the React frontend over
Socket.IO. With nobody in range the backend loops an idle video instead.
Layout
backend/
├── assets/ idle video clips
├── models/ model weights (not committed)
├── requirements.txt
├── src/
│ ├── app.py entry point
│ ├── settings.py every tunable, overridable by environment variable
│ ├── pipeline.py capture -> segment -> publish loop
│ ├── frame_rate.py rolling FPS meter
│ ├── sources/ webcam capture, idle video playback
│ ├── vision/ RVM + U2NET models, segmentation worker
│ └── server/ Flask + Socket.IO server and publisher
└── tools/camtest.py preview a camera to find its index
flip-disc_frontend/ React client
arduino/ ESP32 sketchesInstallation
The RTX 50-series needs a CUDA 12.8 build of torch, so install torch first:
cd backend
pip install torch torchvision --index-url https://download.pytorch.org/whl/cu128
pip install -r requirements.txtOn a machine without an NVIDIA GPU, install the much smaller CPU build instead
(--index-url https://download.pytorch.org/whl/cpu). The backend runs on the CPU
by itself when there is no GPU, or the GPU fails a test run. That includes cards
older than the RTX 20-series, which the cu128 build has no kernels for. It also
falls back when the GPU can't load the model.
| Device | Model input | Per frame | fps with this webcam |
|---|---|---|---|
| RTX 5060 (CUDA graph) | 1280x720 | ~8.5 ms | 20 (the camera's limit) |
| CPU, 6 threads | 640x360 | ~47 ms | ~17 |
The header of the page shows GPU or CPU (in amber) for the one in use.
Put the weights in backend/models/:
rvm_mobilenetv3.pth-- the default model (download)u2net_human_seg.pth-- only needed forFLIPDISC_MODEL=u2net(download)
Put the idle clip at backend/assets/video.mp4 (not in git -- it's 90 MB).
RVM's code in backend/src/vision/rvm/ is vendored from RobustVideoMatting and is GPL-3.0.
cd flip-disc_frontend
npm installRunning
Build the frontend once and the backend serves it -- open http://localhost:5000:
cd flip-disc_frontend
npm run build # -> flip-disc_frontend/dist (FLIPDISC_FRONTEND_DIST to move it)
cd ../backend
python src/app.py # Flask + Socket.IO + the built page, all on port 5000While working on the frontend, use Vite's dev server instead (http://localhost:5173, talks to the backend on port 5000):
cd flip-disc_frontend
npm run devRunning unattended
backend/run-backend.bat runs the backend and restarts it whenever it exits with an
error. The backend exits with code 1 by itself when something breaks and won't
recover in place: the pipeline thread dies (a model that won't load, a CUDA context
broken by a GPU driver reset), segmentation hangs, or no frame goes out for
FLIPDISC_STALL_SECONDS. Frames go out in every mode (the idle clip plays even
without a camera), so a gap in them always means the backend is stuck. Ctrl+C exits with 0 and ends
the script too.
To start it with Windows, create a Task Scheduler task with the trigger At log on
and the action backend\run-backend.bat. Use log on rather than a Windows service:
services run outside the desktop session, and webcam access from there is unreliable. On the display machine, also turn off
sleep and USB selective suspend (Power Options → USB settings), or the webcam
can be powered down.
GET /statusreturns 503 with"status": "stalled"once frames stop, for an external health check. Before the first frame the status is"starting".- The page shows No frames from the backend when it is connected but nothing has arrived for 3 s, and Disconnected once the backend has exited.
- If WebGL loses its context (a GPU reset, a driver update), the flip-disc view rebuilds itself. You don't need to reload.
Cameras are managed from the camera icon at the top right of the page: pick the camera in use from the dropdown, and add, edit or delete cameras.
- Webcam: Scan shows the webcams plugged into the backend machine (with a thumbnail each); pick one, give it a name and a resolution.
- IP camera: name, IP, port, username, password, channel, main/sub stream,
brand and resolution. The RTSP URL is built from those: Dahua
.../cam/realmonitor?channel=1&subtype=0or Hikvision.../Streaming/Channels/101. - Test grabs one frame and shows it. The backend only switches to a camera that delivers a picture, otherwise the current one keeps running.
The list lives in backend/cameras.json -- not committed, since it holds the IP
cameras' passwords, which the page never gets back (a blank password when editing
keeps the saved one). Without that file the backend starts with webcam FLIPDISC_CAMERA.
The page has three views: Flip-disc (the simulated display), Mask (the raw
80x45 matrix) and Camera (the webcam with the silhouette highlighted and a
distance box per person, streamed from /debug.mjpg only while it's open).
Environment variables
| Variable | Default | Meaning |
|---|---|---|
FLIPDISC_CAMERA | 0 | First webcam, until cameras.json exists |
FLIPDISC_PORT | 5000 | Socket.IO / HTTP port |
FLIPDISC_EMIT_FPS | 30 | Upper bound on frames sent to the client |
FLIPDISC_MAX_DISTANCE | 15 | People further than this (m) are dropped |
FLIPDISC_FOCAL_LENGTH | 460 | For the distance estimate; calibrate it |
FLIPDISC_MIN_AREA | 0.005 | Blobs under this share of frame = noise |
FLIPDISC_MODEL | rvm | rvm or u2net |
FLIPDISC_DEVICE | auto | auto, cuda or cpu |
FLIPDISC_PROCESS_SIZE | per device | Model input, 16:9. RVM: GPU 1280x720, CPU 640x360; U2NET 512x288 |
FLIPDISC_THIN_BOOST | 2 | Extra weight for parts thinner than a disc (fingers); 0 = off |
FLIPDISC_SMOOTHING | 0.5 | Anti-flicker; 1 = off, lower = steadier |
FLIPDISC_IDLE_TIMEOUT | 15 | Seconds without a person before idle |
FLIPDISC_IDLE_VIDEO | video.mp4 | Clip in backend/assets/ to loop |
FLIPDISC_STALL_SECONDS | 10 | No frame this long: exit for a restart |
FLIPDISC_STARTUP_SECONDS | 120 | No first frame this long: same |
Parts
159| Qty | Value | Footprint | References |
|---|---|---|---|
| 60 | 10k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R2, R10, R11, R12, R13, R14, R15, R16, R17, R18, R19, R20, R21, R22, R23, R24 +44 |
| 34 | 0.1 uf | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C2, C10, C11, C12, C13, C14, C15, C16, C17, C18, C19, C20, C21, C22, C23, C24 +18 |
| 16 | 74HC595 | Package_DIP:DIP-16_W7.62mm_Socket | U5, U6, U7, U8, U9, U10, U11, U12, U13, U14, U25, U26, U27, U30, U31, U32 |
| 8 | UDN2981A | Package_DIP:DIP-18_W7.62mm_Socket | U15, U16, U17, U18, U19, U33, U34, U35 |
| 8 | ULN2803APG_O,N,HZN | Package_DIP:DIP-18_W7.62mm_Socket | Q2, Q3, Q4, Q5, Q6, Q7, Q8, Q9 |
| 3 | 100nF | Capacitor_SMD:C_0805_2012Metric_Pad1.18x1.45mm_HandSolder | C8, C41, C43 |
| 3 | 10k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R38, R39, R41 |
| 2 | Conn_01x15 | Connector_PinSocket_2.54mm:PinSocket_1x15_P2.54mm_Vertical | J10, J11 |
| 1 | 1000uF/35V | Capacitor_THT:CP_Radial_D12.5mm_P5.00mm | C42 |
| 1 | 10uF/50V | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C3 |
| 1 | 1N4744A | Diode_THT:D_DO-41_SOD81_P7.62mm_Horizontal | D3 |
| 1 | 2.2k | Resistor_THT:R_Axial_DIN0207_L6.3mm_D2.5mm_P7.62mm_Horizontal | R1 |
| 1 | 22uF/10V | Capacitor_SMD:C_1206_3216Metric_Pad1.33x1.80mm_HandSolder | C4 |
| 1 | 470uF/35V | Capacitor_THT:CP_Radial_D10.0mm_P5.00mm | C1 |
| 1 | 47k | Resistor_SMD:R_0805_2012Metric_Pad1.20x1.40mm_HandSolder | R40 |
| 1 | 74HC00 | Package_DIP:DIP-14_W7.62mm_Socket | U22 |
| 1 | 74HC123 | Package_DIP:DIP-16_W7.62mm_Socket | U3 |
| 1 | 74HCT245 | Package_DIP:DIP-20_W7.62mm_Socket | U4 |
| 1 | ColumnPin_1-12 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J2 |
| 1 | ColumnPin_13-24 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J3 |
| 1 | ColumnPin_25-36 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J4 |
| 1 | Conn_01x05 | Connector_PinHeader_2.54mm:PinHeader_1x05_P2.54mm_Vertical | J8 |
| 1 | DC_Jack_5.5x2.5_24V | Connector_BarrelJack:BarrelJack_CUI_PJ-063AH_Horizontal | J1 |
| 1 | ESP32-DEVKIT-V1 | ESP32-DEVKIT-V1:MODULE_ESP32_DEVKIT_V1 | U23 |
| 1 | IRF4905 | Package_TO_SOT_THT:TO-220-3_Vertical | Q1 |
| 1 | LED_Power_5V | LED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolder | D1 |
| 1 | PPTC 3A | Fuse:Fuse_Bourns_MF-RG300 | F1 |
| 1 | RowPin17-24 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J7 |
| 1 | RowPin_1-8 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J5 |
| 1 | RowPin_9-16 | Connector_IDC:IDC-Header_2x08_P2.54mm_Vertical | J6 |
| 1 | SMBJ28CA | Diode_SMD:D_SMB | D2 |
| 1 | Screw_Terminal_24V | TerminalBlock_Phoenix:TerminalBlock_Phoenix_MKDS-1,5-2-5.08_1x02_P5.08mm_Horizontal | J9 |
| 1 | TSR_1-2450 | Converter_DCDC:Converter_DCDC_TRACO_TSR-1_THT | U1 |
Similar boards
- 2 layers65.6 × 56.5 mm

- 2 layers198.1 × 193 mm

STE25
stonedDiscord/Automatenplatinen
Reverse engineerte Hardware aus deutschen Spielautomaten.
252 parts5BSD-2-Clause - 2 layers278 × 135 mm

- 2 layers219 × 88 mm

- 2 layers224 × 78 mm

VFD Clock
AronASzucs/IV-11-VFD-Clock
6-digit Soviet IV-11 VFD tube clock — custom PCB, mixed 25V/1.5V power system, 7-state FSM firmware
41 parts43 - 2 layers225 × 80 mm

VFD
davidmpye/VFD
This repository contains a design for an IV-11 based Vacuum Fluorescent Display (VFD) display unit.
72 parts9 - 2 layers

3-digit
jamesfowkes/cryptology-countdown
PCBs and software for two synchronous countdown timers
40 parts - 2 layers100 × 70 mm

Wired console k9ay
ra0sms/universal_control_console
Control console for any types of antenna's switches
115 partsMIT
Questions
How big is the PCB Controller PCB?
It measures 249.4 × 122 mm and has 2 copper layers, 1.6 mm thick.
What parts does the PCB Controller use?
159 parts, built around the 74HCT245, TSR 1-2450, UDN2981A-T and 74HC595. 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 PCB Controller KiCad files?
From the Sutthiphong-H/project-flip-disc repository on GitHub, at the commit this page was made from: the board is PCB_Controller/PCB_Controller.kicad_pcb and its schematic PCB_Controller/PCB_Controller.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the PCB Controller design in my own project?
Its repository states no licence, so its author keeps all rights: ask Sutthiphong-H before reusing the design.