1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419
|
# WireViz Tutorial
## 01 - Bare-bones example
* Minimum working example
* Only 1-to-1 sequential wiring
```yaml
connectors:
X1:
pincount: 4
X2:
pincount: 4
cables:
W1:
wirecount: 4
length: 1
connections:
-
- X1: [1-4]
- W1: [1-4]
- X2: [1-4]
```

[Source](tutorial01.yml) - [Bill of Materials](tutorial01.bom.tsv)
## 02 - Adding parameters and colors
* Parameters for connectors and cables
* Auto-calculate equivalent AWG from mm2
* Non-sequential wiring
```yaml
connectors:
X1:
pincount: 4
# More connector parameters:
type: Molex KK 254
subtype: female
X2:
pincount: 4
type: Molex KK 254
subtype: female
cables:
W1:
wirecount: 4
# more cable parameters:
length: 1
gauge: 0.25 mm2
show_equiv: true # auto-calculate AWG equivalent
colors: [WH, BN, GN, YE]
connections:
-
- X1: [1-4]
- W1: [1-4]
# non-sequential wiring:
- X2: [1,2,4,3]
```

[Source](tutorial02.yml) - [Bill of Materials](tutorial02.bom.tsv)
## 03 - Pinouts, shielding, templates (I)
* Connector pinouts
* Pincount implicit in pinout
* Cable color codes
* Cable shielding, shield wiring
* Templates
```yaml
connectors:
X1: &template1 # define a template for later use
pinlabels: [GND, VCC, RX, TX] # pincount implicit in pinout
type: Molex KK 254
subtype: female
X2:
<<: *template1 # reuse template
cables:
W1:
wirecount: 4
length: 1
gauge: 0.25 mm2
show_equiv: true
color_code: DIN # auto-assign colors based on DIN 47100
shield: true # add cable shielding
connections:
-
- X1: [1-4]
- W1: [1-4]
- X2: [1,2,4,3]
- # connect the shielding to a pin
- X1: 1
- W1: s
```

[Source](tutorial03.yml) - [Bill of Materials](tutorial03.bom.tsv)
## 04 - Templates (II), notes, American standards, daisy chaining (I)
* Overriding template parameters
* Add nodes to connectors and cables
* American standards: AWG gauge and IEC colors
* Linear daisy-chain
* Convenient for shorter chains
```yaml
connectors:
X1: &template_con
pinlabels: [GND, VCC, SCL, SDA]
type: Molex KK 254
subtype: male
notes: to microcontroller # add notes
X2:
<<: *template_con # use template
subtype: female # but override certain parameters
notes: to accelerometer
X3:
<<: *template_con
subtype: female
notes: to temperature sensor
cables:
W1: &template_cbl
wirecount: 4
length: 0.3
gauge: 24 AWG # specify gauge in AWG directly
color_code: IEC # IEC 62 colors also supported
notes: This cable is a bit longer
W2:
<<: *template_cbl
length: 0.1
notes: This cable is a bit shorter
connections:
-
- X1: [1-4]
- W1: [1-4]
- X2: [1-4]
- # daisy chain connectors (in line)
- X2: [1-4]
- W2: [1-4]
- X3: [1-4]
```

[Source](tutorial04.yml) - [Bill of Materials](tutorial04.bom.tsv)
## 05 - Ferrules, wire bundles, custom wire colors
* Ferrules
* Simpler than connectors
* Compact graphical representation
* Only one pin, only one connection, no designator
* Define once, auto-generate where needed
* Wire bundles
* Internally treated as cables
* Different treatment in BOM: Each wire is listed individually
* Represented with dashed outline
* Custom wire colors
* Wirecount can be implicit in color list
```yaml
connectors:
X1:
pinlabels: [+12V, GND, GND, +5V]
type: Molex 8981
subtype: female
F1:
style: simple
type: Crimp ferrule
subtype: 0.5 mm²
color: OG # optional color
cables:
W1:
category: bundle # bundle
length: 0.3
gauge: 0.5 mm2
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
connections:
-
- F1. # a new ferrule is auto-generated for each of the four wires
- W1: [1-4]
- X1: [1-4]
```

[Source](tutorial05.yml) - [Bill of Materials](tutorial05.bom.tsv)
## 06 - Custom ferrules
* Custom ferrules
* Allows attaching more than one wire to a ferrule
* Requires defining them as regular connectors with unique designators, adding `category: ferrule` parameter
```yaml
connectors:
X1:
pinlabels: [+12V, GND, GND, +5V]
type: Molex 8981
subtype: female
F_10: # this is a unique ferrule
style: simple
type: Crimp ferrule
subtype: 1.0 mm²
color: YE # optional color
F_05: # this is a ferrule that will be auto-generated on demand
style: simple
type: Crimp ferrule
subtype: 0.5 mm²
color: OG
cables:
W1:
category: bundle # bundle
length: 0.3
gauge: 0.5 mm2
colors: [YE, BK, BK, RD] # custom colors, wirecount is implicit
connections:
-
- [F_05., F_10.F1, F_10.F1, F_05.]
- W1: [1-4]
- X1: [1-4]
```

[Source](tutorial06.yml) - [Bill of Materials](tutorial06.bom.tsv)
## 07 - Daisy chaining (II)
* Zig-zag daisy chain
* Convenient for longer chains
```yaml
connectors:
X1: &template_con
type: Molex KK 254
subtype: female
pinlabels: [GND, VCC, SCL, SDA]
X2:
<<: *template_con
X3:
<<: *template_con
X4:
<<: *template_con
X5:
<<: *template_con
X6:
<<: *template_con
cables:
W1: &template_wire
gauge: 0.25 mm2
length: 0.2
colors: [TQ, PK, YE, VT]
category: bundle
W2:
<<: *template_wire
W3:
<<: *template_wire
W4:
<<: *template_wire
W5:
<<: *template_wire
connections:
-
- X1: [1-4]
- W1: [1-4]
- X2: [1-4]
-
- X3: [1-4]
- W2: [1-4]
- X2: [1-4]
-
- X3: [1-4]
- W3: [1-4]
- X4: [1-4]
-
- X5: [1-4]
- W4: [1-4]
- X4: [1-4]
-
- X5: [1-4]
- W5: [1-4]
- X6: [1-4]
```

[Source](tutorial07.yml) - [Bill of Materials](tutorial07.bom.tsv)
## 08 - Part numbers and additional components
* Part number information can be added to parts
* Only provided fields will be added to the diagram and bom
* Bundles can have part information specified by wire
* Additional parts can be added to components or just to the bom
* quantities of additional components can be multiplied by features from parent connector or cable
```yaml
options:
mini_bom_mode: false
connectors:
X1: &template1 # define a template for later use
type: Molex KK 254
pincount: 4
subtype: female
manufacturer: '<a href="https://www.molex.com/">Molex</a>' # set manufacter name
mpn: '<a href="https://www.molex.com/molex/products/part-detail/crimp_housings/0022013047">22013047</a>' # set manufacturer part number
supplier: Digimouse
spn: 1234
# add a list of additional components to a part (shown in graph)
additional_components:
- type: Crimp # short identifier used in graph
subtype: Molex KK 254, 22-30 AWG # extra information added to type in bom
qty_multiplier: populated # multipier for quantity (number of populated pins)
manufacturer: Molex # set manufacter name
mpn: 08500030 # set manufacturer part number
- type: Test
qty: 1
pn: ABC
manufacturer: Molex
mpn: 45454
supplier: Mousikey
spn: 9999
X2:
<<: *template1 # reuse template
pn: CON4 # set an internal part number for just this connector
X3:
<<: *template1 # reuse template
cables:
W1:
wirecount: 4
length: 1
gauge: 0.25 mm2
color_code: IEC
manufacturer: CablesCo
mpn: ABC123
supplier: Cables R Us
spn: 999-888-777
pn: CAB1
W2:
category: bundle
length: 1
gauge: 0.25 mm2
colors: [YE, BK, BK, RD]
manufacturer: [WiresCo, WiresCo, WiresCo, WiresCo] # set a manufacter per wire
mpn: [W1-YE, W1-BK, W1-BK, W1-RD]
supplier: [WireShack, WireShack, WireShack, WireShack]
spn: [1001, 1002, 1002, 1009]
pn: [WIRE1, WIRE2, WIRE2, WIRE3]
# add a list of additional components to a part (shown in graph)
additional_components:
- type: Sleve # short identifier used in graph
subtype: Braided nylon, black, 3mm # extra information added to type in bom
qty_multiplier: length # multipier for quantity (length of cable)
unit: m
pn: SLV-1
connections:
- - X1: [1-4]
- W1: [1-4]
- X2: [1-4]
- - X1: [1-4]
- W2: [1-4]
- X3: [1-4]
additional_bom_items:
- # define an additional item to add to the bill of materials (does not appear in graph)
description: Label, pinout information
qty: 2
designators:
- X2
- X3
manufacturer: '<a href="https://www.bradyid.com">Brady</a>'
mpn: '<a href="https://www.bradyid.com/wire-cable-labels/bmp71-bmp61-m611-tls-2200-nylon-cloth-wire-general-id-labels-cps-2958789">B-499</a>'
pn: Label-ID-1
```

[Source](tutorial08.yml) - [Bill of Materials](tutorial08.bom.tsv)
|