# Wiring and Nets

Wires connect component pins into **electrical nets**. This page covers drawing wires, connecting pins, placing net labels, and using power symbols.

---

## Drawing Wires

### Activating the Wire tool

Press ++w++ or click the **Wire** button on the toolbar.

### How to draw a wire

1. **Click** on a component pin (or any point on the canvas) to start a wire
2. A temporary wire follows the cursor — drawn **orthogonally** (horizontal and vertical segments only) and snapped to the grid. Press ++space++ to flip whether the first bend goes horizontal or vertical
3. **Click** to add each corner vertex
4. **Click a pin or an existing wire** to finish there — the wire snaps to it. To finish at a free point, **double-click**
5. ++esc++ cancels the wire you are drawing

### Image — Wire attached to two component pins

![The 16 MHz crystal Y2 wired to its two 22 pF load capacitors, C2 and C3](../assets/wf/docs/schematic/wiring-and-nets/wire-attached-to-two-component-pins.png)
| Action | Input |
|---|---|
| Start a wire | Click on a pin or canvas point |
| Add a corner | Click |
| Flip the bend direction | ++space++ |
| End on a pin or wire | Click it |
| End at a free point | Double-click |
| Cancel the wire being drawn | ++esc++ |
| Leave the Wire tool | ++esc++ again |

!!! tip "Starting from a pin snaps automatically"
    When you click on a pin tip, WireFrame snaps the first vertex precisely to that pin — no manual alignment needed.

---

## Connecting Wires to Pins and Existing Wires

### To another pin

- The final vertex **snaps** to the target pin position
- Both pins are now on the same net

### To an existing wire

- The new wire shares the meeting point with the existing wire
- WireFrame merges them into a **single net**

Use the shared GND net label or power symbol at the intended connection points. WireFrame merges connected wire segments and matching global power labels into the same net.

---

## Junction Dots

A **junction dot** appears when three or more wires meet at a single point:

### Image — Junction compared with a wire crossing

![Left: a junction dot joins three wires into one net. Right: the GND wire crosses the same wire with no dot, so the two stay separate](../assets/wf/docs/schematic/wiring-and-nets/junction-compared-with-a-wire-crossing.png)
- Junction dots are **placed automatically** when three or more connections share a point
- You can also place them manually with the **Junction** tool
- Two crossing wires **without** a junction are not electrically connected

---

## Editing Existing Wires

| Operation | How |
|---|---|
| **Move a vertex** | Drag a point on the wire |
| **Drag a segment** | Click and drag a segment between two vertices → adds two new vertices, moves orthogonally |
| **Delete a wire** | Select + ++delete++ |

!!! info "Auto-simplification"
    After dragging a segment, WireFrame automatically removes redundant collinear vertices — keeping the wire geometry clean.

---

## Net Labels

Net labels allow you to **connect two points electrically without drawing a wire between them**. Labels with the same name belong to the same net.

### How to place a net label

1. Press ++n++ or click the **Label** tool
2. Click on the canvas to place a label. It gets a suggested name such as `NET_1`
3. Select it and edit the **Value** in the Properties panel (e.g. `SDA`, `SCL`, `+3V3`, `RESET`)
4. All wires connected to that label share the **same net name**

For example, matching `SDA` labels at the controller and sensor place both endpoints on the same named net even when no wire spans the page between them.

!!! tip "Use consistent names"
    All labels with the same name (e.g. `+3V3`) merge into a single net — even on different parts of the sheet. This is the cleanest way to distribute power to multiple components.

---

## Power Symbols (GND, VCC)

| Symbol | Shortcut | Description |
|---|---|---|
| **Place GND** | ++g++ | Ground reference — implicitly connects all GND pins |
| **Place VCC** | ++p++ | Positive supply rail, named `VCC`; change its **Value** (e.g. `+3V3`) for another rail |

Power symbols are single-pin components that automatically assign a net name to any wire connected to them.

### Image — Power symbols on a decoupling capacitor

![C5 (100 nF) across the supply beside the battery BT1: a Vcc net label above, a GND symbol below, PWR_FLAG on both rails](../assets/wf/docs/schematic/wiring-and-nets/power-symbols-on-a-decoupling-capacitor.png)
The KLP4e datalogger brings its supply to each part with **net labels** named `Vcc` rather than with a supply symbol, and ground with **GND** symbols — both are ways of naming a net. The `PWR_FLAG` markers come from the KiCad project; WireFrame keeps them on the sheet as drawn.

---

## Net Highlighting

Click on any wire or net label:
- **All wires and pins on that net** are highlighted in a distinct color
- Useful for tracing connectivity in complex schematics

Click on empty canvas to clear the highlight.

---

## Auto Wire

**Tools → Auto Wire** draws wires for the connections the active schematic's netlist already contains, using an orthogonal router that runs locally (no AI request is sent). Use it to tidy a sheet whose connectivity is right but whose wiring is missing or messy, then inspect:

- that every wire ends on the intended pin;
- that labels and junctions are still readable;
- that no wire crosses a symbol or hides an annotation.

A whole auto-wire run is one step in the undo history — **Ctrl+Z** takes it back.

---

## How the Netlist is Built

WireFrame automatically constructs the netlist from all wires, pins, and labels:

1. Groups all wires that share vertices into **clusters**
2. Collects all pins attached to each cluster
3. Determines the net name by priority:
    1. **Net label / power symbol** values (highest priority)
    2. Pin-based default names (e.g. `Net_U1_1`)
    3. Wire-based fallback names (e.g. `Net_Wire_42`)

This netlist is used for:
- Net highlighting on the canvas
- PCB netlist generation when converting to PCB
- DRC consistency checks between schematic and PCB

---

## See Also

- [Placing Components](placing-components.md) — place the symbols that wires connect
- [Properties & Attributes](properties-and-attributes.md) — edit net names and component values
- [PCB Editor](../pcb/index.md) — the netlist built here drives PCB routing
