How does a seismometer work?

How does a seismometer work?