How do I construct a SPICE model from a data-sheet?

Depending on the component the common method is to use a .MODEL card for basic elements (transistors, diodes) or for more complex components (ICs like Opamps, Regulators, etc) you can use either a sub-circuit model (made up of basic elements) or a behavioral model (using formulas to approximate behaviour)

This can get very complicated very quickly, how complex depends on how accurate you need the component to simulate, and requires pretty detailed knowledge of the component type so you know which datasheet parameters are important, how they translate to SPICE parameters, etc.

For an example of the type of parameters you need to know about (at least some of them), in LTSpice help look under LTSpice->Circuit Elements->Bipolar Transistor and look at the Gummel-Poon parameters.
As complex as this looks, you can use the defaults for most and just alter the basics like the Bf (Beta), Vje(b-e voltage), Cje (base emitter capacitance), Cjc, etc. It's helpful to look at the various models that come with LTSpice to get an idea of things.

The help provides a lot of useful information, so read it thoroughly. Also "A guide to Circuit Simulation using PSPICE" is a half decent book with some discussion of the model parameters. Also, google for info on the models, you should find plenty - for instance, here is an excellent document on the Gummel-Poon model and how to use it.


Here is a very good tutorial on how to build a .model statement for a MOSFET: http://www.simonbramble.co.uk/lt_spice/ltspice_lt_spice_tutorial_6.htm

Just to give a little more information here: there are two paths to create a component model. One uses a .subsckt statement and the other uses a .model statement.

For basic components like a MOSFET, it is better to use a .model statement. A MOSFET can be modeled with the template statement .model XXXX VDMOS(Rg= Rd=5 Rs=1 Vto= Kp= Cgdmax= Cgdmin= Cgs= Cjo= Is= Rb= ), where the parameters Rg, Rd, Rs etc. can be determined from the data sheet and other spice files.

An example is the Fairchild FDS6680A MOSFET with a model defined by the statement .model FDS6680A VDMOS(Rg=3 Rd=5m Rs=1m Vto=2.2 Kp=63 Cgdmax=2n Cgdmin=1n Cgs=1.9n Cjo=1n Is=2.3p Rb=6m mfg=Fairchild Vds=30 Ron=15m Qg=27n).


You need to be clear as to what you mean by component. Spice natively models transistors circuit elements, it is pluggable to put your own "C" models in (not all version can do this) but then you have to understand how SPICE works to make the models correctly. For larger more complex devices you can use macro-models or the more modern trend is to use Verilog-A.