Skip to the content
2 layers34.5 × 24 mmFDXB, the printed circuit board in 3D

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

4

README

README.md

FDX-B Pet Microchip Reader based on the ch32v003.

image

image

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.

image

The PCB was designed to be easly for me to etch at home.

Firmware

Build

sh
cd firmware
git submodule update --init --recursive --depth=1
make

Alternatively you can define a env variable with the path to your local ch32fun:

sh
export CH32V003FUN=~/ch32fun/ch32fun

How 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):

text
  FLASH:        2592 B        16 KB     15.82%
    RAM:          60 B         2 KB      2.93%

Resources

Parts

26
QtyValueFootprintReferences
510kResistor_SMD:R_1206_3216MetricR3, R4, R7, R8, R9
4100kResistor_SMD:R_1206_3216MetricR2, R5, R6, R11
3TuneCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC1, C7, C8
20.1uFCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC3, C6
2100RResistor_SMD:R_1206_3216MetricR1, R10
23n3Capacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC2, C4
110nCapacitor_SMD:C_0603_1608Metric_Pad1.08x0.95mm_HandSolderC5
1AO3400APackage_TO_SOT_SMD:SOT-23Q1
1AO3401APackage_TO_SOT_SMD:SOT-23Q2
1CH32V003A4M6Package_SO:SO-16_3.9x9.9mm_P1.27mmU2
1CoilConnector_PinSocket_2.54mm:PinSocket_1x02_P2.54mm_VerticalJ1
1DDiode_SMD:D_SMAD1
1LM358Package_SO:SOIC-8_3.9x4.9mm_P1.27mmU1
1PROGConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ6

Similar boards

  • 2 layers43.9 × 54.1 mmXmas tree, the printed circuit board in 3D

    Xmas tree

    BogdanTheGeek/xmas-tree

    Charlieplexed RGB Christmas Tree

    27 parts3MIT
  • 2 layers25 × 23.9 mmRpi camera led, the printed circuit board in 3D

    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 mmUV Curing Box, the printed circuit board in 3D

    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 mmCCCCPPPS MkI, the printed circuit board in 3D

    CCCCPPPS MkI

    BogdanTheGeek/CCCCPPPS

    Cheap Crappy Constant Current Portable Programmable Power Supply

    26 parts12MIT
  • 4 layersSUNNY C1-HEAD, the printed circuit board in 3D

    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 mmOpendiag, the printed circuit board in 3D

    Opendiag

    maximus64/opendiag-hardware

    OpenDIAG - Open Source OBD2 Interface (Hardware)

    148 parts5CERN-OHL-S-2.0
  • 4 layers76 × 50 mmWigglecam, the printed circuit board in 3D

    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

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