A Python tool to create parts - e.g. DRV8833, N20Motor, PicoW, ULN2003

Hi, I’m just getting started with making stuff, 3D printing and electronics, and I’ve been using Fritzing to do wiring diagrams for projects using microcontrollers, breadboards, breakout boards, etc.

I found a few things I couldn’t find a Fritzing part for, so I wrote a Python package to take a YAML file describing a board, and turn it into a FZPZ file (On PyPI: fzpcb). I’m not a Python devolper by trade, so forgive the code quality.

I used this to generate a few these parts. Could someone take a look at them, and tell me if they are good parts or not?

ULN2003.fzpz (50.3 KB)

DRV8833.fzpz (35.9 KB)

N20Motor.fzpz (17.8 KB)

RaspberryPIPicoW.fzpz (117.7 KB)

Here’s an example of the YAML I used to generate them, this one for the PicoW with a TP6 (BOOTSEL) connector. The “layout” is supposed to be an ASCII diagram of the board, but it’s obscure and not documented:

metadata:
    author: Phil T
    version: 1.1
    title: Raspberry PI Pico W
    description: Raspberry PI Pico W constructed by fzpcb
tags:
    - Picoboard
    - Raspberry
    - Pico 2040
    - Raspberry PI
    - Pico W
properties:
    family: cpu board
    type: Raspberry pi
    variant: Pico W
layout:
    - '     SX++++     '
    - '01YH+######YH+40'
    - '02=t4=.t5..=kF39'
    - '03.Rl...Cf..==38'
    - '04..wB+.km+.ks37'
    - '05t3###.===.==36'
    - '0644....Cf.B-.35'
    - '07..KM+.CfB|..34'
    - '08......CT....33'
    - '09...KA++++...32'
    - '10...######...31'
    - '11...######...30'
    - '12.......T2...29'
    - '13..SS+.41424328'
    - '14..Ss+++++++.27'
    - '15..#########.26'
    - '16..#########.25'
    - '17..#########.24'
    - '18t1..........23'
    - '19yH+.S-S-.yH+22'
    - '20===.S-S-.===21'
text:
    T2: "D E B U G"
    T4: {size: 0.7, text: "L E D"}
    T5: {size: 0.7, text: "U S B"}
text-up:
    T1: {size: 1.4, text: "Raspberry Pi Pico W ©2022"}
    T3: "   BOOTSEL"
connectors:
    1: GP0
    2: GP1
    3: GND Ground
    4: GP2
    5: GP3
    6: GP4
    7: GP5
    8: GND Ground
    9: GP6
    10: GP7
    11: GP8
    12: GP9
    13: GND Ground
    14: GP10
    15: GP11
    16: GP12
    17: GP13
    18: GND Ground
    19: GP14
    20: GP15
    21: GP16
    22: GP17
    23: GND Ground
    24: GP18
    25: GP19
    26: GP20
    27: GP21
    28: GND Ground
    29: GP22
    30: RUN
    31: GP26_A0
    32: GP26_A1
    33: AGND
    34: GP28_A2
    35: ADC_VREF
    36: 3V3
    37: 3V3_EN
    38: GND Ground
    39: VSS
    40: VBUS
connectors-female:
    41: SW-CLK
    42: GND
    43: SW-DIO
    44: TP6

The first thing to do is a google search of the form “fritzing part unl2003 module” Which indicates there is already a part here with the driver board and motor.

Running the part through FritzingCheckPart.py flags no significant errors

$ FritzingCheckPartw.py part.ULN2003_d2a6a821c6e9388999057980ef0487f6.fzp

**** Starting to process file Startup, no file yet

**** Starting to process file part.ULN2003_d2a6a821c6e9388999057980ef0487f6.fzp

**** Starting to process file svg.breadboard.ULN2003_d2a6a821c6e9388999057980ef0487f6_breadboard.svg.bak

**** Starting to process file svg.schematic.ULN2003_d2a6a821c6e9388999057980ef0487f6_schematic.svg.bak

**** Starting to process file svg.pcb.ULN2003_d2a6a821c6e9388999057980ef0487f6_pcb.svg.bak

File
‘part.ULN2003_d2a6a821c6e9388999057980ef0487f6.fzp.bak’

This is a through hole part as both copper0 and copper1 views are present.
If you wanted a smd part remove the copper0 definition from line 39

Warning 6: File
‘part.ULN2003_d2a6a821c6e9388999057980ef0487f6.fzp.bak’
At line 2

ReferenceFile name

‘uln2003.yaml’

Doesn’t match fzp filename

‘ULN2003_d2a6a821c6e9388999057980ef0487f6.fzp’

Warning 32: File
‘svg.breadboard.ULN2003_d2a6a821c6e9388999057980ef0487f6_breadboard.svg.bak’
At line 2

Scale is not the desirable 1/1000 ratio from width/height to
viewBox width/height.

Warning 32: File
‘svg.schematic.ULN2003_d2a6a821c6e9388999057980ef0487f6_schematic.svg.bak’
At line 2

Scale is not the desirable 1/1000 ratio from width/height to
viewBox width/height.

Warning 32: File
‘svg.pcb.ULN2003_d2a6a821c6e9388999057980ef0487f6_pcb.svg.bak’
At line 2

Scale is not the desirable 1/1000 ratio from width/height to
viewBox width/height.

You can find FritzingCheckPart in this tutorial:

The label should be A (for assembly as this is a module) but that isn’t deadly either. The motor connector should likely be suppressed in pcb as you can’t connect to it without unsoldering the connector.

Other than that looks fine.

Peter