Hey everyone! You can now embed fully interactive Wokwi circuit diagrams directly into your posts. Even better, you don’t need to write a single line of code to do it—you can build them visually right here in the forum!
How to Use the Visual Editor
The easiest way to share a circuit is to use the built-in drag-and-drop editor.
- Start Editing: Find any existing circuit on the forum (like the example below) and click the “Edit” button in its top right corner. The canvas will expand and reveal a toolbox on the right.
- Spawn Components: Scroll through the toolbox and click on any microcontroller, LED, sensor, or display to instantly drop it onto your canvas.
- Wire it Up: Hover your mouse over any component’s pins (they will highlight with a green circle). Click and drag to another pin to draw a wire.
- Delete: Made a mistake? Right-click on any component or wire to instantly delete it.
- Save & Share: When your circuit is ready, click “Save & Copy Code”. The editor will automatically generate the code and copy it to your clipboard. Simply paste it into your forum reply!
Try it Out: Blinking LED
Click the “Edit” button on the circuit below to play around with the editor. You can use this as a starting point for your own designs!
[wokwi-elements] { “parts”: [ { “type”: “wokwi-arduino-uno”, “id”: “uno”, “top”: 150, “left”: 50 }, { “type”: “wokwi-led”, “id”: “my-led”, “top”: 50, “left”: 250, “attrs”: { “color”: “red” } }, { “type”: “wokwi-resistor”, “id”: “r1”, “top”: 150, “left”: 250, “attrs”: { “value”: “220” } } ], “connections”: [ [ “uno:13”, “r1:1”, “red” ], [ “r1:2”, “my-led:A”, “red” ], [ “uno:GND.1”, “my-led:C”, “black” ] ] } [/wokwi-elements]
(Here is what the raw code looks like when you paste it into your reply):
[wokwi-elements]
{
“parts”: [
{ “type”: “wokwi-arduino-uno”, “id”: “uno”, “top”: 150, “left”: 50 },
{ “type”: “wokwi-led”, “id”: “my-led”, “top”: 50, “left”: 250, “attrs”: { “color”: “red” } },
{ “type”: “wokwi-resistor”, “id”: “r1”, “top”: 150, “left”: 250, “attrs”: { “value”: “220” } }
],
“connections”: [
[ “uno:13”, “r1:1”, “red” ],
[ “r1:2”, “my-led:A”, “red” ],
[ “uno:GND.1”, “my-led:C”, “black” ]
]
}
[/wokwi-elements]
Bonus: Under the Hood (JSON Code)
For advanced users who want to manually edit the generated code, everything lives inside [wokwi-elements] tags. The JSON requires two main sections:
parts: Defines the components. You must provide a valid Wokwitype(e.g., “wokwi-arduino-uno”) and a uniqueidfor each part. You can also specify its position (top,left) and anyattrs(like changing an LED’s color or a resistor’s value).connections: Defines the wires. You connect them by referencing the component’sidand exactpinname (e.g.,"uno:13"connects to"r1:1").
Supported Components & Advanced Attributes
If you are manually coding and need to figure out exactly what type names to use, or want to know what advanced attrs you can type in (like changing a 7-segment display’s color), check out the full Wokwi Component Database (Note: insert the link to your database post here). It lists the dimensions, pin names, and customizable attributes for all 50+ supported parts!
Happy building! ![]()