hc gilje posted some useful notes on accessing the serial ports of an iPhone. Bottom line:
Apple has not made it easy to let the iphone communicate with external devices. Basically, you need a jailbroken phone to do anything.
That said, his notes are useful for anyone who’s really really got to get at the serial port.
Other ways of getting sensors into the iPhone include Tellart’s NADAMobile, which uses the microphone input as an analog input, and Brian Jepson’s PhoneGap solution, which uses ethernet and an ethernet shield.