Start simulating free

diagram.json Format

diagram.json describes the circuit of a project: the parts on the canvas and the wires between them. You can read and edit it in the diagram.json tab of the editor; valid changes are applied to the canvas immediately, and invalid ones show an error without changing anything.

Example

{
  "version": 1,
  "editor": "circzy",
  "board": "uno",
  "parts": [
    { "id": "uno", "type": "arduino-uno", "x": 0, "y": 0, "rotate": 0, "flip": false, "color": "", "value": "", "level": 0 },
    { "id": "led1", "type": "led", "x": 260, "y": -120, "rotate": 0, "flip": false, "color": "red", "value": "", "level": 0 },
    { "id": "r1", "type": "resistor", "x": 240, "y": -40, "rotate": 90, "flip": false, "color": "", "value": "220", "level": 0 }
  ],
  "wires": [
    { "id": "w1", "from": { "partId": "uno", "pin": "13" }, "to": { "partId": "r1", "pin": "1" }, "color": "#1f9d48", "points": [] },
    { "id": "w2", "from": { "partId": "r1", "pin": "2" }, "to": { "partId": "led1", "pin": "A" }, "color": "#1f9d48", "points": [] },
    { "id": "w3", "from": { "partId": "led1", "pin": "C" }, "to": { "partId": "uno", "pin": "GND.1" }, "color": "#1c1c1c", "points": [{ "x": 300, "y": 40 }] }
  ]
}

Top-level fields

FieldTypeDescription
versionnumberFormat version. Currently 1.
editorstringAlways "circzy".
boardstringThe board ID of the project: uno, nano, mega, esp32, d1mini-esp32, d1r32, nodemcu, nodemcu-amica, d1mini, pico or bluepill.
partsarrayThe parts on the canvas, including the board.
wiresarrayThe connections between pins.

Parts

FieldTypeDescription
idstringRequired. A unique name, used by wires.
typestringRequired. The part type, for example led, dht22 or arduino-uno. The type of every part is listed in the Parts Reference.
x, ynumberPosition of the top-left corner on the canvas, in pixels.
rotatenumber0, 90, 180 or 270 degrees.
flipbooleanMirrors the part, for parts that support it.
colorstringThe color option, for example red for an LED or blue for an LCD. Empty when the part has no color option.
valuestringThe value option: resistor value in ohms ("220"), note text, RFID card UID, DIP switch states ("01000000"), logic analyzer range and so on.
levelnumberThe state of an input or the main sensor value: potentiometer position (0–1023), switch position, sensor reading.
paramsobjectExtra sensor values, for parts with several sliders, for example { "temperature": 24, "humidity": 40 } for a DHT22.

The diagram must contain the project's board, and no board of another type. Missing optional fields get their default values.

Wires

FieldTypeDescription
idstringRequired. A unique name.
from, toobjectThe two ends: { "partId": "…", "pin": "…" }. The pin must exist on that part.
colorstringA CSS color. The editor uses the ten wire colors.
pointsarrayBend points { "x", "y" } in canvas coordinates, in order from from to to. Empty for a direct wire.

Pin names

Pins are named after the labels printed on the parts: 13, A0, GND.1 on an Arduino Uno; D21, 3V3 on an ESP32 DevKit; VCC, GND, SDA, SCL on an I²C module; A and C for LED anode and cathode; 1 and 2 for resistor legs. When several pins share a name, a suffix such as .1 and .2 makes them unique; pins with the same base name are connected to each other.

Breadboard holes are named <column><half>.<row>, for example 12t.a or 5b.j, and rail holes tp.3, tn.3, bp.3 and bn.3.

Validation errors

MessageCause
Invalid JSONThe text is not valid JSON. Check commas and quotes.
Must contain "parts" and "wires" arraysOne of the arrays is missing.
parts[n]: "id" is requiredA part without an ID.
parts[n]: unknown part typeThe type is not a Circzy part.
parts[n]: id is used more than onceTwo parts share an ID.
parts[n]: this project uses …A board of another type was added.
The diagram must contain …The project's board is missing.
wires[n]: pin not foundA wire refers to a part or pin that does not exist.
wires[n]: must contain "id", "from", and "to"A wire is missing one of its required fields.
wires[n]: id is used more than onceTwo wires share an ID.
wires[n]: bend points must contain x and yA point in points is incomplete.

Ready to try it?

Sign in with Google, pick a board and run your first simulation in two minutes. Free during the launch period.

Start simulating free