I2C IC for part identification
An EEPROM is the usual solution. The RAM SPD (Serial Presence Detect) function uses an EEPROM on an I2C bus. 

The chips are remarkably inexpensive, for example the Microchip AT34C02D is $0.03 in 100 quantity at Digikey (factory price is 0.13 each, as Abe Karplus mentions, so that's a clearance price). 

For your application you might not need to program the EEPROM (256 bytes), but doing so could allow you to encode revision numbers etc.