Pentax' built-in intervalometer is useful but IMO not ideal for star trails. I prefer a wired shutter release cable for the shortest possible pause between photos. Camera set to 30 second manual exposures, continuous-high shutter mode, then just lock the wired release button down for nonstop photos until you unlock the button.
This is the one I bought but the same exact item is resold under several different brand names
http://www.amazon.com/dp/B003VIGGSS
P.S. The device can also be used with bulb mode for timed exposures > 30 seconds. That's another benefit over the built in intervalometer.