

Usb c traffic light board
这是一个用于替换原红绿灯小板的项目。目标是做一块新的 57mm x 14mm 电路板,通过 USB-C 供电,并让电脑通过 USB 串口控制红、黄、绿三颗灯。
- Size
- 14 × 57 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 18
- Nets
- 16
- Pads
- 67
- Tracks, vias
- 81, 17
- Routed
- Yes
- KiCad
- KiCad 10.0 (file 20260206)
- Created
- 25 May 2026
- Updated
- 25 May 2026
Overview
Usb c traffic light board is an open-source printed circuit board by lemonhall, from the lemonhall/usb-c-traffic-light-board repository on GitHub. It is a 2-layer board of 14 × 57 mm with 18 parts on 16 nets, routed with 81 tracks and 17 vias.
It is built around the CH552G. Its parts include 7 resistors, 3 capacitors, 3 diodes, 1 IC and 1 connector. It belongs with the 8051 (CH55x, STC, AT89) boards of this library.
Main components
1README
README.mdUSB-C 红绿灯控制板
这是一个用于替换原红绿灯小板的项目。目标是做一块新的 57mm x 14mm 电路板,通过 USB-C 供电,并让电脑通过 USB 串口控制红、黄、绿三颗灯。
目标
- 完全替换原来的小电路板。
- 使用 USB-C 供电。
- 通过 USB-C 连接电脑,由电脑控制三颗灯。
- 电脑端识别为虚拟串口,方便脚本控制。
- 尽量避免飞线,最终装配时只使用这一块新板。
当前机械假设
- 板长:
57mm - 板宽:
14mm - 当前板框已经按原板照片改成上下梯形端部和左右半圆避让槽。
- 三颗灯从上到下为:绿、黄、红;灯中心按从板底往上约
50mm、28mm、7mm复核。 - 上螺丝孔直径
2mm,孔边离上端梯形窄边约1mm。 - 下螺丝孔直径
2mm,孔中心离板顶约33mm,位于板子左侧、靠近从下往上第二组避让槽。 - USB-C 目标位置对应原拨动开关穿出后壳的位置;原开关伸出背面约
10mm,开口宽度约10mm。 - 注意:当前 KiCad 里
USB_C_Receptacle_G-Switch_GT-USB-7025是right-angle占位封装,不是最终可下单的立式背出 USB-C;最终必须按实物型号替换封装和 3D 机械模型。
下一步顺序
- 机械复核:量原板孔位、缺口、圆角、灯中心坐标、USB-C 后壳开口位置,把板框从当前矩形改成更贴原壳的形状。
- USB-C 完整性复核:按最终采购的连接器封装,复核
VBUS、GND、CC1、CC2、D+、D-,确认正反插都能稳定供电和通信。 - 生成生产文件:用 KiCad CLI 导出 Gerber 和钻孔文件,再用 Gerber 预览检查铜层、板框、孔、阻焊和丝印。
- 小批打样前审查:逐项核对 BOM、封装方向、LED 极性、USB-C 型号、CH552G 供电和下载方式。
当前建议先做第 1 步和第 2 步。它们决定这块板能不能真的塞回外壳,以及插上电脑后能不能稳定识别。
电气方案
- 主控:沁恒
CH552G,小封装、带原生 USB。 - USB-C:
- 电脑 USB-C 默认
VBUS提供5V。 - 本板只作为普通受电设备,不做 USB PD 高压协商。
D+ / D-接到主控 USB 引脚。CC1 / CC2各接一个5.1k下拉电阻到地,只做受电设备。
- 电脑 USB-C 默认
- 三颗灯:
- 每颗灯单独串限流电阻。
- 每颗灯由一个主控 GPIO 控制。
- 固件可用 PWM 分别控制三颗灯亮度,也可以控制任意组合同时亮、闪烁或呼吸。
- 第一版按低亮度指示灯设计,目标电流约
2-5mA。
- 调试:
- 预留
5V、GND、D+、D-、复位、三路灯控制测试焊盘。
- 预留
串口协议草案
电脑通过虚拟串口发送一行文本命令:
R 1
R 0
Y 1
Y 0
G 1
G 0
A 0
A 1
S 1 0 1
?返回示例:
OK
ERR 1
S R=1 Y=0 G=1文件说明
docs/hardware/requirements.md:需求和边界。docs/hardware/bom.md:第一版物料清单。docs/hardware/pinout.md:引脚和网络分配。docs/hardware/mechanical-measurement-guide.md:原板外轮廓和孔位测量指南。docs/hardware/serial-protocol.md:电脑控制协议。docs/hardware/schematic.md:完整原理图连接说明。docs/hardware/schematic.svg:可直接打开查看的完整原理图。docs/hardware/pcb-layout.svg:第一版 PCB 顶层布局草案。references/original-board-photo.md:原板照片观察记录。kicad/:KiCad 工程骨架和第一版板框。firmware/README.md:固件设计说明。pc-control/traffic_light.py:电脑端串口控制小脚本。
已查资料
- CH552G 是带 USB 的 8 位单片机:https://www.alldatasheet.com/datasheet-pdf/pdf/1147065/WCH/CH552G.html
- LCSC 页面显示 CH552G 常见封装为 SOP-16:https://www.lcsc.com/product-detail/Microcontrollers-MCU-MPU-SOC_WCH-Jiangsu-Qin-Heng-CH552G_C111292.html
- CH552G 资料中包含 USB Type-C CC 控制相关内容:https://www.alldatasheet.net/html-pdf/1147065/WCH/CH552G/2781/41/CH552G.html
Parts
18| Qty | Value | Footprint | References |
|---|---|---|---|
| 3 | 1k | R_0603_1608Metric | R1, R2, R3 |
| 2 | 100nF | C_0603_1608Metric | C2, C3 |
| 2 | 22R | R_0603_1608Metric | R4, R5 |
| 2 | 5.1k | R_0603_1608Metric | R6, R7 |
| 1 | 10uF | C_0805_2012Metric | C1 |
| 1 | CH552G | SOIC-16_3.9x9.9mm_P1.27mm | U1 |
| 1 | RST | TestPoint_Pad_D1.0mm | TP1 |
| 1 | 上螺丝孔 | MountingHole_2mm | H1 |
| 1 | 下螺丝孔 | MountingHole_2mm | H2 |
| 1 | 橙灯 | LED_1206_3216Metric | D2 |
| 1 | 红灯 | LED_1206_3216Metric | D3 |
| 1 | 绿灯 | LED_1206_3216Metric | D1 |
| 1 | 背面USB-C | USB_C_Receptacle_G-Switch_GT-USB-7025 | J1 |
Similar boards
- 2 layers30.4 × 12.7 mm

- 2 layers40.6 × 27.9 mm

- 2 layers40 × 40 mm

- 2 layers38.6 × 15.7 mm

LIPS V3.2
milar111/L.I.P.S.
OpenSource Affordable SipAndPuff device: Linear Interface for Paralysis Support
21 parts13 - 2 layers28.4 × 15.9 mm

- 2 layers51 × 44 mm

- 2 layers105.9 × 83.1 mm

BSidesDFW 2019
gowenrw/BSidesDFW_2019_Badge
This is where all the files for the BSidesDFW 2019 Badge will be stored. This includes code and art and cab and fab files. All the things.
30 parts5MIT - 2 layers43.2 × 24.9 mm

Questions
How big is the Usb c traffic light board PCB?
It measures 14 × 57 mm and has 2 copper layers, 1.6 mm thick.
What parts does the Usb c traffic light board use?
18 parts, built around the CH552G. 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 Usb c traffic light board KiCad files?
From the lemonhall/usb-c-traffic-light-board repository on GitHub, at the commit this page was made from: the board is kicad/usb_c_traffic_light_board.kicad_pcb and its schematic kicad/usb_c_traffic_light_board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the Usb c traffic light board design in my own project?
Its repository states no licence, so its author keeps all rights: ask lemonhall before reusing the design.