Episode

View All

: The on-resistance of the CD4051 varies significantly with supply. At RONcap R sub cap O cap N end-sub is typically hundreds of ohms, whereas at it drops to approximately

The KiCad forum discussion linked earlier describes this process in detail for the ngspice simulator. It involves creating two separate subcircuits (one for multiplexing, one for demultiplexing) and using an .IF statement to select the correct signal path.

When running your simulation, keep in mind these parameters for a standard CD4051B, which the SPICE model should generally emulate: : 3V to 18V On-Resistance ( RONcap R sub cap O cap N end-sub ) : Approximately (higher at lower voltages).

Visit the Texas Instruments website, search for "CD4051B", and navigate to the "Design & development" tab on the product page.

is set to 15V but your simulation input source is sending 3.3V logic signals to pins A, B, and C, the switch will not trigger. CMOS logic high thresholds shift relative to VDDcap V sub cap D cap D end-sub

Once you have a .lib , .mod , or .subckt file, follow these steps to use it in your simulator: Open the Library : Drag and drop the .lib file into LTspice.

at 15V but increases significantly at lower voltages (hundreds of ohms at 5V). Ensure your model accurately reflects this voltage-dependent resistance. Open Nodes:

| Model Source | Simulator | File Link | Key Characteristics | Best For | | :--- | :--- | :--- | :--- | :--- | | | LTspice, Generic SPICE | SwitchAna.Lib | Community-created, includes CD4051, 4052, 4053. Includes CMOS transmission gate model. | Most analog simulations requiring accurate switch behavior. | | KiCad/ngspice Model | ngspice (KiCad, ngspice) | CD4051B._lib | User-created model for ngspice, tested with oscilloscope. | Mixed-signal simulations using open-source tools. | | Ideal Behavioral Switch | LTspice, ngspice, PSpice | N/A (built-in component) | Simple, fast, and functional. No model file needed. | Digital logic, control systems, keyboard matrix scanning. | | Custom Built Model | Any SPICE | N/A | Tailored to specific needs. | Niche or critical applications where other models fall short. |

) and control lines to be explicitly tied to a voltage source or ground. Floating pins will result in erratic behavioral states or matrix singular errors during simulation.

) can cause the simulator to stall. Adding a tiny amount of parasitic capacitance (e.g., ) or a small series resistor (