Source: cirosantilli/ciro-s-ascii-art-circuit-diagram-notation

= Ciro's ASCII art circuit diagram notation
{c}

This notation is designed to be relatively easy to write. This is achieved by not drawing ultra complex ASCII art boxes of every component. It would be slightly more readable if we did that, but prioritizing the writer here.

Two wires are only joined if `+` is given. E.g. the following two wires are not joined:
``
  |
--|--
  |
``
but the following are:
``
  |
--+--
  |
``

Simple symmetric components:
* `-`, `+` and `|`: wire
* `AC`: <AC source>. Parameters:
  * `Hz`: frequency
  * `V`: peak voltage
  e.g.:
  ``
  AC_1Hz_2V
  ``
  If only one side is given, the other is assumed to be at a ground `G`.
* `C`: <capacitor>
* `G`: ground. Often used together with `DC`, e.g.:
  ``
  DC_10---R_10---G
  ``
  means applying a voltage of 10 V across a 10 Ohm <resistor>, which would lead to a current of 1 A
* `L`: <inductor>
* `MICROPHONE`. As a multi-letter symmetric component, you can connect the two wires anywhere, e.g.
  ``
  ---MICROPHONE---
  ``
  or:
  ``
  |
  MICROPHONE
      |
  ``
* `SPEAKER`
* `R`: <resistor>
* `SQUID`: <SQUID device>
* `X`: <Josephson junction>

Asymmetric components have multiple letters indicating different ports. The capital letter indicates the device, and lower case letters the ports. The wires then go into the ports:
* `D`: <diode>
  * `a`: anode (where electrons can come in from)
  * `c`: cathode
  Sample usage in a circuit:
  ``
  --aDc--
  ``
  Can also be used vertically like aany other circuit:
  ``
  |
  a
  D
  c
  |
  ``
  We can also change the port order, the device is still the same due to capital `D`:
  ``
  --cDa--

   |
  Dac--

   |
  Dca--

     |
  --caD
  ``
* `DC` <DC source>. Ports:
  * `p`: positive
  * `n`: negative
  E.g. a 10 V source with a 10 Ohm resistor would be:
  ``
  +---pDC_10_n---+
  |              |
  +----R_10------+
  ``
  If only one side is given, the other is assumed to be at a the ground `G`. We can also omit `p` and `m` in that case and assume that `p` is the one used, e.g. the above would be equivalent to:
  ``
  DC_10---R_10---G
  ``
  If the voltage is not given, it is assumed to be a <potentiometer>.
* `T`: <transistor>. The ports are `sgTd`:
  * `s`: source
  * `g`: gate
  * `d`: gate
  Sample usage in a circuit:
  ``
  ---+
     |
  --sgTd--
  ``
  All the following are also equivalent:
  ``
     |
     g
  --sTd--

      |
  --Tsgd--
     |
  ``
* `I`: <electric current> source. Ports:
  * `s`: electron source
  * `d`: electron destination
* `V`: <Voltmeter>. Ports:
  * `p`: positive
  * `n`: negative
  If we don't need to specify explicit positive and negative sides, we can just use:
  ``
  ---V---
  ``
  without any ports. This is notably often the case for AC circuits.

  Optionaly, we can also add the sides as in:

Numbers characterizing components are put just next to each component with an underscore. When there is only one parameter, standard units are assumed, e.g.:
``
+-----+
|     |
C_1p  R_2k
|     |
+-----+
``
means:
* a capacitor with 1 pico Faraday
* a resistor with 2 k Ohms
Micro is denoted as `u`.

Wires can just freely come in and out of specs of a component, they are then just connected to the component, e.g.:
``
DC_10---R_10---G
``
means applying a voltage of 10 V across a 10 Ohm <resistor>, which would lead to a current of 1 A

If a component has more than two parameters, units are used to distinguish them when possible, e.g.:
``
AC_1kV_2MHz
``
means an <AC source> with:
* 1 kV <voltage>
* 1 MHz frequency