AN-004 application note
Circuit diagrams, timing charts and interactive maths
CircuiTikZ schematics, WaveDrom timing and register maps, live CircuitJS simulations, KiCad viewers, JSXGraph plots and Cytoscape networks — all from plain Markdown.
Every diagram on this page is written as text inside a fenced code block, so it lives in Git next to the article and can be edited in Obsidian. All the tools are free and open source.
| Need | Block | Tool | Rendered |
|---|---|---|---|
| Schematic for an article | ```circuitikz |
CircuiTikZ via TikZJax | at build → SVG |
| Any TikZ / pgfplots figure | ```tikz |
TikZJax | at build → SVG |
| Timing diagram, register map | ```wavedrom |
WaveDrom | at build → SVG |
| Circuit readers can play with | ```circuitjs |
Falstad CircuitJS | live simulation |
| Your real KiCad project | ```kicanvas |
KiCanvas | interactive viewer |
| Draggable maths & geometry | ```jsxgraph |
JSXGraph | interactive |
| Networks & graph theory | ```cytoscape |
Cytoscape.js | interactive |
| Flowcharts, state machines | ```mermaid |
Mermaid | in browser |
Schematics with CircuiTikZ
The industry-standard LaTeX package for circuit diagrams. Rendered once at build time, so readers
download only a small SVG. Add title="…" for a caption and width=… to size it.
\usepackage{circuitikz} is added for you. Components go in to[...]: R, C, L, D,
led, V, I, battery, switch, ground… (the op amp node needs fonts TikZJax lacks, so draw its triangle by hand as above) See the
CircuiTikZ manual. pgfplots, chemfig and tikz-cd work the same
way inside a ```tikz block.
Timing diagrams and register maps with WaveDrom
Live circuit simulation with CircuitJS
Build the circuit at falstad.com/circuit, then
File → Export As Text and paste it into a ```circuitjs block. Readers can watch currents
flow and change values. Add editable to let them modify the circuit.
Your KiCad schematics and PCBs with KiCanvas
Put KiCad 6+ files in public/kicad/ and list them in a block. Readers can zoom, pan, click
parts and toggle PCB layers:
```kicanvas height=520 title="Vibration node — main board"
kicad/vibration-node.kicad_sch
kicad/vibration-node.kicad_pcb
```
Interactive maths and geometry with JSXGraph
The block is JavaScript with board and JXG available. Drag the slider or the points.
const tau = board.create('slider', [[5, 1.12], [9, 1.12], [0.2, 1.5, 5]], { name: 'τ' });
board.create('functiongraph', [x => 1 - Math.exp(-x / tau.Value()), 0, 10], { strokeWidth: 2.5, strokeColor: '#0a6b4d' });
board.create('functiongraph', [x => x / tau.Value(), 0, 10], { strokeWidth: 1, dash: 2, strokeColor: '#b0521b' });
board.create('text', [0.3, 1.0, () => `63 % at t = ${tau.Value().toFixed(2)} s`]);const A = board.create('point', [-3, -2], { name: 'A' });
const B = board.create('point', [3, -2], { name: 'B' });
const C = board.create('point', [0.5, 3], { name: 'C' });
board.create('polygon', [A, B, C], { fillOpacity: 0.12 });
board.create('circumcircle', [A, B, C], { strokeColor: '#b0521b', strokeWidth: 2 });Networks and graph theory with Cytoscape.js
Write edges as A -> B : label (directed) or A -- B (undirected), nodes as A : Label or
A [group]. JSON ({ "elements": [...], "style": [...] }) works too. Layouts: cose, circle,
grid, breadthfirst, concentric.
Cloud [hub] : MQTT broker Gateway -> Cloud : TLS Node1 -> Gateway : LoRa Node2 -> Gateway : LoRa Node3 -> Gateway : LoRa Node1 : Vibration node Node2 : PT100 node Node3 : 4–20 mA node
Flowcharts and state machines with Mermaid
stateDiagram-v2 [*] --> Boot Boot --> VerifyB: TRIAL flag set VerifyB --> RunB: signature OK VerifyB --> RunA: bad signature RunB --> Confirmed: self-test passed RunB --> RunA: watchdog / 3 attempts Boot --> RunA: no update pending