

FDX-B Reader based on the ch32v003
- Size
- 34.5 × 24 mm
- Copper layers
- 2
- Thickness
- 1.6 mm
- Parts
- 26
- Nets
- 27
- Pads
- 75
- Tracks, vias
- 123, 0
- Pours
- 3
- Routed
- Yes
- KiCad
- KiCad 8.0 (file 20240108)
- Created
- 24 Mar 2025
- Updated
- 24 Mar 2025
Overview
FDXB is an open-source printed circuit board by BogdanTheGeek, from the BogdanTheGeek/ch32v003_fdxb repository on GitHub, published under the MIT licence. It is a 2-layer board of 34.5 × 24 mm with 26 parts on 27 nets, routed with 123 tracks and 0 vias.
It is built around the CH32V003A4M6, LM358 and AO3400A, with the AO3401A among its other parts. Its parts include 11 resistors, 8 capacitors, 2 ICs, 2 transistors and 2 connectors. It belongs with the RISC-V boards of this library.
Main components
4CH32V003A4M6
SOP-16SOP-16 Microcontrollers (MCU/MPU/SOC) ROHSWCH (Nanjing Qinheng Microelectronics)Microcontrollers (MCU/MPU/SOC)LM358
SOP-8-18V~18V 0℃~+70℃ 1.2MHz 10nA 2 24mA 3V~36V 500uA 50nA 5mV 80dB Built-in compensation SOP-8 Operational Amplifier ROHSMSKSEMIOperational AmplifierAO3400A
SOT-23-55℃~+150℃ 1 N-channel 1.45V 1.4W 30V 48mΩ@2.5V 5.7A 50pF 630pF 75pF 7nC@10V N-Channel SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETsAO3401A
SOT-231 P-Channel 14nC@10V 30V 47mΩ@10V、60mΩ@4.5V、85mΩ@2.5V 4A 55pF 645pF 80pF 900mV SOT-23 MOSFETs ROHSAlpha & Omega SemiconductorMOSFETs
README
README.mdFDX-B Pet Microchip Reader based on the ch32v003.
Hardware
The reader coil should be about 5cm in diameter. Around 50 turns should be enough.
You should aim for an inductance between 400uH to 1mH and a Q of around 8. Check the Microchip application note in /docs.
The circuit is quite simple, all of the elements are clearly labled in the schematic.
I have included a schematic dedicated for simulating the circuit.
The PCB was designed to be easly for me to etch at home.
Firmware
Build
cd firmware
git submodule update --init --recursive --depth=1
makeAlternatively you can define a env variable with the path to your local ch32fun:
export CH32V003FUN=~/ch32fun/ch32funHow does it work
Timer 1 is used to produce a driving signal for the mosfets that includes deadtime. An external interrupt is generated on each edge of the signal and this is where most of the decoding happens.
The signal is ecoded with Biphase encoding, meaning that 2 short consecutive periods between signal edges represent a 0 and one longer period represents a 1.
The code uses 2 buffers of 128bits (as 4 x 32bit), one is the working buffer and the other contains the last decoded frame.
Detected bits are loaded from the least significant bit to the most significant bit. The current bit index and a bit mask is used to compare the current state of the buffer to the start condition (1 followed by exactly 10 zeros) as well as to check the control bits. If at any point the buffer doesn't match the expected bit pattern, the bit count and the mask are reset.
Once the working buffer is full, we swap buffers. We can then parse the raw bit pattern into a struct.
A bunch of optimisations have been made to ensure that the code is as small as possible, but still pretty fast. Most comparison values have been calculated at compile time and all necesery divisions and modulo opperations have been implemented using bit shifts and bitwise ANDs.
The CRC16K is calculated and verified during the parsing of the bit pattern to minimise copies.
I have included a function that can print a uint64_t integer with 0 padding without the use of any decimal division/modulus instructions (which would add about 3k to the binary)
With logs off (but still printing an ID):
FLASH: 2592 B 16 KB 15.82%
RAM: 60 B 2 KB 2.93%Resources
- Nice description of the protocol: https://www.priority1design.com.au/fdx-b_animal_identification_protocol.html
- Similar project base on Arduino: https://github.com/decrazyo/fdxb
- FDX-B decoder for sigrok: https://github.com/swdee/fdx-b-decoder
Parts
26| Qty | Value | Footprint | References |
|---|---|---|---|
| 5 | 10k | Resistor_SMD:R_1206_3216Metric | R3, R4, R7, R8, R9 |
| 4 | 100k | Resistor_SMD:R_1206_3216Metric | R2, R5, R6, R11 |
| 3 | Tune | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C1, C7, C8 |
| 2 | 0.1uF | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C3, C6 |
| 2 | 100R | Resistor_SMD:R_1206_3216Metric | R1, R10 |
| 2 | 3n3 | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C2, C4 |
| 1 | 10n | Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolder | C5 |
| 1 | AO3400A | Package_TO_SOT_SMD:SOT-23 | Q1 |
| 1 | AO3401A | Package_TO_SOT_SMD:SOT-23 | Q2 |
| 1 | CH32V003A4M6 | Package_SO:SO-16_3.9x9.9mm_P1.27mm | U2 |
| 1 | Coil | Connector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_Vertical | J1 |
| 1 | D | Diode_SMD:D_SMA | D1 |
| 1 | LM358 | Package_SO:SOIC-8_3.9x4.9mm_P1.27mm | U1 |
| 1 | PROG | Connector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_Vertical | J6 |
Similar boards
- 2 layers43.9 × 54.1 mm

- 2 layers25 × 23.9 mm

Rpi camera led
mithro/rpi-camera-led
Interposer for the Raspberry Pi camera flex cable: passes the 15-way CSI bus straight through and adds I2C-controlled camera GPIO, PWM illumination LEDs and an ambient light sensor, driven by a CH32V003.
24 parts1Apache-2.0 - 2 layers213.7 × 144.8 mm

UV Curing Box
koko69420/UV-Curing-Box
UV PCB resin curing box controller using WCH CH32V003 RISC-V MCU, 4x4 keypad, TM1637 display, and KiCad PCB
151 parts - 2 layers45 × 49.8 mm

CCCCPPPS MkI
BogdanTheGeek/CCCCPPPS
Cheap Crappy Constant Current Portable Programmable Power Supply
26 parts12MIT - 4 layers

SUNNY C1-HEAD
RSXLX/sunny-the-growing-sunflower-lamp
SUNNY — The Growing Sunflower Lamp | A personal lamp with customizable exteriors, traceable fabrication, and a local creative workspace.
55 parts - 2 layers37 × 70.9 mm

Opendiag
maximus64/opendiag-hardware
OpenDIAG - Open Source OBD2 Interface (Hardware)
148 parts5CERN-OHL-S-2.0 - 4 layers76 × 50 mm

Wigglecam
jadenrhee/wigglecam-controller
RP2040 co-processor board for a 4-lens wigglegram camera: constant-current flash, controls, battery telemetry, Pi 5 I2C interface. 4-layer, DRC-clean, fab-ready.
105 parts - 4 layers70 × 80 mm

Questions
How big is the FDXB PCB?
It measures 34.5 × 24 mm and has 2 copper layers, 1.6 mm thick.
What parts does the FDXB use?
26 parts, built around the CH32V003A4M6, LM358, AO3400A and AO3401A. 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 FDXB KiCad files?
From the BogdanTheGeek/ch32v003_fdxb repository on GitHub, at the commit this page was made from: the board is hardware/MK1/FDXB.kicad_pcb and its schematic hardware/MK1/FDXB.kicad_sch. PCBKit opens the board in the browser, with nothing to install.
Can I use the FDXB design in my own project?
Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).