FreeCircuitSim

How to Create Custom Components — Subcircuits and Custom Logic Chips

You can build your own components in FreeCircuitSim in two ways: package any working circuit as a reusable subcircuit (a "black box" chip with pins you choose), or define a custom logic chip from a simple truth-table definition. Both are built into the simulator — no code, download or account needed.

Two Ways to Make Your Own Component

On a small screen, swipe the table sideways to see all columns.

SubcircuitCustom logic chip
What it isAny circuit you built, packaged as one block with labelled pinsA digital chip whose behaviour you write as input → output patterns
Works withAnalog and digital parts — resistors, diodes, transistors, op-amps, gates, other subcircuitsDigital signals only (logic HIGH / LOW, plus high-impedance)
Best forRectifier bridges, amplifier stages, filters, adders built from gatesDecoders, counters, flip-flops, comparators, any truth table
Where to find itFile → Create Subcircuit...Right-click → Digital Chips → Add Custom Logic

Part 1 — Create a Subcircuit

A subcircuit turns a group of components into a single reusable block. The pins of the block come from labeled nodes you place on the circuit before you package it.

→ Open a bridge rectifier ready to package

Build and test the circuit

Draw the circuit you want to reuse and run it once to check it behaves the way you expect. It is much easier to fix a problem now than after it is packaged.

Mark every input and output with a labeled node

Right-click the canvas and choose Outputs and Labels → Add Labeled Node. Attach one to each point that should become a pin, and give it a short name such as in+, out or EN. Each labeled node becomes one pin of your new component.

Tip: if you need a labeled node inside the circuit but do not want it to become a pin, double-click it and tick Internal Node.

Choose File → Create Subcircuit...

A symbol editor opens showing your pins. Drag the pins to the sides where you want them, type a model name (for example bridge), and click OK. If you selected part of the circuit before choosing this menu item, only the selected parts are packaged.

Place your new component

Right-click and choose Active Building Blocks → Add Subcircuit Instance, then click and drag on the canvas. Double-click the block to choose which model it uses (it defaults to the one you just made) or to edit its pin layout. You can place as many copies as you like.

Save or share it

The subcircuit model is stored inside the circuit itself. Use File → Save As... to keep a file, or File → Export As Link... to share a URL — anyone who opens it gets your custom component too.

See finished examples from the simulator's own library:

▶ Full-wave rectifier as a subcircuit ▶ 4-bit adder built from nested subcircuits

In both examples, double-click a block and press View Components to look inside it.

Make the pins look like a real chip

The name of a labeled node changes how its pin is drawn on the symbol. These prefixes are purely cosmetic — they do not change the signal:

Part 2 — Create a Custom Logic Chip

A custom logic chip lets you describe a digital device with text instead of wiring it from gates. Right-click and choose Digital Chips → Add Custom Logic, place it, then double-click it to edit its model. You fill in five fields:

How the definition works

The simulator checks the rules from the top and uses the first one whose left side matches the current inputs. The pattern characters are:

If the left side is longer than the number of inputs, the extra characters are matched against the chip's current outputs. That is how you give a chip memory. Spaces are ignored, so you can use them to separate inputs from outputs.

Example 1: 3-input NAND gate

Inputs:     A,B,C
Outputs:    X
Definition: 111=0
            ???=1

If all three inputs are HIGH the output is LOW; any other combination falls through to the second rule and gives HIGH.

Example 2: Full adder

Inputs:     A,B,C
Outputs:    S,C
Definition: 111=11
            110=10
            011=10
            101=10
            100=01
            010=01
            001=01
            000=00

The two output digits are the sum S and carry C — this is simply the full-adder truth table written one row per line.

Example 3: D flip-flop (a chip with memory)

Inputs:     D,Clk
Outputs:    Q,/Q
Definition: ?? 00=10
            0+ ??=01
            1+ ??=10
            ?? AB=AB

The first two characters match D and Clk; the last two match the current outputs. Line 1 sets a valid starting state when the circuit resets. Lines 2 and 3 copy D to Q on a rising clock edge. Line 4 keeps the outputs unchanged at all other times.

Subcircuit or Custom Logic — Which Should You Use?

What You Cannot Build

FreeCircuitSim simulates circuits, not code. There is no microcontroller or Arduino component, so you cannot run a sketch, and there is no stepper motor. The simulator does include a DC motor and a 3-phase motor (right-click → Outputs and Labels), so you can still design and test the driver side — transistor switches, relays and H-bridges. If you need to run Arduino code, a code-focused simulator such as Wokwi or Tinkercad Circuits is the better tool; you can then use FreeCircuitSim to check the analog parts of the design.

Common Mistakes

No labeled nodes

Create Subcircuit needs labeled nodes to know where the pins are. Without them the block has no connections.

Unwanted extra pins

Every labeled node becomes a pin unless you tick Internal Node on the ones used only inside the circuit.

Rules in the wrong order

Custom logic uses the first matching rule. Put specific rules first and catch-all rules like ???=1 last.

No reset rule for memory

Chips with state should start with a rule such as ?? 00=10 so the outputs begin in a valid state after a reset.

Frequently Asked Questions

Can I make my own component in FreeCircuitSim?
Yes. Package any circuit as a subcircuit with File → Create Subcircuit, using labeled nodes as its pins, or define a digital chip with right-click → Digital Chips → Add Custom Logic and a truth-table style definition.
Are my custom components saved with the circuit?
Yes. Subcircuit and custom logic models are stored inside the circuit, so saving it with File → Save As or sharing it with File → Export As Link keeps your components with it.
Can I simulate an Arduino, a microcontroller or a stepper motor?
No. FreeCircuitSim has no microcontroller or Arduino component and no stepper motor. It does include a DC motor and a 3-phase motor, so you can simulate driver circuits. For running Arduino code, use a code-focused simulator such as Wokwi or Tinkercad Circuits.
What do the symbols in a custom logic definition mean?
0 and 1 are logic LOW and HIGH, + and - are rising and falling transitions, ? means don't care, letters such as A and B copy a matched value to the output, and _ sets an output to high-impedance. The first rule that matches is used.

Related Guides

Beginner
Logic Gates — Step by Step
Intermediate
Bridge Rectifier — Step by Step
Beginner
How to Use the Simulator
Intermediate
Transistor as a Switch

← Back to all guides

← Back to All Guides